• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP strip_insert_tags函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中strip_insert_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP strip_insert_tags函数的具体用法?PHP strip_insert_tags怎么用?PHP strip_insert_tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了strip_insert_tags函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $arrJumpTo = array();
     $arrNewsletter = array();
     $strRequest = ampersand(\Environment::get('request'), true);
     $objNewsletter = \NewsletterModel::findSentByPids($this->nl_channels);
     if ($objNewsletter !== null) {
         while ($objNewsletter->next()) {
             if (($objTarget = $objNewsletter->getRelated('pid')) === null) {
                 continue;
             }
             $jumpTo = intval($objTarget->jumpTo);
             // A jumpTo page is not mandatory for newsletter channels (see #6521) but required for the list module
             if ($jumpTo < 1) {
                 throw new \Exception("Newsletter channels without redirect page cannot be used in a newsletter list");
             }
             $strUrl = $strRequest;
             if (!isset($arrJumpTo[$objTarget->jumpTo])) {
                 $objJumpTo = $objTarget->getRelated('jumpTo')->loadDetails();
                 if ($objJumpTo !== null) {
                     $arrJumpTo[$objTarget->jumpTo] = $this->generateFrontendUrl($objJumpTo->row(), \Config::get('useAutoItem') && !\Config::get('disableAlias') ? '/%s' : '/items/%s');
                 } else {
                     $arrJumpTo[$objTarget->jumpTo] = $strUrl;
                 }
             }
             $strUrl = $arrJumpTo[$objTarget->jumpTo];
             $strAlias = $objNewsletter->alias != '' && !\Config::get('disableAlias') ? $objNewsletter->alias : $objNewsletter->id;
             $arrNewsletter[] = array('subject' => $objNewsletter->subject, 'title' => strip_insert_tags($objNewsletter->subject), 'href' => sprintf($strUrl, $strAlias), 'date' => \Date::parse($objPage->dateFormat, $objNewsletter->date), 'datim' => \Date::parse($objPage->datimFormat, $objNewsletter->date), 'time' => \Date::parse($objPage->timeFormat, $objNewsletter->date), 'channel' => $objNewsletter->channel);
         }
     }
     $this->Template->newsletters = $arrNewsletter;
 }
开发者ID:iCodr8,项目名称:core,代码行数:36,代码来源:ModuleNewsletterList.php


示例2: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $arrJumpTo = array();
     $arrNewsletter = array();
     $objNewsletter = \NewsletterModel::findSentByPids($this->nl_channels);
     if ($objNewsletter !== null) {
         while ($objNewsletter->next()) {
             if (($objTarget = $objNewsletter->getRelated('pid')) === null || !$objTarget->jumpTo) {
                 continue;
             }
             if (!isset($arrJumpTo[$objTarget->jumpTo])) {
                 $objJumpTo = \PageModel::findPublishedById($objTarget->jumpTo);
                 if ($objJumpTo !== null) {
                     $arrJumpTo[$objTarget->jumpTo] = $this->generateFrontendUrl($objJumpTo->row(), $GLOBALS['TL_CONFIG']['useAutoItem'] ? '/%s' : '/items/%s');
                 } else {
                     $arrJumpTo[$objTarget->jumpTo] = null;
                 }
             }
             $strUrl = $arrJumpTo[$objTarget->jumpTo];
             if ($strUrl === null) {
                 continue;
             }
             $strAlias = $objNewsletter->alias != '' && !$GLOBALS['TL_CONFIG']['disableAlias'] ? $objNewsletter->alias : $objNewsletter->id;
             $arrNewsletter[] = array('subject' => $objNewsletter->subject, 'title' => strip_insert_tags($objNewsletter->subject), 'href' => sprintf($strUrl, $strAlias), 'date' => $this->parseDate($objPage->dateFormat, $objNewsletter->date), 'datim' => $this->parseDate($objPage->datimFormat, $objNewsletter->date), 'time' => $this->parseDate($objPage->timeFormat, $objNewsletter->date), 'channel' => $objNewsletter->channel);
         }
     }
     $this->Template->newsletters = $arrNewsletter;
 }
开发者ID:rikaix,项目名称:core,代码行数:32,代码来源:ModuleNewsletterList.php


示例3: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $this->Template->products = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     $this->Template->relateds_headline = $GLOBALS['TL_LANG']['MSC']['relateds_headline'];
     $objProduct = \ProductModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->catalogs);
     if (null === $objProduct) {
         /** @var \PageError404 $objHandler */
         $objHandler = new $GLOBALS['TL_PTY']['error_404']();
         $objHandler->generate($objPage->id);
     }
     // Overwrite the page title
     if ($objProduct->title != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objProduct->title));
     }
     // Overwrite the page description
     if ($objProduct->description != '') {
         $objPage->description = $this->prepareMetaDescription($objProduct->description);
     }
     $arrProduct = $this->parseProduct($objProduct);
     $this->Template->product = $arrProduct;
     $objProduct->related = deserialize($objProduct->related);
     if (!empty($objProduct->related)) {
         $objProducts = \ProductModel::findPublishedByIds($objProduct->related);
         $this->Template->relateds = $this->parseRelateds($objProducts);
     }
 }
开发者ID:respinar,项目名称:contao-product,代码行数:32,代码来源:ModuleProductDetail.php


示例4: compile

 protected function compile()
 {
     global $objPage;
     $this->Controller = new MemberPlus($this->objModel);
     $this->Template->members = '';
     // Get the member item
     $objMember = MemberPlusMemberModel::findActiveByParentAndIdOrAlias(\Input::get('items'), $this->mlGroups);
     if ($objMember === null) {
         // Do not index or cache the page
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         // Send a 404 header
         header('HTTP/1.1 404 Not Found');
         $this->Template->members = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>';
         return;
     }
     $strMember = $this->Controller->parseMember($objMember);
     $this->Template->members = $strMember;
     $strCombinedTitle = $this->Controller->getCombinedTitle($objMember);
     // Overwrite the page title (see #2853 and #4955)
     if ($strCombinedTitle != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($strCombinedTitle));
     }
     // Overwrite the page description
     //		if ($objArticle->teaser != '')
     //		{
     //			$objPage->description = $this->prepareMetaDescription($objArticle->teaser);
     //		}
 }
开发者ID:heimrichhannot,项目名称:contao-member_plus,代码行数:29,代码来源:ModuleMemberReader.php


示例5: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     /** @var PageModel $objPage */
     global $objPage;
     $this->Template->content = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     $objNewsletter = \NewsletterModel::findSentByParentAndIdOrAlias(\Input::get('items'), $this->nl_channels);
     if (null === $objNewsletter) {
         throw new PageNotFoundException('Page not found');
     }
     // Overwrite the page title (see #2853 and #4955)
     if ($objNewsletter->subject != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objNewsletter->subject));
     }
     // Add enclosure
     if ($objNewsletter->addFile) {
         $this->addEnclosuresToTemplate($this->Template, $objNewsletter->row(), 'files');
     }
     // Support plain text newsletters (thanks to Hagen Klemp)
     if ($objNewsletter->sendText) {
         $strContent = nl2br_html5($objNewsletter->text);
     } else {
         $strContent = str_ireplace(' align="center"', '', $objNewsletter->content);
     }
     // Parse simple tokens and insert tags
     $strContent = $this->replaceInsertTags($strContent);
     $strContent = \StringUtil::parseSimpleTokens($strContent, array());
     // Encode e-mail addresses
     $strContent = \StringUtil::encodeEmail($strContent);
     $this->Template->content = $strContent;
     $this->Template->subject = $objNewsletter->subject;
 }
开发者ID:burguin,项目名称:test02,代码行数:36,代码来源:ModuleNewsletterReader.php


示例6: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $this->Template->content = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     if (TL_MODE == 'FE' && BE_USER_LOGGED_IN) {
         $objNewsletter = \NewsletterModel::findByIdOrAlias(\Input::get('items'));
     } else {
         $objNewsletter = \NewsletterModel::findSentByParentAndIdOrAlias(\Input::get('items'), $this->nl_channels);
     }
     if ($objNewsletter === null) {
         // Do not index or cache the page
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         // Send a 404 header
         header('HTTP/1.1 404 Not Found');
         $this->Template->content = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>';
         return;
     }
     // Overwrite the page title (see #2853 and #4955)
     if ($objNewsletter->subject != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objNewsletter->subject));
     }
     // Add enclosure
     if ($objNewsletter->addFile) {
         $this->addEnclosuresToTemplate($this->Template, $objNewsletter->row(), 'files');
     }
     if (!$objNewsletter->sendText) {
         $nl2br = $objPage->outputFormat == 'xhtml' ? 'nl2br_xhtml' : 'nl2br_html5';
         $strContent = '';
         $objContentElements = \ContentModel::findPublishedByPidAndTable($objNewsletter->id, 'tl_newsletter');
         if ($objContentElements !== null) {
             if (!defined('NEWSLETTER_CONTENT_PREVIEW')) {
                 define('NEWSLETTER_CONTENT_PREVIEW', true);
             }
             foreach ($objContentElements as $objContentElement) {
                 $strContent .= $this->getContentElement($objContentElement->id);
             }
         }
         // Parse simple tokens and insert tags
         $strContent = $this->replaceInsertTags($strContent);
         $strContent = \String::parseSimpleTokens($strContent, array());
         // Encode e-mail addresses
         $strContent = \String::encodeEmail($strContent);
         $this->Template->content = $strContent;
     } else {
         $strContent = str_ireplace(' align="center"', '', $objNewsletter->content);
     }
     // Convert relative URLs
     $strContent = $this->convertRelativeUrls($strContent);
     // Parse simple tokens and insert tags
     $strContent = $this->replaceInsertTags($strContent);
     $strContent = \String::parseSimpleTokens($strContent, array());
     // Encode e-mail addresses
     $strContent = \String::encodeEmail($strContent);
     $this->Template->content = $strContent;
     $this->Template->subject = $objNewsletter->subject;
 }
开发者ID:hojanssen,项目名称:newsletter_content,代码行数:62,代码来源:ModuleNewsletterReader.php


示例7: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     // Get all active pages
     $objPages = \PageModel::findPublishedRegularWithoutGuestsByIds($this->pages);
     // Return if there are no pages
     if ($objPages === null) {
         return;
     }
     $arrPages = array();
     // Sort the array keys according to the given order
     if ($this->orderPages != '') {
         $tmp = deserialize($this->orderPages);
         if (!empty($tmp) && is_array($tmp)) {
             $arrPages = array_map(function () {
             }, array_flip($tmp));
         }
     }
     // Add the items to the pre-sorted array
     while ($objPages->next()) {
         /** @var PageModel $objModel */
         $objModel = $objPages->current();
         $arrPages[$objPages->id] = $objModel->loadDetails()->row();
         // see #3765
     }
     $items = array();
     foreach ($arrPages as $arrPage) {
         $arrPage['title'] = strip_insert_tags($arrPage['title']);
         $arrPage['pageTitle'] = strip_insert_tags($arrPage['pageTitle']);
         // Get href
         switch ($arrPage['type']) {
             case 'redirect':
                 $href = $arrPage['url'];
                 break;
             case 'forward':
                 if (($objNext = \PageModel::findPublishedById($arrPage['jumpTo'])) !== null) {
                     $strForceLang = null;
                     $objNext->loadDetails();
                     // Check the target page language (see #4706)
                     if (\Config::get('addLanguageToUrl')) {
                         $strForceLang = $objNext->language;
                     }
                     $href = $this->generateFrontendUrl($objNext->row(), null, $strForceLang, true);
                     break;
                 }
                 // DO NOT ADD A break; STATEMENT
             // DO NOT ADD A break; STATEMENT
             default:
                 $href = $this->generateFrontendUrl($arrPage, null, $arrPage['rootLanguage'], true);
                 break;
         }
         $items[] = array('href' => $href, 'title' => specialchars($arrPage['pageTitle'] ?: $arrPage['title']), 'link' => $arrPage['title']);
     }
     $this->Template->items = $items;
     $this->Template->formId = 'tl_quicklink_' . $this->id;
     $this->Template->request = ampersand(\Environment::get('request'), true);
     $this->Template->title = $this->customLabel ?: $GLOBALS['TL_LANG']['MSC']['quicklink'];
     $this->Template->button = specialchars($GLOBALS['TL_LANG']['MSC']['go']);
 }
开发者ID:Mozan,项目名称:core-bundle,代码行数:61,代码来源:ModuleQuicklink.php


示例8: saveCookieName

 public function saveCookieName($strString, $ObjDataContainer)
 {
     $arrSearch = array('/[^a-zA-Z0-9 _-]+/', '/ +/', '/\\-+/');
     $arrReplace = array('', '-', '-');
     $strString = html_entity_decode($strString, ENT_QUOTES, $GLOBALS['TL_CONFIG']['characterSet']);
     $strString = strip_insert_tags($strString);
     $strString = utf8_romanize($strString);
     $strString = preg_replace($arrSearch, $arrReplace, $strString);
     return trim($strString, '-');
 }
开发者ID:menatwork,项目名称:geolocation,代码行数:10,代码来源:tl_settings.php


示例9: check

 /**
  * Run the test
  *
  * @param array  $data
  * @param string $table
  *
  * @throws ErrorException
  * @throws WarningException
  */
 private function check($value)
 {
     $value = strip_tags(strip_insert_tags($value));
     // The description does not exist
     if (!$value) {
         throw new ErrorException($GLOBALS['TL_LANG']['SST']['test.description']['empty']);
     }
     // The description is too long
     if (utf8_strlen($value) > self::MAX_LENGTH) {
         throw new WarningException(sprintf($GLOBALS['TL_LANG']['SST']['test.description']['length'], self::MAX_LENGTH));
     }
 }
开发者ID:derhaeuptling,项目名称:contao-seo-serp-preview,代码行数:21,代码来源:DescriptionTest.php


示例10: slugify

 /**
  * Slugify a value.
  *
  * @param string $value     Given value.
  * @param string $separator Separator string.
  *
  * @return string
  */
 private function slugify($value, $separator)
 {
     $arrSearch = array('/[^a-zA-Z0-9 \\.\\&\\/_-]+/', '/[ \\.\\&\\/-]+/');
     $arrReplace = array('', $separator);
     $value = html_entity_decode($value, ENT_QUOTES, $this->charset);
     $value = strip_insert_tags($value);
     $value = utf8_romanize($value);
     $value = preg_replace($arrSearch, $arrReplace, $value);
     if (!$this->preserveUppercase) {
         $value = strtolower($value);
     }
     return trim($value, $separator);
 }
开发者ID:netzmacht,项目名称:contao-toolkit,代码行数:21,代码来源:SlugifyFilter.php


示例11: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     // Get all active pages
     $objPages = \PageModel::findPublishedRegularWithoutGuestsByIds($this->pages);
     // Return if there are no pages
     if ($objPages === null) {
         return;
     }
     $arrPages = array();
     // Sort the array keys according to the given order
     if ($this->orderPages != '') {
         $tmp = deserialize($this->orderPages);
         if (!empty($tmp) && is_array($tmp)) {
             $arrPages = array_map(function () {
             }, array_flip($tmp));
         }
     }
     $arrPages = array_values(array_filter($arrPages));
     // Add the items to the pre-sorted array
     while ($objPages->next()) {
         $arrPages[$objPages->id] = $objPages->current();
     }
     $items = array();
     /** @var \PageModel[] $arrPages */
     foreach ($arrPages as $objPage) {
         $objPage->title = strip_insert_tags($objPage->title);
         $objPage->pageTitle = strip_insert_tags($objPage->pageTitle);
         // Get href
         switch ($objPage->type) {
             case 'redirect':
                 $href = $objPage->url;
                 break;
             case 'forward':
                 if (($objNext = $objPage->getRelated('jumpTo')) !== null) {
                     /** @var \PageModel $objNext */
                     $href = $objNext->getFrontendUrl();
                     break;
                 }
                 // DO NOT ADD A break; STATEMENT
             // DO NOT ADD A break; STATEMENT
             default:
                 $href = $objPage->getFrontendUrl();
                 break;
         }
         $items[] = array('href' => $href, 'title' => specialchars($objPage->pageTitle ?: $objPage->title), 'link' => $objPage->title);
     }
     $this->Template->items = $items;
     $this->Template->request = ampersand(\Environment::get('request'), true);
     $this->Template->title = $this->customLabel ?: $GLOBALS['TL_LANG']['MSC']['quicklink'];
     $this->Template->button = specialchars($GLOBALS['TL_LANG']['MSC']['go']);
 }
开发者ID:bytehead,项目名称:contao-core,代码行数:54,代码来源:ModuleQuicklink.php


示例12: standardize

/**
 * Standardize a parameter (strip special characters and convert spaces)
 *
 * @param string  $strString
 * @param boolean $blnPreserveUppercase
 *
 * @return string
 */
function standardize($strString, $blnPreserveUppercase = false)
{
    $arrSearch = array('/[^a-zA-Z0-9 \\.\\&\\/_-]+/', '/[ \\.\\&\\/-]+/');
    $arrReplace = array('', '-');
    $strString = html_entity_decode($strString, ENT_QUOTES, $GLOBALS['TL_CONFIG']['characterSet']);
    $strString = strip_insert_tags($strString);
    $strString = utf8_romanize($strString);
    $strString = preg_replace($arrSearch, $arrReplace, $strString);
    if (is_numeric(substr($strString, 0, 1))) {
        $strString = 'id-' . $strString;
    }
    if (!$blnPreserveUppercase) {
        $strString = strtolower($strString);
    }
    return trim($strString, '-');
}
开发者ID:jamesdevine,项目名称:core-bundle,代码行数:24,代码来源:functions.php


示例13: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $this->Template->carpets = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     $objCarpet = \CarpetModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->carpet_categories);
     // Overwrite the page title
     if ($objCarpet->title != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objCarpet->title));
     }
     // Overwrite the page description
     if ($objCarpet->description != '') {
         $objPage->description = $this->prepareMetaDescription($objCarpet->description);
     }
     $arrCarpet = $this->parseCarpet($objCarpet);
     $this->Template->carpets = $arrCarpet;
 }
开发者ID:respinar,项目名称:contao-carpet,代码行数:21,代码来源:ModuleCarpetDetail.php


示例14: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     // Get all active pages
     $arrPages = \PageModel::findPublishedRegularWithoutGuestsByIds($this->pages)->getData();
     if (empty($arrPages)) {
         return;
     }
     $items = array();
     foreach ($arrPages as $arrPage) {
         $arrPage['title'] = strip_insert_tags($arrPage['title']);
         $arrPage['pageTitle'] = strip_insert_tags($arrPage['pageTitle']);
         $items[] = array('href' => $this->generateFrontendUrl($arrPage), 'title' => specialchars($arrPage['pageTitle'] ?: $arrPage['title']), 'link' => $arrPage['title']);
     }
     $this->Template->items = $items;
     $this->Template->request = ampersand(\Environment::get('request'), true);
     $this->Template->title = $this->customLabel ?: $GLOBALS['TL_LANG']['MSC']['quicklink'];
     $this->Template->button = specialchars($GLOBALS['TL_LANG']['MSC']['go']);
 }
开发者ID:rikaix,项目名称:core,代码行数:21,代码来源:ModuleQuicklink.php


示例15: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $this->Template->employee = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     $objEmployee = \StaffEmployeeModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->staff_categories);
     // Overwrite the page title
     if ($objEmployee->title != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objEmployee->firstname . ' ' . $objEmployee->lastname));
     }
     // Overwrite the page description
     if ($objEmployee->description != '') {
         $objPage->description = $this->prepareMetaDescription($objEmployee->description);
     }
     $arrEmployee = $this->parseEmployee($objEmployee);
     $this->Template->employee = $arrEmployee;
 }
开发者ID:respinar,项目名称:contao-staff,代码行数:21,代码来源:ModuleStaffDetail.php


示例16: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $this->Template->albums = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     $objAlbum = \PhotogalleryAlbumModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->photogalleries);
     // Overwrite the page title
     if ($objAlbum->title != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objAlbum->title));
     }
     // Overwrite the page description
     if ($objProduct->description != '') {
         $objPage->description = $this->prepareMetaDescription($objAlbum->description);
     }
     $arrAlbum = $this->parseAlbumFull($objAlbum);
     $this->Template->albums = $arrAlbum;
 }
开发者ID:respinar,项目名称:contao-photogallery,代码行数:21,代码来源:ModulePhotogalleryDetail.php


示例17: compile

 /**
  * Generate the content element
  */
 protected function compile()
 {
     $objProduct = IsotopeFrontend::getProductByAlias($this->iso_product, IsotopeFrontend::getReaderPageId());
     if (!$objProduct) {
         $this->Template = new FrontendTemplate('mod_message');
         $this->Template->type = 'empty';
         $this->Template->message = $GLOBALS['TL_LANG']['MSC']['invalidProductInformation'];
         return;
     }
     $this->Template->product = $objProduct->generate(strlen($this->iso_product_template) ? $this->iso_product_template : $objProduct->reader_template, $this);
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     if ($this->iso_overwrite_page_meta) {
         global $objPage;
         $objPage->pageTitle = strip_insert_tags($objProduct->name);
         $objPage->description = $this->prepareMetaDescription($objProduct->description_meta);
     }
     $GLOBALS['TL_KEYWORDS'] .= (strlen($GLOBALS['TL_KEYWORDS']) ? ', ' : '') . $objProduct->keywords_meta;
 }
开发者ID:numero2,项目名称:contao-isotope-ce,代码行数:22,代码来源:ContentIsotopeProduct.php


示例18: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $this->Template->product = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     $this->Template->txt_types = $GLOBALS['TL_LANG']['MSC']['txt_types'];
     $this->Template->txt_pieces = $GLOBALS['TL_LANG']['MSC']['txt_pieces'];
     $this->Template->txt_relateds = $GLOBALS['TL_LANG']['MSC']['txt_relateds'];
     // Generate products
     $objKitchenwareProduct = \KitchenwareProductModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->kitchenware_categories);
     $arrKitchenwareProduct = $this->parseProduct($objKitchenwareProduct);
     $objPage->pageTitle = strip_tags(strip_insert_tags($objKitchenwareProduct->title));
     $objPage->description = strip_tags(strip_insert_tags($objKitchenwareProduct->meta_description));
     $this->Template->product = $arrKitchenwareProduct;
     // Generate pieces
     if ($this->kitchenware_piece_show) {
         $objKitchenwarePieces = \KitchenwarePieceModel::findPublishedByPid($objKitchenwareProduct->id);
         if ($objKitchenwarePieces !== null) {
             $this->Template->pieces = $this->parsePieces($objKitchenwarePieces);
         }
     }
     // Generate types
     if ($this->kitchenware_type_show) {
         $objKitchenwareTypes = \KitchenwareTypeModel::findPublishedByPid($objKitchenwareProduct->id);
         if ($objKitchenwareTypes !== null) {
             $this->Template->types = $this->parseTypes($objKitchenwareTypes);
         }
     }
     // Generate relateds
     if ($this->kitchenware_related_show and $objKitchenwareProduct->related) {
         $this->relateds = deserialize($objKitchenwareProduct->related);
         $objKitchenwareRelateds = \KitchenwareProductModel::findPublishedByIds($this->relateds);
         if ($objKitchenwareRelateds !== null) {
             $this->Template->relateds = $this->parseRelateds($objKitchenwareRelateds);
         }
     }
 }
开发者ID:respinar,项目名称:contao-kitchenware,代码行数:41,代码来源:ModuleKitchenwareDetail.php


示例19: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     /** @var \PageModel $objPage */
     global $objPage;
     $this->Template->articles = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     // Get the news item
     $objArticle = \NewsModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->news_archives);
     if (null === $objArticle) {
         /** @var \PageError404 $objHandler */
         $objHandler = new $GLOBALS['TL_PTY']['error_404']();
         $objHandler->generate($objPage->id);
     }
     $arrArticle = $this->parseArticle($objArticle);
     $this->Template->articles = $arrArticle;
     // Overwrite the page title (see #2853 and #4955)
     if ($objArticle->headline != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objArticle->headline));
     }
     // Overwrite the page description
     if ($objArticle->teaser != '') {
         $objPage->description = $this->prepareMetaDescription($objArticle->teaser);
     }
     // HOOK: comments extension required
     if ($objArticle->noComments || !in_array('comments', \ModuleLoader::getActive())) {
         $this->Template->allowComments = false;
         return;
     }
     /** @var \NewsArchiveModel $objArchive */
     $objArchive = $objArticle->getRelated('pid');
     $this->Template->allowComments = $objArchive->allowComments;
     // Comments are not allowed
     if (!$objArchive->allowComments) {
         return;
     }
     // Adjust the comments headline level
     $intHl = min(intval(str_replace('h', '', $this->hl)), 5);
     $this->Template->hlc = 'h' . ($intHl + 1);
     $this->import('Comments');
     $arrNotifies = array();
     // Notify the system administrator
     if ($objArchive->notify != 'notify_author') {
         $arrNotifies[] = $GLOBALS['TL_ADMIN_EMAIL'];
     }
     // Notify the author
     if ($objArchive->notify != 'notify_admin') {
         /** @var \UserModel $objAuthor */
         if (($objAuthor = $objArticle->getRelated('author')) !== null && $objAuthor->email != '') {
             $arrNotifies[] = $objAuthor->email;
         }
     }
     $objConfig = new \stdClass();
     $objConfig->perPage = $objArchive->perPage;
     $objConfig->order = $objArchive->sortOrder;
     $objConfig->template = $this->com_template;
     $objConfig->requireLogin = $objArchive->requireLogin;
     $objConfig->disableCaptcha = $objArchive->disableCaptcha;
     $objConfig->bbcode = $objArchive->bbcode;
     $objConfig->moderate = $objArchive->moderate;
     $this->Comments->addCommentsToTemplate($this->Template, $objConfig, 'tl_news', $objArticle->id, $arrNotifies);
 }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:65,代码来源:ModuleNewsReader.php


示例20: getQuicknavPages

 /**
  * Recursively get all quicknav pages and return them as array
  *
  * @param integer $pid
  * @param integer $level
  * @param string  $host
  * @param string  $language
  *
  * @return array
  */
 protected function getQuicknavPages($pid, $level = 1, $host = null, $language = null)
 {
     /** @var \PageModel $objPage */
     global $objPage;
     $groups = array();
     $arrPages = array();
     // Get all groups of the current front end user
     if (FE_USER_LOGGED_IN) {
         $this->import('FrontendUser', 'User');
         $groups = $this->User->groups;
     }
     // Get all active subpages
     $objSubpages = \PageModel::findPublishedRegularWithoutGuestsByPid($pid);
     if ($objSubpages === null) {
         return array();
     }
     ++$level;
     while ($objSubpages->next()) {
         $_groups = deserialize($objSubpages->groups);
         // Override the domain (see #3765)
         if ($host !== null) {
             $objSubpages->domain = $host;
         }
         // Do not show protected pages unless a back end or front end user is logged in
         if (!$objSubpages->protected || !is_array($_groups) && FE_USER_LOGGED_IN || BE_USER_LOGGED_IN || is_array($_groups) && array_intersect($_groups, $groups) || $this->showProtected) {
             // Do not skip the current page here! (see #4523)
             // Check hidden pages
             if (!$objSubpages->hide || $this->showHidden) {
                 if ($objSubpages->domain != '' && $objSubpages->domain != \Environment::get('host')) {
                     /** @var \PageModel $objModel */
                     $objModel = $objSubpages->current();
                     $objModel->loadDetails();
                 }
                 $href = $this->generateFrontendUrl($objSubpages->row(), null, $language, true);
                 $arrPages[] = array('level' => $level - 2, 'title' => specialchars(strip_insert_tags($objSubpages->pageTitle ?: $objSubpages->title)), 'href' => $href, 'link' => strip_insert_tags($objSubpages->title));
                 // Subpages
                 if (!$this->showLevel || $this->showLevel >= $level || !$this->hardLimit && ($objPage->id == $objSubpages->id || in_array($objPage->id, $this->Database->getChildRecords($objSubpages->id, 'tl_page')))) {
                     $subpages = $this->getQuicknavPages($objSubpages->id, $level);
                     if (is_array($subpages)) {
                         $arrPages = array_merge($arrPages, $subpages);
                     }
                 }
             }
         }
     }
     return $arrPages;
 }
开发者ID:jamesdevine,项目名称:core-bundle,代码行数:57,代码来源:ModuleQuicknav.php



注:本文中的strip_insert_tags函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP strip_links函数代码示例发布时间:2022-05-23
下一篇:
PHP strip_image_tags函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap