当前位置: 首页>>代码示例>>PHP>>正文


PHP strip_insert_tags函数代码示例

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


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


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