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

PHP specialchars函数代码示例

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

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



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

示例1: run

 /**
  * Run the controller and parse the login template
  *
  * @return Response
  */
 public function run()
 {
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_login');
     // Show a cookie warning
     if (\Input::get('referer', true) != '' && empty($_COOKIE)) {
         $objTemplate->noCookies = $GLOBALS['TL_LANG']['MSC']['noCookies'];
     }
     $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 = 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 = 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->disableCron = \Config::get('disableCron');
     $objTemplate->default = $GLOBALS['TL_LANG']['MSC']['default'];
     return $objTemplate->getResponse();
 }
开发者ID:jamesdevine,项目名称:core-bundle,代码行数:36,代码来源:BackendIndex.php


示例2: generate

   /**
    * Generate the widget and return it as string
    *
    * @return string
    */
   public function generate()
   {
       $arrObjects = array('u' => 'cuser', 'g' => 'cgroup', 'w' => 'cworld');
       $return = '  <table id="ctrl_defaultChmod" class="tl_chmod">
   <tr>
     <th></th>
     <th scope="col">' . $GLOBALS['TL_LANG']['CHMOD']['editpage'] . '</th>
     <th scope="col">' . $GLOBALS['TL_LANG']['CHMOD']['editnavigation'] . '</th>
     <th scope="col">' . $GLOBALS['TL_LANG']['CHMOD']['deletepage'] . '</th>
     <th scope="col">' . $GLOBALS['TL_LANG']['CHMOD']['editarticles'] . '</th>
     <th scope="col">' . $GLOBALS['TL_LANG']['CHMOD']['movearticles'] . '</th>
     <th scope="col">' . $GLOBALS['TL_LANG']['CHMOD']['deletearticles'] . '</th>
   </tr>';
       // Build rows for user, group and world
       foreach ($arrObjects as $k => $v) {
           $return .= '
   <tr>
     <th scope="row">' . $GLOBALS['TL_LANG']['CHMOD'][$v] . '</th>';
           // Add checkboxes
           for ($j = 1; $j <= 6; $j++) {
               $return .= '
     <td><input type="checkbox" name="' . $this->strName . '[]" value="' . specialchars($k . $j) . '"' . static::optionChecked($k . $j, $this->varValue) . ' onfocus="Backend.getScrollOffset()"></td>';
           }
           $return .= '
   </tr>';
       }
       return $return . '
 </table>';
   }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:34,代码来源:ChmodTable.php


示例3: run

 /**
  * Run the controller and parse the template
  */
 public function run()
 {
     $this->Template = new BackendTemplate('be_picker');
     $this->Template->main = '';
     // Ajax request
     if ($_POST && Environment::get('isAjaxRequest')) {
         $this->objAjax = new Ajax(Input::post('action'));
         $this->objAjax->executePreActions();
     }
     $strTable = Input::get('table');
     $strField = Input::get('field');
     $this->loadDataContainer($strTable);
     $objDca = new DC_Table($strTable);
     // AJAX request
     if ($_POST && Environment::get('isAjaxRequest')) {
         $this->objAjax->executePostActions($objDca);
     }
     $objFileTree = new $GLOBALS['BE_FFL']['fileSelector'](array('strId' => $strField, 'strTable' => $strTable, 'strField' => $strField, 'strName' => $strField, 'varValue' => explode(',', Input::get('value'))), $objDca);
     $this->Template->main = $objFileTree->generate();
     $this->Template->theme = $this->getTheme();
     $this->Template->base = Environment::get('base');
     $this->Template->language = $GLOBALS['TL_LANGUAGE'];
     $this->Template->title = specialchars($GLOBALS['TL_LANG']['MSC']['filepicker']);
     $this->Template->headline = $GLOBALS['TL_LANG']['MSC']['ppHeadline'];
     $this->Template->charset = $GLOBALS['TL_CONFIG']['characterSet'];
     $this->Template->options = $this->createPageList();
     $this->Template->expandNode = $GLOBALS['TL_LANG']['MSC']['expandNode'];
     $this->Template->collapseNode = $GLOBALS['TL_LANG']['MSC']['collapseNode'];
     $this->Template->loadingData = $GLOBALS['TL_LANG']['MSC']['loadingData'];
     $this->Template->search = $GLOBALS['TL_LANG']['MSC']['search'];
     $this->Template->action = ampersand(Environment::get('request'));
     $this->Template->value = $this->Session->get('file_selector_search');
     $GLOBALS['TL_CONFIG']['debugMode'] = false;
     $this->Template->output();
 }
开发者ID:rikaix,项目名称:core,代码行数:38,代码来源:file.php


示例4: 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


示例5: 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


示例6: addButton

 /**
  * @param GetEditModeButtonsEvent $objEvent
  */
 public function addButton(GetEditModeButtonsEvent $objEvent)
 {
     if (!$this->isRightContext($objEvent->getEnvironment())) {
         return;
     }
     // Check the file cache.
     $strInitFilePath = '/system/config/initconfig.php';
     if (file_exists(TL_ROOT . $strInitFilePath)) {
         $strFile = new \File($strInitFilePath);
         $arrFileContent = $strFile->getContentAsArray();
         foreach ($arrFileContent as $strContent) {
             if (!preg_match("/(\\/\\*|\\*|\\*\\/|\\/\\/)/", $strContent)) {
                 //system/tmp.
                 if (preg_match("/system\\/tmp/", $strContent)) {
                     // Set data.
                     \Message::addInfo($GLOBALS['TL_LANG']['MSC']['disabled_cache']);
                 }
             }
         }
     }
     // Update a field with last sync information
     $objSyncTime = \Database::getInstance()->prepare("SELECT cl.syncFrom_tstamp as syncFrom_tstamp, user.name as syncFrom_user, user.username as syncFrom_alias\n                         FROM tl_synccto_clients as cl\n                         INNER JOIN tl_user as user\n                         ON cl.syncTo_user = user.id\n                         WHERE cl.id = ?")->limit(1)->execute(\Input::get("id"));
     if ($objSyncTime->syncFrom_tstamp != 0 && strlen($objSyncTime->syncFrom_user) != 0 && strlen($objSyncTime->syncFrom_alias) != 0) {
         $strLastSync = vsprintf($GLOBALS['TL_LANG']['MSC']['last_sync'], array(date($GLOBALS['TL_CONFIG']['timeFormat'], $objSyncTime->syncFrom_tstamp), date($GLOBALS['TL_CONFIG']['dateFormat'], $objSyncTime->syncFrom_tstamp), $objSyncTime->syncFrom_user, $objSyncTime->syncFrom_alias));
         // Set data
         \Message::addInfo($strLastSync);
     }
     // Set buttons.
     $objEvent->setButtons(array('start_sync' => '<input type="submit" name="start_sync" id="start_sync" class="tl_submit" accesskey="s" value="' . specialchars($GLOBALS['TL_LANG']['MSC']['sync']) . '" />', 'start_sync_all' => '<input type="submit" name="start_sync_all" id="start_sync_all" class="tl_submit" accesskey="o" value="' . specialchars($GLOBALS['TL_LANG']['MSC']['syncAll']) . '" />'));
 }
开发者ID:menatwork,项目名称:synccto,代码行数:33,代码来源:From.php


示例7: 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


示例8: cb_parseTemplate

 public function cb_parseTemplate(\Template &$objTemplate)
 {
     global $objPage;
     if (strpos($objTemplate->getName(), 'news_') === 0) {
         if ($objTemplate->source == 'singlefile') {
             $modelFile = \FilesModel::findByUuid($objTemplate->singlefileSRC);
             try {
                 if ($modelFile === null) {
                     throw new \Exception("no file");
                 }
                 $allowedDownload = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));
                 if (!in_array($modelFile->extension, $allowedDownload)) {
                     throw new Exception("download not allowed by extension");
                 }
                 $objFile = new \File($modelFile->path, true);
                 $strHref = \System::urlEncode($objFile->value);
             } catch (\Exception $e) {
                 $strHref = "";
             }
             $target = $objPage->outputFormat == 'xhtml' ? ' onclick="return !window.open(this.href)"' : ' target="_blank"';
             $objTemplate->more = sprintf('<a %s href="%s" title="%s">%s</a>', $target, $strHref, specialchars(sprintf($GLOBALS['TL_LANG']['MSC']['open'], $objFile->basename)), $GLOBALS['TL_LANG']['MSC']['more']);
             $objTemplate->linkHeadline = sprintf('<a %s href="%s" title="%s">%s</a>', $target, $strHref, specialchars(sprintf($GLOBALS['TL_LANG']['MSC']['open'], $objFile->basename)), $objTemplate->headline);
         }
     }
 }
开发者ID:kikmedia,项目名称:contao,代码行数:25,代码来源:NewsSingleFile.php


示例9: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     $objVotings = $this->Database->execute("\n            SELECT *,\n                (SELECT COUNT(*) FROM tl_voting_enquiry WHERE pid=tl_voting.id) AS total_enquiries\n            FROM tl_voting\n            " . (!BE_USER_LOGGED_IN ? " WHERE published=1" : "") . "\n            ORDER BY start DESC\n        ");
     if (!$objVotings->numRows) {
         return;
     }
     $strUrl = '';
     // Get the jumpTo page
     if ($this->jumpTo > 0) {
         $objJump = $this->Database->prepare("SELECT * FROM tl_page WHERE id=?")->limit(1)->execute($this->jumpTo);
         if ($objJump->numRows) {
             $strUrl = ampersand($this->generateFrontendUrl($objJump->row(), $GLOBALS['TL_CONFIG']['useAutoItem'] ? '/%s' : '/items/%s'));
         }
     }
     $limit = $objVotings->numRows;
     $count = 0;
     $arrVotings = array();
     // Generate votings
     while ($objVotings->next()) {
         $arrVotings[$objVotings->id] = $objVotings->row();
         $arrVotings[$objVotings->id]['class'] = (++$count == 1 ? ' first' : '') . ($count == $limit ? ' last' : '') . ($count % 2 == 0 ? ' odd' : ' even') . ($this->isActive($objVotings) ? ' active' : '') . ($objVotings->start > time() ? ' upcoming' : '');
         $arrVotings[$objVotings->id]['href'] = sprintf($strUrl, $objVotings->alias);
         $arrVotings[$objVotings->id]['linkTitle'] = specialchars($objVotings->name);
         $arrVotings[$objVotings->id]['period'] = $this->getPeriod($objVotings);
     }
     $this->Template->votings = $arrVotings;
 }
开发者ID:contao-association,项目名称:contao-voting,代码行数:30,代码来源:ModuleVotingList.php


示例10: generateSqlForm

    /**
     * Generate a HTML form with update commands and return it as string
     * @return string
     */
    private function generateSqlForm()
    {
        $count = 0;
        $return = '';
        $sql_command = $this->compileCommands();
        if (!count($sql_command)) {
            return '';
        }
        $arrOperations = array('CREATE' => 'Create new tables', 'ALTER_ADD' => 'Add new columns', 'ALTER_CHANGE' => 'Change existing columns', 'ALTER_DROP' => 'Drop existing columns', 'DROP' => 'Drop existing tables');
        foreach ($arrOperations as $command => $label) {
            if (is_array($sql_command[$command])) {
                // Headline
                $return .= '
  <tr>
    <td colspan="2" class="tl_col_0"><h3><label>' . $label . '</label></h3></td>
  </tr>';
                // Fields
                foreach ($sql_command[$command] as $vv) {
                    $return .= '
  <tr>
    <td class="tl_col_1"><input type="checkbox" name="sql[]" id="sql_' . $count . '" class="tl_checkbox" value="' . specialchars($vv) . '"' . (stristr($command, 'DROP') === false ? ' checked="checked"' : '') . ' /></td>
    <td class="tl_col_2"><pre><label for="sql_' . $count++ . '">' . $vv . '</label></pre></td>
  </tr>';
                }
            }
        }
        return '
<table cellspacing="0" cellpadding="0" id="sql_table" style="margin-top:9px;" summary="Necessary database modifications">' . $return . '
</table>' . "\n";
    }
开发者ID:jens-wetzel,项目名称:use2,代码行数:34,代码来源:DatabaseInstaller.php


示例11: generate

 public function generate($row, $href, $label, $title, $icon, $attributes)
 {
     $href .= '&id=' . $row['id'];
     if ($row['type'] == 'module') {
         return '<a href="' . $this->addToUrl($href) . '" title="' . specialchars($title) . '"' . $attributes . '>' . Image::getHtml($icon, $label) . '</a> ';
     }
 }
开发者ID:heimrichhannot,项目名称:contao-entity_generator,代码行数:7,代码来源:tl_entity_template.php


示例12: run

 /**
  * Run the controller and parse the login template
  */
 public function run()
 {
     $this->Template = new BackendTemplate('be_files');
     $this->Template->main = '';
     // Ajax request
     if (Environment::get('isAjaxRequest')) {
         $this->objAjax = new Ajax(Input::post('action'));
         $this->objAjax->executePreActions();
     }
     $this->Template->main .= $this->getBackendModule('files');
     // Default headline
     if ($this->Template->headline == '') {
         $this->Template->headline = $GLOBALS['TL_CONFIG']['websiteTitle'];
     }
     $this->Template->theme = $this->getTheme();
     $this->Template->base = Environment::get('base');
     $this->Template->language = $GLOBALS['TL_LANGUAGE'];
     $this->Template->title = specialchars($GLOBALS['TL_LANG']['MSC']['filetree']);
     $this->Template->charset = $GLOBALS['TL_CONFIG']['characterSet'];
     $this->Template->pageOffset = Input::cookie('BE_PAGE_OFFSET');
     $this->Template->error = Input::get('act') == 'error' ? $GLOBALS['TL_LANG']['ERR']['general'] : '';
     $this->Template->skipNavigation = $GLOBALS['TL_LANG']['MSC']['skipNavigation'];
     $this->Template->request = ampersand(Environment::get('request'));
     $this->Template->top = $GLOBALS['TL_LANG']['MSC']['backToTop'];
     $this->Template->expandNode = $GLOBALS['TL_LANG']['MSC']['expandNode'];
     $this->Template->collapseNode = $GLOBALS['TL_LANG']['MSC']['collapseNode'];
     $this->Template->loadingData = $GLOBALS['TL_LANG']['MSC']['loadingData'];
     $this->Template->loadFonts = $GLOBALS['TL_CONFIG']['loadGoogleFonts'];
     $GLOBALS['TL_CONFIG']['debugMode'] = false;
     $this->Template->output();
 }
开发者ID:rburch,项目名称:core,代码行数:34,代码来源:files.php


示例13: editArticles

 public function editArticles($row, $href, $label, $title, $icon)
 {
     if (!$this->User->hasAccess('article', 'modules')) {
         return '';
     }
     return $row['type'] == 'regular' || $row['type'] == 'login' || $row['type'] == 'error_403' || $row['type'] == 'error_404' ? '<a href="' . $this->addToUrl($href . '&amp;pn=' . $row['id']) . '" title="' . specialchars($title) . '">' . Image::getHtml($icon, $label) . '</a> ' : Image::getHtml(preg_replace('/\\.gif$/i', '_.gif', $icon)) . ' ';
 }
开发者ID:postyou,项目名称:contao-deep-login,代码行数:7,代码来源:tl_page.php


示例14: doCreateImageList

 /**
  * Recursively get all allowed images and return them as string
  * @param integer
  * @param integer
  * @return string
  */
 public function doCreateImageList($strFolder = null, $level = -1)
 {
     $arrPages = scan(TL_ROOT . '/' . $strFolder);
     // Empty folder
     if (empty($arrPages)) {
         return '';
     }
     // Protected folder
     if (array_search('.htaccess', $arrPages) !== false) {
         return '';
     }
     ++$level;
     $strFolders = '';
     $strFiles = '';
     // Recursively list all images
     foreach ($arrPages as $strFile) {
         if (substr($strFile, 0, 1) == '.') {
             continue;
         }
         // Folders
         if (is_dir(TL_ROOT . '/' . $strFolder . '/' . $strFile)) {
             $strFolders .= $this->doCreateImageList($strFolder . '/' . $strFile, $level);
         } elseif (preg_match('/\\.gif$|\\.jpg$|\\.jpeg$|\\.png$/i', $strFile)) {
             $strFiles .= sprintf('["%s", "%s"]', specialchars($strFolder . '/' . $strFile), $strFolder . '/' . $strFile) . ",\n";
         }
     }
     return $strFiles . $strFolders;
 }
开发者ID:rikaix,项目名称:core,代码行数:34,代码来源:typolib.php


示例15: editJavaScript

 public function editJavaScript($row, $href, $label, $title, $icon, $attributes)
 {
     if ($this->User->isAdmin || $this->User->hasAccess('theme_plus_javascript', 'themes')) {
         return '<a href="' . $this->addToUrl($href . '&amp;id=' . $row['id']) . '" title="' . specialchars($title) . '"' . $attributes . '>' . $this->generateImage($icon, $label) . '</a> ';
     }
     return $this->generateImage(preg_replace('/\\.png$/i', '_.png', $icon)) . ' ';
 }
开发者ID:bit3,项目名称:contao-theme-plus,代码行数:7,代码来源:Theme.php


示例16: findAllAvailable

 /**
  * Find all available property types and return as array
  * @param   array
  * @return  array
  */
 public static function findAllAvailable(&$arrCategories)
 {
     $strHash = md5(implode(',', $arrCategories));
     if (!\Cache::has(static::$strKey . '-' . $strHash)) {
         $t = Product::getTable();
         $arrAvailable = array();
         if (!is_array($arrCategories) || empty($arrCategories)) {
             $arrCategories = array(0);
         }
         //This query is by far the fastest way to get the available attributes
         $strQuery = "SELECT {$t}." . static::$strKey . " FROM {$t} WHERE " . static::$strKey . " != '' AND {$t}.id IN (" . implode(',', static::getProductsForCategories($arrCategories)) . ")";
         if (BE_USER_LOGGED_IN !== true) {
             $time = time();
             $strQuery .= " AND {$t}.published='1' AND ({$t}.start='' OR {$t}.start<{$time}) AND ({$t}.stop='' OR {$t}.stop>{$time})";
         }
         $objResult = \Database::getInstance()->execute($strQuery);
         if ($objResult->numRows) {
             while ($objResult->next()) {
                 if (strlen($objResult->{static::$strKey}) && !in_array($objResult->{static::$strKey}, $arrAvailable)) {
                     $arrAvailable[specialchars($objResult->{static::$strKey})] = $objResult->{static::$strKey};
                 }
             }
         }
         ksort($arrAvailable);
         \Cache::set(static::$strKey . '-' . $strHash, $arrAvailable);
     }
     return \Cache::get(static::$strKey . '-' . $strHash);
 }
开发者ID:rhymedigital,项目名称:isotope_direct,代码行数:33,代码来源:Filter.php


示例17: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     $objFaq = \FaqExtensions\FaqModel::findPublishedByRecommendation(array("order" => $this->faq_sortorder, "limit" => $this->faq_limit > 0 ? $this->faq_limit : 10));
     if ($objFaq === null) {
         $this->Template->faq = array();
         return;
     }
     $arrFaq = array();
     // Add FAQs
     while ($objFaq->next()) {
         $arrTemp = $objFaq->row();
         $arrTemp['title'] = specialchars($objFaq->question, true);
         $arrTemp['href'] = $this->generateFaqLink($objFaq);
         /** @var \FaqCategoryModel $objPid */
         $objPid = $objFaq->getRelated('pid');
         array_push($arrFaq, $arrTemp);
     }
     $faq_count = 0;
     $faq_limit = count($arrFaq);
     // Add classes
     foreach ($arrFaq as $k => $v) {
         $arrFaq[$k]['class'] = trim((++$faq_count == 1 ? ' first' : '') . ($faq_count >= $faq_limit ? ' last' : '') . ($faq_count % 2 == 0 ? ' odd' : ' even'));
     }
     $this->Template->faq = $arrFaq;
 }
开发者ID:hschottm,项目名称:faqextensions,代码行数:28,代码来源:ModuleFaqRecommendedList.php


示例18: prepare

 /**
  * Prepare the file
  * @param   Traversable
  * @return  bool
  */
 protected function prepare(\Traversable $objReader)
 {
     if ($this->blnRandomName) {
         $this->strFile = 'system/tmp/export_' . specialchars(uniqid()) . $this->strExtension;
     }
     return true;
 }
开发者ID:codefog,项目名称:contao-haste,代码行数:12,代码来源:AbstractFileWriter.php


示例19: staticPagePicker

 public static function staticPagePicker(array $arrData)
 {
     $strTitle = specialchars($GLOBALS['TL_LANG']['MSC']['pagepicker']);
     $onClick = "Backend.getScrollOffset();Backend.openModalSelector({'width':765,'title':'" . specialchars(str_replace("'", "\\'", $GLOBALS['TL_LANG']['MOD']['page'][0])) . "','url':this.href,'id':'" . $arrData['field'] . "','tag':'ctrl_" . $arrData['field'] . (\Input::get('act') == 'editAll' ? '_' . $arrData['id'] : '') . "','self':this});return false";
     $strImage = \Image::getHtml('pickpage.gif', $GLOBALS['TL_LANG']['MSC']['pagepicker'], 'style="vertical-align:top;cursor:pointer"');
     return ' <a href="contao/page.php?do=' . \Input::get('do') . '&amp;table=' . $arrData['table'] . '&amp;field=' . $arrData['field'] . '&amp;value=' . str_replace(array('{{link_url::', '}}'), '', $arrData['value']) . '" title="' . $strTitle . '" onclick="' . $onClick . '">' . $strImage . '</a>';
 }
开发者ID:pressi,项目名称:zdps_customize,代码行数:7,代码来源:Tables.php


示例20: run

 /**
  * Run the controller and parse the template
  */
 public function run()
 {
     /** @var \BackendTemplate|object $objTemplate */
     $objTemplate = new \BackendTemplate('be_preview');
     $objTemplate->base = \Environment::get('base');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->title = specialchars($GLOBALS['TL_LANG']['MSC']['fePreview']);
     $objTemplate->charset = \Config::get('characterSet');
     $objTemplate->site = \Input::get('site', true);
     if (\Input::get('url')) {
         $objTemplate->url = \Environment::get('base') . \Input::get('url');
     } elseif (\Input::get('page')) {
         $objTemplate->url = $this->redirectToFrontendPage(\Input::get('page'), \Input::get('article'), true);
     } else {
         $objTemplate->url = \Environment::get('base');
     }
     // Switch to a particular member (see #6546)
     if (\Input::get('user') && $this->User->isAdmin) {
         $objUser = \MemberModel::findByUsername(\Input::get('user'));
         if ($objUser !== null) {
             $strHash = sha1(session_id() . (!\Config::get('disableIpCheck') ? \Environment::get('ip') : '') . 'FE_USER_AUTH');
             // Remove old sessions
             $this->Database->prepare("DELETE FROM tl_session WHERE tstamp<? OR hash=?")->execute(time() - \Config::get('sessionTimeout'), $strHash);
             // Insert the new session
             $this->Database->prepare("INSERT INTO tl_session (pid, tstamp, name, sessionID, ip, hash) VALUES (?, ?, ?, ?, ?, ?)")->execute($objUser->id, time(), 'FE_USER_AUTH', session_id(), \Environment::get('ip'), $strHash);
             // Set the cookie
             $this->setCookie('FE_USER_AUTH', $strHash, time() + \Config::get('sessionTimeout'), null, null, false, true);
             $objTemplate->user = \Input::post('user');
         }
     }
     \Config::set('debugMode', false);
     $objTemplate->output();
 }
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:36,代码来源:BackendPreview.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP spellinfo2函数代码示例发布时间:2022-05-23
下一篇:
PHP special_char函数代码示例发布时间: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