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


PHP ampersand函数代码示例

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


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

示例1: run

 /**
  * Generate the module
  *
  * @return string
  */
 public function run()
 {
     /** @var BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_maintenance_mode');
     $objTemplate->action = ampersand(\Environment::get('request'));
     $objTemplate->headline = $GLOBALS['TL_LANG']['tl_maintenance']['maintenanceMode'];
     $objTemplate->isActive = $this->isActive();
     try {
         $driver = \System::getContainer()->get('lexik_maintenance.driver.factory')->getDriver();
         $isLocked = $driver->isExists();
     } catch (\Exception $e) {
         return '';
     }
     // Toggle the maintenance mode
     if (\Input::post('FORM_SUBMIT') == 'tl_maintenance_mode') {
         if ($isLocked) {
             $driver->unlock();
         } else {
             $driver->lock();
         }
         $this->reload();
     }
     if ($isLocked) {
         $objTemplate->class = 'tl_confirm';
         $objTemplate->explain = $GLOBALS['TL_LANG']['MSC']['maintenanceEnabled'];
         $objTemplate->submit = $GLOBALS['TL_LANG']['tl_maintenance']['maintenanceDisable'];
     } else {
         $objTemplate->class = 'tl_info';
         $objTemplate->explain = $GLOBALS['TL_LANG']['MSC']['maintenanceDisabled'];
         $objTemplate->submit = $GLOBALS['TL_LANG']['tl_maintenance']['maintenanceEnable'];
     }
     return $objTemplate->parse();
 }
开发者ID:contao,项目名称:core-bundle,代码行数:38,代码来源:Maintenance.php

示例2: compile

 /**
  * Generate module
  */
 protected function compile()
 {
     // Create files
     if (\Input::post('FORM_SUBMIT') == 'tl_newsport') {
         $objModel = NewsportConfigModel::findByPk($this->objDc->id);
         if ($objModel === null) {
             return;
         }
         $importer = new NewsImporter($objModel);
         if ($importer->run()) {
             // Confirm and reload
             \Message::addConfirmation($GLOBALS['TL_LANG']['tl_newsport_config']['confirm']);
             $this->reload();
         }
     }
     $this->Template->base = \Environment::get('base');
     $this->Template->href = $this->getReferer(true);
     $this->Template->title = specialchars($GLOBALS['TL_LANG']['MSC']['backBTTitle']);
     $this->Template->action = ampersand(\Environment::get('request'));
     $this->Template->selectAll = $GLOBALS['TL_LANG']['MSC']['selectAll'];
     $this->Template->button = $GLOBALS['TL_LANG']['MSC']['backBT'];
     $this->Template->message = \Message::generate();
     $this->Template->submit = specialchars($GLOBALS['TL_LANG']['tl_newsport_config']['import'][0]);
     $this->Template->headline = sprintf($GLOBALS['TL_LANG']['tl_newsport_config']['headline'], \Input::get('id'));
     $this->Template->explain = $GLOBALS['TL_LANG']['tl_newsport_config']['make'][1];
     $this->Template->label = $GLOBALS['TL_LANG']['tl_newsport_config']['label'];
 }
开发者ID:heimrichhannot,项目名称:contao-newsport,代码行数:30,代码来源:ModuleNewsport.php

示例3: forCut

 /**
  * Return the "cut" button
  *
  * @param array  $row
  * @param string $href
  * @param string $label
  * @param string $title
  * @param string $icon
  * @param string $attributes
  *
  * @return string
  */
 public function forCut($row, $href, $label, $title, $icon, $attributes)
 {
     if ($row['pid'] == 0) {
         return '';
     }
     return '<a href="' . preg_replace('/&(amp;)?id=[^& ]*/i', '', ampersand(\Environment::get('request'))) . '&amp;act=paste&amp;mode=cut&amp;table=tl_iso_product&amp;id=' . $row['id'] . '&amp;pid=' . \Input::get('id') . '&rt=' . \Input::get('rt') . '" title="' . specialchars($title) . '"' . $attributes . ' onclick="Backend.getScrollOffset();">' . \Image::getHtml($icon, $label) . '</a> ';
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:19,代码来源:Button.php

示例4: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     /** @var \PageModel $objPage */
     global $objPage;
     $lang = null;
     $host = null;
     // Start from the website root if there is no reference page
     if (!$this->rootPage) {
         $this->rootPage = $objPage->rootId;
     } else {
         $objRootPage = \PageModel::findWithDetails($this->rootPage);
         // Set the language
         if (\Config::get('addLanguageToUrl') && $objRootPage->rootLanguage != $objPage->rootLanguage) {
             $lang = $objRootPage->rootLanguage;
         }
         // Set the domain
         if ($objRootPage->rootId != $objPage->rootId && $objRootPage->domain != '' && $objRootPage->domain != $objPage->domain) {
             $host = $objRootPage->domain;
         }
     }
     $this->Template->formId = 'tl_quicknav_' . $this->id;
     $this->Template->targetPage = $GLOBALS['TL_LANG']['MSC']['targetPage'];
     $this->Template->button = specialchars($GLOBALS['TL_LANG']['MSC']['go']);
     $this->Template->title = $this->customLabel ?: $GLOBALS['TL_LANG']['MSC']['quicknav'];
     $this->Template->request = ampersand(\Environment::get('request'), true);
     $this->Template->items = $this->getQuicknavPages($this->rootPage, 1, $host, $lang);
 }
开发者ID:jamesdevine,项目名称:core-bundle,代码行数:30,代码来源:ModuleQuicknav.php

示例5: generateCreditUrl

 protected function generateCreditUrl($objCredit)
 {
     if ($objCredit->page === null) {
         return null;
     }
     $strCacheKey = 'id-' . $objCredit->page->id . '-' . $objCredit->result->ptable . '-' . $objCredit->parent->id;
     $autoitem = null;
     switch ($objCredit->result->ptable) {
         case 'tl_news':
             $autoitem = 'items';
             break;
         case 'tl_calendar_events':
             $autoitem = 'events';
             break;
         default:
             if (isset($GLOBALS['TL_FILECREDIT_MODELS'][$objCredit->result->ptable])) {
                 $autoitem = $GLOBALS['TL_FILECREDIT_MODELS'][$objCredit->result->ptable];
             }
     }
     // Load the URL from cache
     if (isset(self::$arrUrlCache[$strCacheKey])) {
         return self::$arrUrlCache[$strCacheKey];
     }
     if (is_null($autoitem)) {
         self::$arrUrlCache[$strCacheKey] = $this->generateFrontendUrl($objCredit->page->row());
     } else {
         self::$arrUrlCache[$strCacheKey] = ampersand($this->generateFrontendUrl($objCredit->page->row(), ($GLOBALS['TL_CONFIG']['useAutoItem'] && !$GLOBALS['TL_CONFIG']['disableAlias'] ? '/' : '/' . $autoitem . '/') . (!$GLOBALS['TL_CONFIG']['disableAlias'] && $objCredit->parent->alias != '' ? $objCredit->parent->alias : $objCredit->parent->id)));
     }
     return self::$arrUrlCache[$strCacheKey];
 }
开发者ID:pandroid,项目名称:contao-filecredits,代码行数:30,代码来源:FileCredit.php

示例6: run

 /**
  * Generate the module
  *
  * @return string
  */
 public function run()
 {
     $arrJobs = array();
     /** @var BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_purge_data');
     $objTemplate->isActive = $this->isActive();
     $objTemplate->message = \Message::generateUnwrapped();
     // Run the jobs
     if (\Input::post('FORM_SUBMIT') == 'tl_purge') {
         $purge = \Input::post('purge');
         if (!empty($purge) && is_array($purge)) {
             foreach ($purge as $group => $jobs) {
                 foreach ($jobs as $job) {
                     list($class, $method) = $GLOBALS['TL_PURGE'][$group][$job]['callback'];
                     $this->import($class);
                     $this->{$class}->{$method}();
                 }
             }
         }
         \Message::addConfirmation($GLOBALS['TL_LANG']['tl_maintenance']['cacheCleared']);
         $this->reload();
     }
     // Tables
     foreach ($GLOBALS['TL_PURGE']['tables'] as $key => $config) {
         $arrJobs[$key] = array('id' => 'purge_' . $key, 'title' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][0], 'description' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][1], 'group' => 'tables', 'affected' => '');
         // Get the current table size
         foreach ($config['affected'] as $table) {
             $objCount = $this->Database->execute("SELECT COUNT(*) AS count FROM " . $table);
             $arrJobs[$key]['affected'] .= '<br>' . $table . ': <span>' . sprintf($GLOBALS['TL_LANG']['MSC']['entries'], $objCount->count) . ', ' . $this->getReadableSize($this->Database->getSizeOf($table), 0) . '</span>';
         }
     }
     $strCachePath = str_replace(TL_ROOT . DIRECTORY_SEPARATOR, '', \System::getContainer()->getParameter('kernel.cache_dir'));
     // Folders
     foreach ($GLOBALS['TL_PURGE']['folders'] as $key => $config) {
         $arrJobs[$key] = array('id' => 'purge_' . $key, 'title' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][0], 'description' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][1], 'group' => 'folders', 'affected' => '');
         // Get the current folder size
         foreach ($config['affected'] as $folder) {
             $total = 0;
             $folder = sprintf($folder, $strCachePath);
             // Only check existing folders
             if (is_dir(TL_ROOT . '/' . $folder)) {
                 $objFiles = Finder::create()->in(TL_ROOT . '/' . $folder)->files();
                 $total = iterator_count($objFiles);
             }
             $arrJobs[$key]['affected'] .= '<br>' . $folder . ': <span>' . sprintf($GLOBALS['TL_LANG']['MSC']['files'], $total) . '</span>';
         }
     }
     // Custom
     foreach ($GLOBALS['TL_PURGE']['custom'] as $key => $job) {
         $arrJobs[$key] = array('id' => 'purge_' . $key, 'title' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][0], 'description' => $GLOBALS['TL_LANG']['tl_maintenance_jobs'][$key][1], 'group' => 'custom');
     }
     $objTemplate->jobs = $arrJobs;
     $objTemplate->action = ampersand(\Environment::get('request'));
     $objTemplate->headline = $GLOBALS['TL_LANG']['tl_maintenance']['clearCache'];
     $objTemplate->job = $GLOBALS['TL_LANG']['tl_maintenance']['job'];
     $objTemplate->description = $GLOBALS['TL_LANG']['tl_maintenance']['description'];
     $objTemplate->submit = \StringUtil::specialchars($GLOBALS['TL_LANG']['tl_maintenance']['clearCache']);
     $objTemplate->help = \Config::get('showHelp') && $GLOBALS['TL_LANG']['tl_maintenance']['cacheTables'][1] != '' ? $GLOBALS['TL_LANG']['tl_maintenance']['cacheTables'][1] : '';
     return $objTemplate->parse();
 }
开发者ID:contao,项目名称:core-bundle,代码行数:65,代码来源:PurgeData.php

示例7: generateAddActions

 public function generateAddActions($arrData, $id, Watchlist $objWatchlist)
 {
     global $objPage;
     if ($objPage === null) {
         return;
     }
     if (\Validator::isUuid($id)) {
         $objFile = \FilesModel::findByUuid($id);
     } else {
         $objFile = \FilesModel::findBy('path', $id);
     }
     $objItem = new WatchlistItemModel();
     $objItem->pid = Watchlist::getInstance()->getId();
     $objItem->uuid = $objFile->uuid;
     $objItem->pageID = $objPage->id;
     $objItem->cid = $arrData['id'];
     $objItem->type = $arrData['type'];
     $objT = new \FrontendTemplate('watchlist_add_actions');
     $objT->addHref = ampersand(\Controller::generateFrontendUrl($objPage->row()) . '?act=' . WATCHLIST_ACT_ADD . '&cid=' . $objItem->cid . '&type=' . $objItem->type . '&id=' . $strUuid . '&title=' . urlencode($objItem->getTitle()));
     $objT->addTitle = $GLOBALS['TL_LANG']['WATCHLIST']['addTitle'];
     $objT->addLink = $GLOBALS['TL_LANG']['WATCHLIST']['addLink'];
     $objT->active = $objWatchlist->isInList($strUuid);
     $objT->id = $strUuid;
     return $objT->parse();
 }
开发者ID:heimrichhannot,项目名称:contao-watchlist,代码行数:25,代码来源:WatchlistItemEnclosure.php

示例8: compile

 /**
  * Generate module
  */
 protected function compile()
 {
     $this->Template->trackingWidget = $this->generateTrackingWidget();
     $arrResponse = array();
     $arrTrackingNumbers = array();
     if ($this->Input->post('FORM_SUBMIT') == $this->strFormId && !$this->doNotSubmit) {
         if ($this->Input->post('tracking_number') || $this->Input->get('tracking_number')) {
             $arrTrackingNumbers = preg_split("/[\\s,]+/", $this->Input->post('tracking_number'));
         }
     } elseif ($this->Input->get('tracking_number')) {
         $arrTrackingNumbers[] = $this->Input->get('tracking_number');
     }
     if (count($arrTrackingNumbers)) {
         foreach ($arrTrackingNumbers as $tracking) {
             $tracking = new FedExAPITracking($tracking, array());
             $xml = $tracking->buildRequest();
             $arrResult = $tracking->sendRequest($xml);
             $arrResponses[] = $this->parseResponse($arrResult['TrackResponse']);
         }
     }
     $this->Template->datimLabel = $GLOBALS['TL_LANG']['MSC']['fedexTrackDatimLabel'];
     $this->Template->activityLabel = $GLOBALS['TL_LANG']['MSC']['fedexTrackActivityLabel'];
     $this->Template->locationLabel = $GLOBALS['TL_LANG']['MSC']['fedexTrackLocationLabel'];
     $this->Template->detailsLabel = $GLOBALS['TL_LANG']['MSC']['fedexTrackDetailsLabel'];
     $this->Template->action = ampersand($this->Environment->request, ENCODE_AMPERSANDS);
     $this->Template->formId = $this->strFormId;
     $this->Template->formSubmit = $this->strFormId;
     $this->Template->enctype = 'application/x-www-form-urlencoded';
     $this->Template->slabel = $GLOBALS['TL_LANG']['MSC']['submitTracking'];
     $this->Template->trackingNumberLabel = $GLOBALS['TL_LANG']['MSC']['trackingNumberLabel'];
     $this->Template->trackingResults = $arrResponses;
 }
开发者ID:rhymedigital,项目名称:isotope_fedexshipping,代码行数:35,代码来源:FedExTracking.php

示例9: getTagsForArticle

 private function getTagsForArticle($max_tags = 0, $relevance = 0, $target = 0)
 {
     $table = 'tl_article';
     $id = $this->id;
     $arrTags = $this->Database->prepare("SELECT * FROM tl_tag WHERE from_table = ? AND tid = ? ORDER BY tag ASC")->execute($table, $id)->fetchAllAssoc();
     $res = false;
     if (count($arrTags)) {
         if ($max_tags > 0) {
             $arrTags = array_slice($arrTags, 0, $max_tags);
         }
         $arrTagsWithCount = $this->Database->prepare("SELECT tag, COUNT(tag) as tagcount FROM tl_tag WHERE from_table = ? GROUP BY tag ORDER BY tag ASC")->execute($table)->fetchAllAssoc();
         $countarray = array();
         foreach ($arrTagsWithCount as $data) {
             $countarray[$data['tag']] = $data['tagcount'];
         }
         foreach ($arrTags as $idx => $tag) {
             $arrTags[$idx]['tagcount'] = $countarray[$tag['tag']];
             $arrTags[$idx]['tag_class'] = \Contao\TagList::_getTagNameClass($tag['tag']);
         }
         if ($relevance == 1) {
             usort($arrTags, array($this, 'sortByRelevance'));
         }
         if (strlen($target)) {
             $pageArr = array();
             $objFoundPage = $this->Database->prepare("SELECT id, alias FROM tl_page WHERE id=? OR alias=?")->limit(1)->execute(array($target, $target));
             $pageArr = $objFoundPage->numRows ? $objFoundPage->fetchAssoc() : array();
             if (count($pageArr)) {
                 foreach ($arrTags as $idx => $tag) {
                     $arrTags[$idx]['url'] = ampersand($this->generateFrontendUrl($pageArr, '/tag/' . $tag['tag']));
                 }
             }
         }
     }
     return $arrTags;
 }
开发者ID:AgentCT,项目名称:tags,代码行数:35,代码来源:ModuleArticle.php

示例10: run

 /**
  * Run the controller and parse the login template
  *
  * @return Response
  */
 public function run()
 {
     /** @var BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_login');
     $strHeadline = sprintf($GLOBALS['TL_LANG']['MSC']['loginTo'], \Config::get('websiteTitle'));
     $objTemplate->theme = \Backend::getTheme();
     $objTemplate->messages = \Message::generate();
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->languages = \System::getLanguages(true);
     $objTemplate->title = \StringUtil::specialchars($strHeadline);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->action = ampersand(\Environment::get('request'));
     $objTemplate->userLanguage = $GLOBALS['TL_LANG']['tl_user']['language'][0];
     $objTemplate->headline = $strHeadline;
     $objTemplate->curLanguage = \Input::post('language') ?: str_replace('-', '_', $GLOBALS['TL_LANGUAGE']);
     $objTemplate->curUsername = \Input::post('username') ?: '';
     $objTemplate->uClass = $_POST && empty($_POST['username']) ? ' class="login_error"' : '';
     $objTemplate->pClass = $_POST && empty($_POST['password']) ? ' class="login_error"' : '';
     $objTemplate->loginButton = \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['loginBT']);
     $objTemplate->username = $GLOBALS['TL_LANG']['tl_user']['username'][0];
     $objTemplate->password = $GLOBALS['TL_LANG']['MSC']['password'][0];
     $objTemplate->feLink = $GLOBALS['TL_LANG']['MSC']['feLink'];
     $objTemplate->default = $GLOBALS['TL_LANG']['MSC']['default'];
     $objTemplate->jsDisabled = $GLOBALS['TL_LANG']['MSC']['jsDisabled'];
     return $objTemplate->getResponse();
 }
开发者ID:contao,项目名称:core-bundle,代码行数:32,代码来源:BackendIndex.php

示例11: run

 /**
  * Run the controller and parse the login template
  */
 public function run()
 {
     $this->Template = new BackendTemplate('be_login');
     // Show a cookie warning
     if (Input::get('referer', true) != '' && empty($_COOKIE)) {
         $this->Template->noCookies = $GLOBALS['TL_LANG']['MSC']['noCookies'];
     }
     $strHeadline = sprintf($GLOBALS['TL_LANG']['MSC']['loginTo'], Config::get('websiteTitle'));
     $this->Template->theme = Backend::getTheme();
     $this->Template->messages = Message::generate();
     $this->Template->base = Environment::get('base');
     $this->Template->language = $GLOBALS['TL_LANGUAGE'];
     $this->Template->languages = System::getLanguages(true);
     $this->Template->title = specialchars($strHeadline);
     $this->Template->charset = Config::get('characterSet');
     $this->Template->action = ampersand(Environment::get('request'));
     $this->Template->userLanguage = $GLOBALS['TL_LANG']['tl_user']['language'][0];
     $this->Template->headline = $strHeadline;
     $this->Template->curLanguage = Input::post('language') ?: str_replace('-', '_', $GLOBALS['TL_LANGUAGE']);
     $this->Template->curUsername = Input::post('username') ?: '';
     $this->Template->uClass = $_POST && empty($_POST['username']) ? ' class="login_error"' : '';
     $this->Template->pClass = $_POST && empty($_POST['password']) ? ' class="login_error"' : '';
     $this->Template->loginButton = specialchars($GLOBALS['TL_LANG']['MSC']['loginBT']);
     $this->Template->username = $GLOBALS['TL_LANG']['tl_user']['username'][0];
     $this->Template->password = $GLOBALS['TL_LANG']['MSC']['password'][0];
     $this->Template->feLink = $GLOBALS['TL_LANG']['MSC']['feLink'];
     $this->Template->frontendFile = Environment::get('base');
     $this->Template->disableCron = Config::get('disableCron');
     $this->Template->ie6warning = sprintf($GLOBALS['TL_LANG']['ERR']['ie6warning'], '<a href="http://ie6countdown.com">', '</a>');
     $this->Template->default = $GLOBALS['TL_LANG']['MSC']['default'];
     $this->Template->output();
 }
开发者ID:iCodr8,项目名称:core,代码行数:35,代码来源:index.php

示例12: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     /** @var PageModel $objPage */
     global $objPage;
     // Set the trail and level
     if ($this->defineRoot && $this->rootPage > 0) {
         $trail = array($this->rootPage);
         $level = 0;
     } else {
         $trail = $objPage->trail;
         $level = $this->levelOffset > 0 ? $this->levelOffset : 0;
     }
     $lang = null;
     $host = null;
     // Overwrite the domain and language if the reference page belongs to a differnt root page (see #3765)
     if ($this->defineRoot && $this->rootPage > 0) {
         $objRootPage = \PageModel::findWithDetails($this->rootPage);
         // Set the language
         if (\Config::get('addLanguageToUrl') && $objRootPage->rootLanguage != $objPage->rootLanguage) {
             $lang = $objRootPage->rootLanguage;
         }
         // Set the domain
         if ($objRootPage->rootId != $objPage->rootId && $objRootPage->domain != '' && $objRootPage->domain != $objPage->domain) {
             $host = $objRootPage->domain;
         }
     }
     $this->Template->request = ampersand(\Environment::get('indexFreeRequest'));
     $this->Template->skipId = 'skipNavigation' . $this->id;
     $this->Template->skipNavigation = specialchars($GLOBALS['TL_LANG']['MSC']['skipNavigation']);
     $this->Template->items = $this->renderNavigation($trail[$level], 1, $host, $lang);
 }
开发者ID:Mozan,项目名称:core-bundle,代码行数:34,代码来源:ModuleNavigation.php

示例13: addCookiebarBuffer

 /**
  * Add the cookie HTML buffer
  * @param string
  * @return string
  */
 public function addCookiebarBuffer($strContent)
 {
     if ($this->isCookiebarEnabled()) {
         $objRoot = $this->getCurrentRootPage();
         $objTemplate = new \FrontendTemplate('cookiebar_default');
         $objTemplate->message = $objRoot->cookiebar_message;
         $objTemplate->position = $objRoot->cookiebar_position;
         $objTemplate->button = $objRoot->cookiebar_button;
         $objTemplate->cookie = $this->getCookiebarName($objRoot);
         $objTemplate->more = '';
         // Add the "more" link
         if ($objRoot->cookiebar_jumpTo > 0) {
             $objJump = \PageModel::findByPk($objRoot->cookiebar_jumpTo);
             if ($objJump !== null) {
                 $objJump->loadDetails();
                 $objTemplate->more = $GLOBALS['TL_LANG']['MSC']['more'];
                 $objTemplate->moreHref = ampersand($this->generateFrontendUrl($objJump->row(), null, $objJump->language));
                 $objTemplate->moreTitle = specialchars($GLOBALS['TL_LANG']['MSC']['more']);
             }
         }
         // Place the cookiebar in DOM structure
         if ($objRoot->cookiebar_placement === 'before_wrapper') {
             $strContent = str_replace('<div id="wrapper">', $objTemplate->parse() . '<div id="wrapper">', $strContent);
         } else {
             $strContent = str_replace('</body>', $objTemplate->parse() . '</body>', $strContent);
         }
     }
     return $strContent;
 }
开发者ID:codefog,项目名称:contao-cookiebar,代码行数:34,代码来源:CookieBar.php

示例14: checkLog

 public function checkLog($ptable, $tstamp, $item)
 {
     switch ($ptable) {
         case 'tl_article':
             $objArticle = \ArticleModel::findById($item['pid']);
             $objPage = \PageModel::findById($objArticle->pid);
             $item['page'] = $objPage->title;
             $item['showUrl'] = $this->generateFrontendUrl($objPage->row(), '');
             break;
         case 'tl_news':
             $objNews = \NewsModel::findById($item['pid']);
             $objArchive = \NewsArchiveModel::findById($objNews->pid);
             $objPage = \PageModel::findById($objArchive->jumpTo);
             $item['page'] = $objNews->headline;
             $item['showUrl'] = ampersand($this->generateFrontendUrl($objPage->row(), (\Config::get('useAutoItem') && !\Config::get('disableAlias') ? '/' : '/items/') . (!\Config::get('disableAlias') && $objNews->alias != '' ? $objNews->alias : $objNews->id)));
             break;
         case 'tl_calendar':
             break;
         case 'tl_faq':
             $objFAQ = \FaqModel::findById($item['id']);
             $objCategory = \FaqCategoryModel::findById($item['pid']);
             $objPage = \PageModel::findById($objCategory->jumpTo);
             $item['htmlElement'] = '<div class="ce_faq"><h1>' . $objFAQ->question . '</h1>' . $objFAQ->answer . '</div>';
             $item['page'] = $objCategory->title;
             $item['title'] = $objFAQ->question;
             $item['showUrl'] = ampersand($this->generateFrontendUrl($objPage->row(), (\Config::get('useAutoItem') && !\Config::get('disableAlias') ? '/' : '/items/') . (!\Config::get('disableAlias') && $objFAQ->alias != '' ? $objFAQ->alias : $objFAQ->id)));
             break;
     }
     return $item;
 }
开发者ID:contao-dot-kitchen,项目名称:content_log,代码行数:30,代码来源:ClassContentLog.php

示例15: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     \System::loadLanguageFile('tl_autoload');
     // Process the request
     if (\Input::post('FORM_SUBMIT') == 'tl_autoload') {
         $this->createAutoloadFiles();
         $this->reload();
     }
     $arrModules = array();
     // List all modules
     foreach (scan(TL_ROOT . '/system/modules') as $strFile) {
         if (strncmp($strFile, '.', 1) === 0 || !is_dir(TL_ROOT . '/system/modules/' . $strFile)) {
             continue;
         }
         $arrModules[] = $strFile;
     }
     $this->Template->modules = $arrModules;
     $this->Template->messages = \Message::generate();
     $this->Template->href = $this->getReferer(true);
     $this->Template->title = specialchars($GLOBALS['TL_LANG']['MSC']['backBTTitle']);
     $this->Template->button = $GLOBALS['TL_LANG']['MSC']['backBT'];
     $this->Template->headline = $GLOBALS['TL_LANG']['tl_autoload']['headline'];
     $this->Template->action = ampersand(\Environment::get('request'));
     $this->Template->available = $GLOBALS['TL_LANG']['tl_autoload']['available'];
     $this->Template->xplAvailable = $GLOBALS['TL_LANG']['tl_autoload']['xplAvailable'];
     $this->Template->selectAll = $GLOBALS['TL_LANG']['MSC']['selectAll'];
     $this->Template->override = $GLOBALS['TL_LANG']['tl_autoload']['override'];
     $this->Template->xplOverride = $GLOBALS['TL_LANG']['tl_autoload']['xplOverride'];
     $this->Template->submitButton = specialchars($GLOBALS['TL_LANG']['MSC']['continue']);
     $this->Template->autoload = $GLOBALS['TL_LANG']['tl_autoload']['autoload'];
     $this->Template->ideCompat = $GLOBALS['TL_LANG']['tl_autoload']['ideCompat'];
 }
开发者ID:eknoes,项目名称:core,代码行数:35,代码来源:ModuleAutoload.php


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