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

PHP Sh404sefFactory类代码示例

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

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



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

示例1: shGetNEWSPCategories

 function shGetNEWSPCategories($catId, $option, $shLangName, &$cat, &$sec)
 {
     if (empty($catId)) {
         return false;
     }
     static $catData = null;
     $sefConfig =& Sh404sefFactory::getConfig();
     if (!is_null($catData[$shLangName][$catId])) {
         // get DB
         $database =& JFactory::getDBO();
         $query = "SELECT c.id, c.section, c.title, s.id as sectionid, s.title as stitle" . "\n FROM #__categories as c, #__sections as s" . "\n WHERE " . "\n s.id = c.section" . "\n AND c.id = '" . $catId . "'";
         $database->setQuery($query);
         if (shTranslateUrl($option, $shLangName)) {
             $categories = $database->loadObjectList();
         } else {
             $categories = $database->loadObjectList(false);
         }
         if (!empty($categories)) {
             $sec = ($sefConfig->shNewsPInsertSecId ? $sectionId . $sefConfig->replacement : '') . $categories[0]->stitle;
             // section
             $cat = ($sefConfig->shNewsPInsertCatId ? $sectionId . $sefConfig->replacement : '') . $categories[0]->title;
             // category
             $catData[$shLangName][$catId]['cat'] = $cat;
             $catData[$shLangName][$catId]['sec'] = $sec;
         }
     } else {
         $cat = $catData[$shLangName][$catId]['cat'];
         $sec = $catData[$shLangName][$catId]['sec'];
     }
     return !empty($cat);
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:31,代码来源:com_news_portal.php


示例2: _doQuickControl

 private function _doQuickControl($tpl)
 {
     // get configuration object
     $sefConfig = Sh404sefFactory::getConfig($reset = true);
     // push it into to the view
     $this->sefConfig = $sefConfig;
     $messages = JFactory::getApplication()->getMessageQueue();
     $noMsg = JRequest::getInt('noMsg', 0);
     $this->error = array();
     // push any message
     if (is_array($messages) && !empty($messages)) {
         foreach ($messages as $msg) {
             if (!empty($msg['message'])) {
                 $msg['type'] = isset($msg['type']) ? $msg['type'] : 'info';
                 if ($msg['type'] != 'error') {
                     if (empty($noMsg)) {
                         $this->message = $msg['message'];
                     }
                 } else {
                     $this->errors[] = $msg['message'];
                 }
             }
         }
     }
     parent::display($tpl);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:26,代码来源:view.raw.php


示例3: array

 /**
  * Get a Extplugin object for the requested extension
  * If no specific plugin is found, the default, generic
  * public is used instead
  *
  * @param string $option the Joomla! component name. Should begin with "com_"
  * @return object Sh404sefExtpluginBaseextplugin descendant
  */
 public static function &getExtensionPlugin($option)
 {
     static $_plugins = array();
     if (empty($option)) {
         $option = 'default';
     }
     // plugin is cached, check if we already created
     // the plugin for $option
     if (empty($_plugins[$option])) {
         // build the class name for this plugin
         // autolaoder will find the appropriate file and load it
         // if not loaded
         if ($option !== 'default' && strpos($option, 'com_') !== 0) {
             $option = 'com_' . $option;
         }
         $className = 'Sh404sefExtplugin' . ucfirst(strtolower($option));
         // does this class exists?
         $sefConfig =& Sh404sefFactory::getConfig();
         if (class_exists($className, $autoload = true)) {
             // instantiate plugin
             $_plugins[$option] = new $className($option, $sefConfig);
         } else {
             // else use generic plugin
             $_plugins[$option] = new Sh404sefExtpluginDefault($option, $sefConfig);
         }
     }
     // return cached plugin
     return $_plugins[$option];
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:37,代码来源:sh404seffactory.php


示例4: display

 public function display($tpl = null)
 {
     // get model and update context with current
     $model =& $this->getModel();
     $context = $model->setContext($this->_context . '.' . $this->getLayout());
     // display type: simple for very large sites/slow slq servers
     $sefConfig =& Sh404sefFactory::getConfig();
     // if set for a slowServer, display simplified version of the url manager
     $this->assign('slowServer', $sefConfig->slowServer);
     // read data from model
     $list =& $model->getList((object) array('layout' => $this->getLayout(), 'simpleUrlList' => $this->slowServer, 'slowServer' => $sefConfig->slowServer));
     // and push it into the view for display
     $this->assign('items', $list);
     $this->assign('itemCount', count($this->items));
     $this->assign('pagination', $model->getPagination((object) array('layout' => $this->getLayout(), 'simpleUrlList' => $this->slowServer, 'slowServer' => $sefConfig->slowServer)));
     $options = $model->getDisplayOptions();
     $this->assign('options', $options);
     $this->assign('optionsSelect', $this->_makeOptionsSelect($options));
     // add behaviors and styles as needed
     $modalSelector = 'a.modalediturl';
     $js = '\\function(){window.parent.shAlreadySqueezed = false;if(window.parent.shReloadModal) {parent.window.location=\'' . $this->defaultRedirectUrl . '\';window.parent.shReloadModal=true}}';
     $params = array('overlayOpacity' => 0, 'classWindow' => 'sh404sef-popup', 'classOverlay' => 'sh404sef-popup', 'onClose' => $js);
     Sh404sefHelperHtml::modal($modalSelector, $params);
     // build the toolbar
     $toolbarMethod = '_makeToolbar' . ucfirst($this->getLayout());
     if (is_callable(array($this, $toolbarMethod))) {
         $this->{$toolbarMethod}($params);
     }
     // add our own css
     JHtml::styleSheet('urls.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // link to  custom javascript
     JHtml::script('list.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // now display normally
     parent::display($tpl);
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:35,代码来源:view.html.php


示例5: _fetchAccountsList

 protected function _fetchAccountsList()
 {
     $hClient =& Sh404sefHelperAnalytics::getHttpClient();
     $hClient->resetParameters($clearAll = true);
     // build the request
     $sefConfig = Sh404sefFactory::getConfig();
     $accountIdBits = explode('-', trim($sefConfig->analyticsId));
     if (empty($accountIdBits) || count($accountIdBits) < 3) {
         throw new Sh404sefExceptionDefault(JText::sprintf('COM_SH404SEF_ERROR_CHECKING_ANALYTICS', 'Invalid account Id'));
     }
     $accoundId = $accountIdBits[1];
     // set target API url
     $hClient->setUri($this->_endPoint . 'management/accounts/' . $accoundId . '/webproperties/' . trim($sefConfig->analyticsId) . '/profiles?key=' . $this->_getAppKey());
     // make sure we use GET
     $hClient->setMethod(Sh_Zend_Http_Client::GET);
     // set headers required by Google Analytics
     $headers = array('GData-Version' => 2, 'Authorization' => 'GoogleLogin auth=' . $this->_Auth);
     $hClient->setHeaders($headers);
     //perform request
     // establish connection with available methods
     $adapters = array('Sh_Zend_Http_Client_Adapter_Curl', 'Sh_Zend_Http_Client_Adapter_Socket');
     $rawResponse = null;
     // perform connect request
     foreach ($adapters as $adapter) {
         try {
             $hClient->setAdapter($adapter);
             $response = $hClient->request();
             break;
         } catch (Exception $e) {
             // need that to be Exception, so as to catch Sh_Zend_Exceptions.. as well
             // we failed, let's try another method
         }
     }
     // return if error
     if (empty($response)) {
         $msg = 'unknown code';
         throw new Sh404sefExceptionDefault(JText::sprintf('COM_SH404SEF_ERROR_CHECKING_ANALYTICS', $msg));
     }
     if (empty($response) || !is_object($response) || $response->isError()) {
         $msg = method_exists($response, 'getStatus') ? $response->getStatus() : 'unknown code';
         throw new Sh404sefExceptionDefault(JText::sprintf('COM_SH404SEF_ERROR_CHECKING_ANALYTICS', $msg));
     }
     // analyze response
     // check if authentified
     Sh404sefHelperAnalytics::verifyAuthResponse($response);
     $xml = simplexml_load_string($response->getBody());
     if (!empty($xml->entry)) {
         foreach ($xml->entry as $entry) {
             $account = new StdClass();
             $bits = explode('/', (string) $entry->id);
             $account->id = array_pop($bits);
             $account->title = str_replace('Google Analytics Profile ', '', (string) $entry->title);
             $this->_accounts[] = clone $account;
         }
     }
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:56,代码来源:analyticsga.php


示例6: _makeViewDashboard

 /**
  * Prepare and display the control panel
  * dashboard, which is a simplified view
  * of main analytics results
  *
  * @param string $tpl layout name
  */
 private function _makeViewDashboard($tpl)
 {
     // get configuration object
     $sefConfig =& Sh404sefFactory::getConfig();
     // push it into to the view
     $this->assignRef('sefConfig', $sefConfig);
     // get analytics data using helper, possibly from cache
     $analyticsData = Sh404sefHelperAnalytics::getData($this->options);
     // push analytics stats into view
     $this->assign('analytics', $analyticsData);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:18,代码来源:view.raw.php


示例7:

 protected static function &_getInstance($type = 'file')
 {
     static $_instance = null;
     if (empty($_instance)) {
         // get global config
         $config =& Sh404sefFactory::getConfig();
         // instantiate object
         $className = 'Sh404sefClass' . $type . 'cache';
         $_instance = new $className($config);
     }
     return $_instance;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:12,代码来源:cache.php


示例8: empty

 protected static function &_getInstance($handler = '')
 {
     static $_instance = null;
     if (empty($_instance)) {
         // get global config
         $config =& Sh404sefFactory::getConfig();
         // instantiate object
         $handler = empty($handler) ? $config->UrlCacheHandler : $handler;
         $className = 'Sh404sefClass' . ucfirst($handler) . 'cache';
         $_instance = new $className($config);
     }
     return $_instance;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:13,代码来源:cache.php


示例9: _shDecodeSecLogLine

 private static function _shDecodeSecLogLine($line)
 {
     $sefConfig =& Sh404sefFactory::getConfig();
     // skip comments
     if (substr($line, 0, 1) == '#') {
         return;
     }
     if (preg_match('/[0-9]{2}\\-[0-9]{2}\\-[0-9]{2}/', $line)) {
         // this is not header or comment line
         self::$_counters['shSecTotalAttacks']++;
         $bits = explode("\t", $line);
         switch (substr($bits[2], 0, 15)) {
             case 'Flooding':
                 self::$_counters['shSecTotalFlooding']++;
                 break;
             case 'Caught by Honey':
                 self::$_counters['shSecTotalPHP']++;
                 break;
             case 'Honey Pot but u':
                 self::$_counters['shSecTotalPHPUserClicked']++;
                 break;
             case 'Var not numeric':
             case 'Var not alpha-n':
             case 'Var contains ou':
                 self::$_counters['shSecTotalStandardVars']++;
                 break;
             case 'Image file name':
                 self::$_counters['shSecTotalImgTxtCmd']++;
                 break;
             case '<script> tag in':
                 self::$_counters['shSecTotalScripts']++;
                 break;
             case 'Base 64 encoded':
                 self::$_counters['shSecTotalBase64']++;
                 break;
             case 'mosConfig_var i':
                 self::$_counters['shSecTotalConfigVars']++;
                 break;
             case 'Blacklisted IP':
                 self::$_counters['shSecTotalIPDenied']++;
                 break;
             case 'Blacklisted use':
                 self::$_counters['shSecTotalUserAgentDenied']++;
                 break;
             default:
                 // if not one of those, then it's a 404, don't count it as an attack
                 self::$_counters['shSecTotalAttacks']--;
                 break;
         }
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:51,代码来源:security.php


示例10: _doQuickControl

 private function _doQuickControl($tpl)
 {
     // get configuration object
     $sefConfig =& Sh404sefFactory::getConfig();
     // push it into to the view
     $this->assignRef('sefConfig', $sefConfig);
     // push any message
     $error = $this->getError();
     if (empty($error)) {
         $noMsg = JRequest::getInt('noMsg', 0);
         if (empty($noMsg)) {
             $this->assign('message', JText::_('COM_SH404SEF_ELEMENT_SAVED'));
         }
     }
     parent::display($tpl);
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:16,代码来源:view.raw.php


示例11: shSimpleLogger

 function shSimpleLogger($siteName, $basePath, $fileName, $isActive)
 {
     $sefConfig = Sh404sefFactory::getConfig();
     if (empty($isActive)) {
         $this->isActive = 0;
         return;
     } else {
         $this->isActive = 1;
     }
     $traceFileName = $basePath . $sefConfig->debugStartedAt . '.' . $fileName . '_' . str_replace('/', '_', str_replace('http://', '', $siteName)) . '.log';
     // Create file
     $fileIsThere = file_exists($traceFileName);
     $sep = "\t";
     if (!$fileIsThere) {
         // create file
         $fileHeader = 'sh404SEF trace file - created : ' . $this->logTime() . ' for ' . $siteName . "\n\n" . str_repeat('-', 25) . ' PHP Configuration ' . str_repeat('-', 25) . "\n\n";
         $config = $this->parsePHPConfig();
         $line = str_repeat('-', 69) . "\n\n";
         // look for ob handlers, as we cannot use print_r from one (thanks Moovur !)
         $handlers = ob_list_handlers();
         $line .= "\nHandlers found : " . count($handlers);
         if (!empty($handlers)) {
             foreach ($handlers as $key => $handler) {
                 $line .= "\nHandler " . ($key + 1) . ' : ' . $handler;
             }
         }
         $line .= "\n" . str_repeat('-', 69) . "\n\n";
     } else {
         $fileHeader = '';
     }
     $file = fopen($traceFileName, 'ab');
     if ($file) {
         if (!empty($fileHeader)) {
             fWrite($file, $fileHeader);
             fWrite($file, print_r($config, true));
             fwrite($file, $line);
         }
         $this->logFile = $file;
     } else {
         $this->isActive = 0;
         return;
     }
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:43,代码来源:shSimpleLogger.class.php


示例12: updateShurls

 public static function updateShurls()
 {
     $pageInfo =& Sh404sefFactory::getPageInfo();
     $sefConfig =& Sh404sefFactory::getConfig();
     $pageInfo->shURL = empty($pageInfo->shURL) ? '' : $pageInfo->shURL;
     if ($sefConfig->enablePageId && !$sefConfig->stopCreatingShurls) {
         try {
             jimport('joomla.utilities.string');
             $nonSefUrl = JString::ltrim($pageInfo->currentNonSefUrl, '/');
             $nonSefUrl = shSortURL($nonSefUrl);
             // make sure we have a language
             $nonSefUrl = shSetURLVar($nonSefUrl, 'lang', $pageInfo->currentLanguageShortTag);
             // remove tracking vars (Google Analytics)
             $nonSefUrl = Sh404sefHelperGeneral::stripTrackingVarsFromNonSef($nonSefUrl);
             // try to get the current shURL, if any
             $shURL = ShlDbHelper::selectResult('#__sh404sef_pageids', array('pageid'), array('newurl' => $nonSefUrl));
             // if none, we may have to create one
             if (empty($shURL)) {
                 $shURL = self::_createShurl($nonSefUrl);
             }
             // insert in head and header, if not empty
             if (!empty($shURL)) {
                 $fullShURL = JString::ltrim($pageInfo->getDefaultFrontLiveSite(), '/') . '/' . $shURL;
                 $document = JFactory::getDocument();
                 if ($sefConfig->insertShortlinkTag) {
                     $document->addHeadLink($fullShURL, 'shortlink');
                     // also add header, especially for HEAD requests
                     JResponse::setHeader('Link', '<' . $fullShURL . '>; rel=shortlink', true);
                 }
                 if ($sefConfig->insertRevCanTag) {
                     $document->addHeadLink($fullShURL, 'canonical', 'rev', array('type' => 'text/html'));
                 }
                 if ($sefConfig->insertAltShorterTag) {
                     $document->addHeadLink($fullShURL, 'alternate shorter');
                 }
                 // store for reuse
                 $pageInfo->shURL = $shURL;
             }
         } catch (Exception $e) {
             ShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage());
         }
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:43,代码来源:shurl.php


示例13: plgSh404sefsimilarurls

function plgSh404sefsimilarurls($context, &$rowContent, &$params, $page = 0)
{
    if (!defined('SH404SEF_IS_RUNNING')) {
        // only do something if sh404sef is up and running
        return true;
    }
    // a little hack on the side : optionnally display the requested url
    // first get current sef url
    $shPageInfo =& Sh404sefFactory::getPageInfo();
    // replace marker
    $rowContent->text = str_replace('{%sh404SEF_404_URL%}', htmlspecialchars(JURI::getInstance()->get('_uri'), ENT_COMPAT, 'UTF-8'), $rowContent->text);
    // now the similar urls
    $marker = 'sh404sefSimilarUrls';
    // quick check for our marker:
    if (JString::strpos($rowContent->text, $marker) === false) {
        return true;
    }
    // get plugin params
    $plugin =& JPluginHelper::getPlugin('sh404sefcore', 'sh404sefsimilarurls');
    // init params from plugin
    $pluginParams = new JRegistry();
    $pluginParams->loadString($plugin->params);
    $matches = array();
    // regexp to catch plugin requests
    $regExp = "#{" . $marker . "}#Us";
    // search for our marker}
    if (preg_match_all($regExp, $rowContent->text, $matches, PREG_SET_ORDER) > 0) {
        // we have at least one match, we can search for similar urls
        $html = shGetSimilarUrls(JURI::getInstance()->getPath(), $pluginParams);
        // remove comment, so that nothing shows
        if (empty($html)) {
            $rowContent->text = preg_replace('/{sh404sefSimilarUrlsCommentStart}.*{sh404sefSimilarUrlsCommentEnd}/iUs', '', $rowContent->text);
        } else {
            // remove the comment markers themselves
            $rowContent->text = str_replace('{sh404sefSimilarUrlsCommentStart}', '', $rowContent->text);
            $rowContent->text = str_replace('{sh404sefSimilarUrlsCommentEnd}', '', $rowContent->text);
        }
        // now replace instances of the marker by similar urls list
        $rowContent->text = str_replace($matches[0], $html, $rowContent->text);
    }
    return true;
}
开发者ID:lautarodragan,项目名称:ideary,代码行数:42,代码来源:sh404sefsimilarurls.php


示例14: isMobileRequest

 /**
  * Checks whether a request is coming from mobile device
  *
  * @return boolean true if current page request is from a known mobile device
  */
 public static function isMobileRequest()
 {
     static $isMobile = null;
     static $defaultRecords = array(array('start' => 0, 'stop' => 0, 'string' => '/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile|o2|opera m(ob|in)i|palm( os)?|p(ixi|re)\\/|plucker|pocket|psp|smartphone|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce; (iemobile|ppc)|xiino/i'), array('start' => 0, 'stop' => 4, 'string' => '/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|e\\-|e\\/|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\\-|2|g)|yas\\-|your|zeto|zte\\-/i'));
     if (is_null($isMobile)) {
         jimport('joomla.environment.browser');
         $browser =& JBrowser::getInstance();
         $isMobile = $browser->get('_mobile');
         $userAgent = $browser->get('_lowerAgent');
         // detection code adapted from http://detectmobilebrowser.com/
         $remoteConfig = Sh404sefHelperUpdates::getRemoteConfig($forced = false);
         $remotesRecords = empty($remoteConfig->config['mobiledetectionstrings']) ? array() : $remoteConfig->config['mobiledetectionstrings'];
         $records = empty($remotes) ? $defaultRecords : $remotesRecords;
         foreach ($records as $record) {
             $isMobile = $isMobile || (empty($record['stop']) ? preg_match($record['string'], substr($userAgent, $record['start'])) : preg_match($record['string'], substr($userAgent, $record['start'], $record['stop'])));
         }
         // tell page information object about this
         Sh404sefFactory::getPageInfo()->isMobileRequest = $isMobile ? Sh404sefClassPageinfo::LIVE_SITE_MOBILE : Sh404sefClassPageinfo::LIVE_SITE_NOT_MOBILE;
     }
     return $isMobile;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:26,代码来源:shmobile.php


示例15: shAppendListing

 function shAppendListing($link_name, $link_id, $add_details = false, $shLangIso, $option, $shLangName)
 {
     global $sh_LANG;
     $sefConfig =& Sh404sefFactory::getConfig();
     $sef = array();
     if ($sefConfig->shMTreeInsertListingId) {
         if (!$sefConfig->shMTreePrependListingId) {
             $sef[] = ($sefConfig->shMTreeInsertListingName ? $link_name . $sefConfig->replacement : '') . $link_id;
         } else {
             $sef[] = $link_id . ($sefConfig->shMTreeInsertListingName ? $sefConfig->replacement . $link_name : '');
         }
     } else {
         if ($sefConfig->shMTreeInsertListingName) {
             $sef[] = $link_name;
         }
     }
     if ($add_details) {
         $sef[] = $sh_LANG[$shLangIso]['_MT_SEF_DETAILS'];
     }
     if ($sefConfig->shMTreeInsertListingName || $sefConfig->shMTreeInsertListingId) {
         shRemoveFromGETVarsList('link_id');
     }
     return $sef;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:24,代码来源:com_mtree.php


示例16: getSefURLFromCacheOrDB

 public function getSefURLFromCacheOrDB($nonSefUrl, &$sefUrl)
 {
     $sefConfig = Sh404sefFactory::getConfig();
     if (empty($nonSefUrl)) {
         return sh404SEF_URLTYPE_NONE;
     }
     $sefUrl = '';
     $urlType = sh404SEF_URLTYPE_NONE;
     if ($sefConfig->shUseURLCache) {
         $urlType = Sh404sefHelperCache::getSefUrlFromCache($nonSefUrl, $sefUrl);
     }
     // Check if the url is already saved in the database.
     if ($urlType == sh404SEF_URLTYPE_NONE) {
         $urlType = $this->getSefUrlFromDatabase($nonSefUrl, $sefUrl);
         if ($urlType == sh404SEF_URLTYPE_NONE || $urlType == sh404SEF_URLTYPE_404) {
             return $urlType;
         } else {
             if ($sefConfig->shUseURLCache) {
                 Sh404sefHelperCache::addSefUrlToCache($nonSefUrl, $sefUrl, $urlType);
             }
         }
     }
     return $urlType;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:24,代码来源:sefurls.php


示例17: _makeToolbarDefaultJ3

 /**
  * Create toolbar for default layout view
  *
  * @param midxed $params
  */
 private function _makeToolbarDefaultJ3($params = null)
 {
     // add title
     JToolbarHelper::title('sh404SEF: ' . JText::_('COM_SH404SEF_PAGEIDS_MANAGER'), 'sh404sef-toolbar-title');
     // add "New url" button
     $bar = JToolBar::getInstance('toolbar');
     // prepare configuration button
     $bar->addButtonPath(SHLIB_ROOT_PATH . 'toolbarbutton');
     $params = array();
     $params['size'] = Sh404sefFactory::getPConfig()->windowSizes['import'];
     $params['buttonClass'] = 'btn btn-small';
     $params['iconClass'] = 'icon-upload';
     $params['checkListSelection'] = false;
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=pageids';
     $bar->appendButton('J3popuptoolbarbutton', 'import', JText::_('COM_SH404SEF_IMPORT_BUTTON'), $url, $params['size']['x'], $params['size']['y'], $top = 0, $left = 0, $onClose = '', $title = JText::_('COM_SH404SEF_IMPORTING_TITLE'), $params);
     // add import button
     $params = array();
     $params['size'] = Sh404sefFactory::getPConfig()->windowSizes['export'];
     $params['buttonClass'] = 'btn btn-small';
     $params['iconClass'] = 'icon-download';
     $params['checkListSelection'] = false;
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=pageids';
     $bar->appendButton('J3popuptoolbarbutton', 'export', JText::_('COM_SH404SEF_EXPORT_BUTTON'), $url, $params['size']['x'], $params['size']['y'], $top = 0, $left = 0, $onClose = '', $title = JText::_('COM_SH404SEF_EXPORTING_TITLE'), $params);
     // separator
     JToolBarHelper::spacer(20);
     // add delete button
     $params = array();
     $params['size'] = Sh404sefFactory::getPConfig()->windowSizes['confirm'];
     $params['buttonClass'] = 'btn btn-small';
     $params['iconClass'] = 'icon-trash';
     $params['checkListSelection'] = true;
     $url = 'index.php?option=com_sh404sef&c=pageids&task=confirmdelete&tmpl=component';
     $bar->appendButton('J3popuptoolbarbutton', 'delete', JText::_('JTOOLBAR_DELETE'), $url, $params['size']['x'], $params['size']['y'], $top = 0, $left = 0, $onClose = '', $title = JText::_('COM_SH404SEF_CONFIRM_TITLE'), $params);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:39,代码来源:view.html.php


示例18: shAddPaginationHeaderLinks

 function shAddPaginationHeaderLinks(&$buffer)
 {
     $sefConfig =& Sh404sefFactory::getConfig();
     if (!isset($sefConfig) || empty($sefConfig->shMetaManagementActivated) || empty($sefConfig->insertPaginationTags)) {
         return;
     }
     $pageInfo =& Sh404sefFactory::getPageInfo();
     // handle pagination
     if (!empty($pageInfo->paginationNextLink)) {
         $link = "\n  " . '<link rel="next" href="' . $pageInfo->paginationNextLink . '" />';
         $buffer = shInsertCustomTagInBuffer($buffer, '<head>', 'after', $link, 'first');
     }
     if (!empty($pageInfo->paginationPrevLink)) {
         $link = "\n  " . '<link rel="prev" href="' . $pageInfo->paginationPrevLink . '" />';
         $buffer = shInsertCustomTagInBuffer($buffer, '<head>', 'after', $link, 'first');
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:17,代码来源:shPageRewrite.php


示例19: getCategorySlugArray

 public function getCategorySlugArray($extension, $id, $whichCat, $useAlias, $insertId, $uncategorizedPath = '', $requestedLanguage = '*', $separator = '')
 {
     // special case for the "uncategorised" category
     $unCat = Sh404sefHelperCategories::getUncategorizedCat($extension);
     if (!empty($unCat) && $id == $unCat->id) {
         $slugArray = empty($uncategorizedPath) ? array() : array($uncategorizedPath);
         return $slugArray;
     }
     // regular category, build the path to the cat
     $separator = empty($separator) ? Sh404sefFactory::getConfig()->replacement : $separator;
     $pathArray = $this->getCategoryPathArray($extension, $id, $whichCat, $useAlias, $insertId, $requestedLanguage, $separator);
     $slugArray = array();
     foreach ($pathArray as $catObject) {
         $slugArray[] = $catObject->slug;
     }
     return $slugArray;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:17,代码来源:slugs.php


示例20: die

    die('Direct Access to this location is not allowed.');
}
// Ensure that user has access to this function.
$user =& JFactory::getUser();
if (!($user->usertype == 'Super Administrator' || $user->usertype == 'Administrator')) {
    $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
// Setup paths.
$sef_config_class = JPATH_ADMINISTRATOR . '/components/com_sh404sef/sh404sef.class.php';
$sef_config_file = JPATH_ADMINISTRATOR . '/components/com_sh404sef/config/config.sef.php';
// Make sure class was loaded.
if (!class_exists('shSEFConfig')) {
    if (is_readable($sef_config_class)) {
        require_once $sef_config_class;
    } else {
        JError::RaiseError(500, COM_SH404SEF_NOREAD . "( {$sef_config_class} )<br />" . COM_SH404SEF_CHK_PERMS);
    }
}
// testing JLanguage16
jimport('joomla.language.language');
$j16Language =& shjlang16Helper::getLanguage();
$loaded = $j16Language->load('com_sh404sef', JPATH_BASE);
// include sh404sef default language file
shIncludeLanguageFile();
// find about specific controller requested
$cName = JRequest::getCmd('c');
// get controller from factory
$controller = Sh404sefFactory::getController($cName);
// read and execute task
$controller->execute(JRequest::getCmd('task'));
$controller->redirect();
开发者ID:sangkasi,项目名称:joomla,代码行数:31,代码来源:admin.sh404sef.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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