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

PHP Sh404sefHelperGeneral类代码示例

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

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



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

示例1: _makeToolbarDefault

 /**
  * Create toolbar for default layout view
  *
  * @param midxed $params
  */
 private function _makeToolbarDefault($params = null)
 {
     global $mainframe;
     // Get the JComponent instance of JToolBar
     $bar =& JToolBar::getInstance('toolbar');
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_PAGEIDS_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $mainframe->set('JComponentTitle', $title);
     // get toolbar object
     $bar =& JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 400);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=pageids';
     $bar->appendButton('Shpopuptoolbarbutton', 'import', $url, JText::_('Import'), $msg = '', $task = 'import', $list = false, $hidemenu = true, $params);
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=pageids';
     $bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('Export'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
     // add delete button as an ajax call
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=pageids&task=confirmdelete&tmpl=component';
     $bar->appendButton('Shpopuptoolbarbutton', 'delete', $url, JText::_('Delete'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'purgeselected', $list = true, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
 }
开发者ID:justinlyon,项目名称:scc,代码行数:39,代码来源:view.html.php


示例2: _makeViewInfo

 /**
  * Attach css, js and create toolbar for Info view
  *
  * @param midxed $params
  */
 private function _makeViewInfo($params = null)
 {
     global $mainframe;
     // add our own css
     JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $mainframe->set('JComponentTitle', $title);
 }
开发者ID:justinlyon,项目名称:scc,代码行数:14,代码来源:view.html.php


示例3: _doDefault

 private function _doDefault($tpl)
 {
     // declare docoument mime type
     $document =& JFactory::getDocument();
     $document->setMimeEncoding('text/xml');
     // call helper to prepare response xml file content
     $response = Sh404sefHelperGeneral::prepareAjaxResponse($this);
     // echo it
     echo $response;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:10,代码来源:view.raw.php


示例4: display

 public function display($tpl = null)
 {
     // declare docoument mime type
     $document = JFactory::getDocument();
     $document->setMimeEncoding('text/xml');
     // call helper to prepare response xml file content
     $response = Sh404sefHelperGeneral::prepareAjaxResponse($this);
     // echo it
     echo $response;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:10,代码来源:view.raw.php


示例5: display

 public function display($tpl = null)
 {
     // version prefix
     $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix();
     // get action
     $this->task = empty($this->task) ? 'delete' : $this->task;
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $document = JFactory::getDocument();
         // add modal css and js
         ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument());
         ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument());
         ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument());
         JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/j3_list.css');
         if (!empty($this->redirectTo) && !empty($this->message)) {
             // redirecting to parent page, but there's a message
             // let's enqueue it, so it's displayed after the redirect
             JFactory::getApplication()->enqueueMessage($this->message);
         }
     } else {
         // J2
         // if redirecting to another page, we need to simply send some javascript
         // to : a / close the popup, b / redirect the parent page to where we
         // want to go
         if (!empty($this->redirectTo)) {
             $js = 'window.addEvent( \'domready\', function () {
   setTimeout( \'shRedirectTo()\', 2000);
 });
 function shRedirectTo() {
   parent.window.location="' . $this->redirectTo . '";
   window.parent.SqueezeBox.close();
 }
 ';
             $document = JFactory::getDocument();
             $document->addScriptDeclaration($js);
         } else {
             // build the toolbar
             $toolBar = $this->_makeToolbar();
             $this->assignRef('toolbar', $toolBar);
             // add confirmation phrase to toolbar
             $this->assign('toolbarTitle', '<div class="headerconfirm" >' . JText::_('COM_SH404SEF_CONFIRM_TITLE') . '</div>');
             // link to  custom javascript
             JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/edit.js');
         }
         // add our own css
         JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/confirm.css');
     }
     // now display normally
     parent::display($this->joomlaVersionPrefix);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:49,代码来源:view.html.php


示例6: save

 /**
  * Save a list of meta data as edited by
  * user in backend
  */
 public function save()
 {
     // first check if anything was modified
     $originalMd5 = JRequest::getString('contentcs');
     $dataSet = array();
     $ids = JRequest::getVar('metaid', array(0), 'post', 'array');
     $titles = JRequest::getVar('metatitle', array(), 'post', 'array');
     $descs = JRequest::getVar('metadesc', array(), 'post', 'array');
     $newurls = JRequest::getVar('newurls', array(), 'post', 'array');
     // calculate md5 of incoming data and compare to stored value
     foreach ($ids as $id => $value) {
         $t = array();
         $t['meta_id'] = $value;
         $t['metatitle'] = $titles[$id];
         $t['metadesc'] = $descs[$id];
         $t['newurl'] = $newurls[$id];
         $dataSet[] = $t;
     }
     $newMd5 = Sh404sefHelperGeneral::getDataMD5($dataSet, array('metatitle', 'metadesc'), $asObject = false);
     $dataModified = $originalMd5 != $newMd5;
     // if nothing changed, display message and return to meta data list
     if ($dataModified) {
         // we did change something, ask model to save it
         $model = $this->getModel('metas', 'Sh404sefModel');
         $model->saveSet($dataSet);
         // check errors and display if not ajax call
         $error = $model->getError();
         if (!empty($error)) {
             $this->setError($error);
         }
     } else {
         // did not change data, display that
         $this->setError(JText::_('COM_SH404SEF_DATA_NOT_MODIFIED'));
     }
     // check if ajax call, we'll return differently
     $isAjax = JRequest::getInt('shajax') == 1;
     // finally return
     if ($isAjax) {
         // ajax : send xml response
         $this->display();
     } else {
         // not ajax, enqueue message and go back to list
         $this->enqueuemessages(array($error), 'error');
         $this->setRedirect($this->_getDefaultRedirect());
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:50,代码来源:metas.php


示例7: _doDefault

 /**
  * Ajax response handler for any configuration dialog
  * except quick control panel
  *
  * @param string $tpl
  */
 private function _doDefault($tpl)
 {
     // use Joomla wml object
     jimport('joomla.utilities.simplexml');
     // prepare elements of respn
     $this->assign('taskexecuted', $this->getLayout());
     $errors = $this->getError();
     $task = JRequest::getCmd('task');
     switch ($task) {
         case 'apply':
             // applying : dialog box not going to be closed
             if (($this->taskexecuted == 'default' || $this->taskexecuted == 'ext') && empty($errors)) {
                 // no errors, insert success messages
                 $this->assign('message', '<li>' . JText16::_('COM_SH404SEF_ELEMENT_SAVED') . '.</li><br /><li>' . JText16::_('COM_SH404SEF_MAY_NEED_PURGE_DIALOGBOX') . '</li>');
             } else {
                 if (empty($errors)) {
                     $this->assign('message', JText16::_('COM_SH404SEF_ELEMENT_SAVED'));
                 }
             }
             break;
         case 'save':
             // box is going to be close, we want to redirect so that message is displayed
             if (($this->taskexecuted == 'default' || $this->taskexecuted == 'ext') && empty($errors)) {
                 // no errors, tell user they must purge urls
                 $messagecode = 'COM_SH404SEF_MAY_NEED_PURGE';
             } else {
                 if (empty($errors)) {
                     // no errors, but no need to purge : seo settings, security settings, etc
                     $messagecode = 'COM_SH404SEF_ELEMENT_SAVED';
                 }
             }
             $this->assign('redirectTo', $this->defaultRedirectUrl);
             $this->assign('messagecode', $messagecode);
             break;
     }
     // use helper to prepare response
     $response = Sh404sefHelperGeneral::prepareAjaxResponse($this);
     // declare docoument mime type
     $document =& JFactory::getDocument();
     $document->setMimeEncoding('text/xml');
     // output resulting text, no need for a layout file I think
     echo $response;
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:49,代码来源:view.raw.php


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


示例9: _addCss

    private function _addCss()
    {
        // add link to css
        JHtml::styleSheet('icon.css', 'administrator/templates/khepri/css/');
        JHtml::styleSheet('rounded.css', 'administrator/templates/khepri/css/');
        JHtml::styleSheet('system.css', 'administrator/templates/system/css/');
        $customCss = '
    <!--[if IE 7]>
<link href="templates/khepri/css/ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->

<!--[if lte IE 6]>
<link href="templates/khepri/css/ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->';
        // insert using addCustomtag, so that J! does not add any markup
        $document =& JFactory::getDocument();
        $document->addCustomTag($customCss);
        // add our own css
        JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
    }
开发者ID:sangkasi,项目名称:joomla,代码行数:20,代码来源:view.html.php


示例10: updateShurls

 public static function updateShurls()
 {
     $sefConfig =& shRouter::shGetConfig();
     // set the short link tag
     $shPageInfo =& shRouter::shPageInfo();
     $shPageInfo->shURL = '';
     if ($sefConfig->enablePageId && !$sefConfig->stopCreatingShurls) {
         try {
             jimport('joomla.utilities.string');
             $nonSefUrl = JString::ltrim($shPageInfo->shCurrentPageNonSef, '/');
             $nonSefUrl = shSortURL($nonSefUrl);
             // remove tracking vars (Google Analytics)
             $nonSefUrl = Sh404sefHelperGeneral::stripTrackingVarsFromNonSef($nonSefUrl);
             // try to get the current shURL, if any
             $shURL = Sh404sefHelperDb::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($GLOBALS['shConfigLiveSite'], '/') . '/' . $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
                 $shPageInfo->shURL = $shURL;
             }
         } catch (Sh404sefExceptionDefault $e) {
         }
     }
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:41,代码来源:shurl.php


示例11: saveqcontrol

 /**
  * Saves data from the quickStart pane on main dashboard
  */
 public function saveqcontrol()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     try {
         // get current settings for sh404SEF
         $params = Sh404sefHelperGeneral::getComponentParams($forceRead = true);
         // set params from the form
         $params->set('Enabled', JRequest::getInt('Enabled', 0));
         $params->set('canReadRemoteConfig', JRequest::getInt('canReadRemoteConfig', 0));
         $params->set('shRewriteMode', JRequest::getInt('shRewriteMode', 1));
         $params->set('shSecEnableSecurity', JRequest::getInt('shSecEnableSecurity', 1));
         // convert to json and store into db
         $textParams = $params->toString();
         ShlDbHelper::update('#__extensions', array('params' => $textParams), array('element' => 'com_sh404sef', 'type' => 'component'));
         JFactory::getApplication()->enqueueMessage(JText::_('COM_SH404SEF_ELEMENT_SAVED'));
     } catch (Exception $e) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_SH404SEF_ELEMENT_NOT_SAVED'), 'error');
     }
     parent::display();
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:24,代码来源:configuration.php


示例12: display

 public function display($tpl = null)
 {
     // prepare the view, based on request
     // do we force reading updates from server ?
     $options = Sh404sefHelperAnalytics::getRequestOptions();
     $method = '_makeView' . ucfirst($options['report']);
     if (is_callable(array($this, $method))) {
         $this->{$method}($tpl);
     }
     // push display options into template
     $this->assign('options', $options);
     // add our javascript
     JHTML::script('cp.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // add Joomla calendar behavior, needed to input start and end dates
     if ($options['showFilters'] == 'yes') {
         JHTML::_('behavior.calendar');
     }
     // add our own css
     JHtml::styleSheet('cp.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // add tooltips handler
     JHTML::_('behavior.tooltip');
     // add title
     $app =& JFactory::getApplication();
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_ANALYTICS_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $app->set('JComponentTitle', $title);
     // add a div to display our ajax-call-in-progress indicator
     // Get the JComponent instance of JToolBar
     $bar =& JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
     $html = '<div id="sh-progress-cpprogress"></div>';
     $bar->appendButton('custom', $html, 'sh-progress-button-cpprogress');
     // add quick control panel loader
     $js = 'window.addEvent(\'domready\', function(){  shSetupAnalytics({report:" ' . $options['report'] . '"});});';
     $document =& JFactory::getDocument();
     $document->addScriptDeclaration($js);
     // flag to know if we should display placeholder for ajax fillin
     $this->assign('isAjaxTemplate', true);
     parent::display($tpl = null);
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:39,代码来源:view.html.php


示例13: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  */
 protected function getInput()
 {
     $text = JText::_('COM_SH404SEF_CONFIGURE_SHLIB_PLUGIN');
     $link = '<span class = "btn sh404sef-textinput"><a href="' . Sh404sefHelperGeneral::getShLibPluginLink() . '" target="_blank">' . $text . '</a></span>';
     return $link;
     $html = '';
     $class = $this->element['class'] ? (string) $this->element['class'] : '';
     // Build the class for the label.
     $class = !empty($this->description) ? 'hasTip' : '';
     $class = $this->required == true ? $class . ' required' : $class;
     // Add the opening label tag and main attributes attributes.
     $field = '<fieldset id="' . $this->id . ' class="' . $class . '"';
     // If a description is specified, use it to build a tooltip.
     $label = '<label for=""';
     if (!empty($this->description)) {
         $label .= ' title="' . htmlspecialchars(trim($text, ':') . '::' . ($this->translateDescription ? JText::_($this->description) : $this->description), ENT_COMPAT, 'UTF-8') . '"';
     }
     // Add the label text and closing tag.
     $label .= "></label>";
     $field .= '><span class = "sh404sef-additionaltext">' . $link . '</span></fieldset>';
     $html[] = $field;
     return implode('', $html);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:28,代码来源:shlibpluginlink.php


示例14: _getDefaultRedirect

 /**
  * Builds a (non routed) Joomla url according to default values
  * of controller, task, view and layout
  *
  * @param array $userVars optional set of variables to override default vars, or add more to url
  * @return string the target url, not routed
  */
 protected function _getDefaultRedirect($userVars = array())
 {
     // get default values of the controller
     $defaultVars = array('c' => $this->_returnController, 'layout' => $this->_returnLayout, 'view' => $this->_returnView, 'task' => $this->_returnTask);
     // override default vars with user defined vars
     $vars = array_merge($defaultVars, $userVars);
     // strip empty vars
     foreach ($vars as $key => $value) {
         if ($value == '') {
             unset($vars[$key]);
         }
     }
     return Sh404sefHelperGeneral::buildUrl($vars);
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:21,代码来源:basecontroller.php


示例15: empty

          <td class="shl-list-shurl">
            <?php 
        echo empty($url->pageid) ? '' : ShlHtmlBs_Helper::badge($this->escape($url->pageid), 'info');
        ?>
          </td>

          <td class="shl-list-sef">
            <?php 
        echo '<input type="hidden" name="metaid[' . $url->id . ']" value="' . (empty($url->metaid) ? 0 : $url->metaid) . '" />';
        echo '<input type="hidden" name="newurls[' . $url->id . ']" value="' . (empty($url->nonsefurl) ? '' : $this->escape($url->nonsefurl)) . '" />';
        // link to full meta edit
        $anchor = empty($url->oldurl) ? '(-)' : $this->escape($url->oldurl);
        $anchor .= '<br/><i>(' . $this->escape($url->nonsefurl) . ')</i>';
        $params = array();
        $linkData = array('c' => 'editurl', 'task' => 'edit', 'view' => 'editurl', 'startOffset' => '1', 'cid[]' => $url->id, 'tmpl' => 'component');
        $targetUrl = Sh404sefHelperGeneral::buildUrl($linkData);
        $displayedUrl = empty($url->oldurl) ? $url->nonsefurl : $url->oldurl;
        $params['linkTitle'] = JText::_('COM_SH404SEF_MODIFY_META_TITLE') . ' ' . $this->escape($displayedUrl);
        $modalTitle = '';
        $params['linkClass'] = 'shl-list-sef';
        $params['linkType'] = 'a';
        $name = '-editurl-' . $url->id;
        echo ShlHtmlModal_helper::modalLink($name, $anchor, $targetUrl, Sh404sefFactory::getPConfig()->windowSizes['editurl']['x'], Sh404sefFactory::getPConfig()->windowSizes['editurl']['y'], $top = 0, $left = 0, $onClose = '', $modalTitle, $params);
        // small preview icon
        $sefConfig =& Sh404sefFactory::getConfig();
        $link = JURI::root() . ltrim($sefConfig->shRewriteStrings[$sefConfig->shRewriteMode], '/') . (empty($url->oldurl) ? $url->nonsefurl : $url->oldurl);
        echo '&nbsp;<a href="' . $this->escape($link) . '" target="_blank" title="' . JText::_('COM_SH404SEF_PREVIEW') . ' ' . $this->escape($url->oldurl) . '">';
        echo '<img src=\'components/com_sh404sef/assets/images/external-black.png\' border=\'0\' alt=\'' . JText::_('COM_SH404SEF_PREVIEW') . '\' />';
        echo '</a>';
        ?>
          </td>
开发者ID:alesconti,项目名称:FF_2015,代码行数:31,代码来源:default_j3.php


示例16: _shouldInsertSnippet

  /**
   * Check if user set parameters and request
   * data allow inserting tracking snippet
   */
  protected function _shouldInsertSnippet() {

    // get config
    $sefConfig = & Sh404sefFactory::getConfig();

    // check if we have a tracking code, no need to insert snippet if no tracking code
    if (empty( $sefConfig->analyticsId)) {
      return false;
    }

    // check if we are set to include tracking code for current user
    $user = JFactory::getUser();
    if ( !empty( $sefConfig->analyticsMaxUserLevel) && $sefConfig->analyticsMaxUserLevel != 'Public Frontend' && Sh404sefHelperGeneral::compareGroups( $user->usertype, $sefConfig->analyticsMaxUserLevel) == 1) {
      return false;
    }

    // check if current IP is on exclusion list
    if( !empty( $sefConfig->analyticsExcludeIP)) {
      $ip = empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR'];
      $exclude = Sh404sefHelperGeneral::checkIPList( $ip, $sefConfig->analyticsExcludeIP);
      if ($exclude) {
        return false;
      }
    }

    return true;
  }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:31,代码来源:baseanalytics.php


示例17: shGetCurrentNonSef

 function shGetCurrentNonSef()
 {
     // remove Google tracking vars, would prevent us to find the correct meta tags
     $nonSef = Sh404sefHelperGeneral::stripTrackingVarsFromNonSef(Sh404sefFactory::getPageInfo()->shCurrentPageNonSef);
     // normalize, set variables in alpha order
     return shSortUrl($nonSef);
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:7,代码来源:shPageRewrite.php


示例18: _addFilters

 private function _addFilters()
 {
     // component selector
     JHtmlSidebar::addFilter(JText::_('COM_SH404SEF_ALL_COMPONENTS'), 'filter_component', JHtml::_('select.options', Sh404sefHelperGeneral::getComponentsList(), 'element', 'name', $this->options->filter_component, true));
     // language list
     JHtmlSidebar::addFilter(JText::_('COM_SH404SEF_ALL_LANGUAGES'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', $all = false, $translate = true), 'value', 'text', $this->options->filter_language, false));
     // select custom
     $data = array(array('value' => Sh404sefHelperGeneral::COM_SH404SEF_ONLY_CUSTOM, 'text' => JText::_('COM_SH404SEF_ONLY_CUSTOM')), array('value' => Sh404sefHelperGeneral::COM_SH404SEF_ONLY_AUTO, 'text' => JText::_('COM_SH404SEF_ONLY_AUTO')));
     JHtmlSidebar::addFilter(JText::_('COM_SH404SEF_ALL_URL_TYPES'), 'filter_url_type', JHtml::_('select.options', $data, 'value', 'text', $this->options->filter_url_type, true));
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:10,代码来源:view.html.php


示例19: shInsertOpenGraphData

 function shInsertOpenGraphData(&$buffer)
 {
     // get sh404sef config
     $sefConfig =& Sh404sefFactory::getConfig();
     $pageInfo =& Sh404sefFactory::getPageInfo();
     if (empty($sefConfig->shMetaManagementActivated) || !isset($sefConfig) || empty($pageInfo->currentNonSefUrl) || !empty($pageInfo->httpStatus) && $pageInfo->httpStatus == 404) {
         return;
     }
     $nonSef = shGetCurrentNonSef();
     $customData = shGetCustomMetaData($nonSef);
     // user can disable per url
     if ($customData->og_enable == SH404SEF_OPTION_VALUE_NO || empty($sefConfig->enableOpenGraphData) && $customData->og_enable == SH404SEF_OPTION_VALUE_USE_DEFAULT) {
         return;
     }
     $openGraphData = '';
     $ogNameSpace = '';
     $fbNameSpace = '';
     // add locale -  FB use underscore in language tags
     $locale = str_replace('-', '_', JFactory::getLanguage()->getTag());
     $openGraphData .= "\n" . '  <meta property="og:locale" content="' . $locale . '" />';
     // insert title
     if (!empty($pageInfo->pageTitle)) {
         $openGraphData .= "\n" . '  <meta property="og:title" content="' . $pageInfo->pageTitle . '" />';
     }
     // insert description
     if (($sefConfig->ogEnableDescription && $customData->og_enable_description == SH404SEF_OPTION_VALUE_USE_DEFAULT || $customData->og_enable_description == SH404SEF_OPTION_VALUE_YES) && !empty($pageInfo->pageDescription)) {
         $openGraphData .= "\n" . '  <meta property="og:description" content="' . $pageInfo->pageDescription . '" />';
     }
     // insert type
     $content = $customData->og_type == SH404SEF_OPTION_VALUE_USE_DEFAULT ? $sefConfig->ogType : $customData->og_type;
     if (!empty($content)) {
         $openGraphData .= "\n" . '  <meta property="og:type" content="' . $content . '" />';
     }
     // insert url. If any, we insert the canonical url rather than current, to consolidate
     $content = empty($pageInfo->pageCanonicalUrl) ? $pageInfo->currentSefUrl : $pageInfo->pageCanonicalUrl;
     $content = Sh404sefHelperGeneral::stripTrackingVarsFromSef($content);
     $openGraphData .= "\n" . '  <meta property="og:url" content="' . htmlspecialchars($content, ENT_COMPAT, 'UTF-8') . '" />';
     // insert image
     $content = empty($customData->og_image) ? $sefConfig->ogImage : $customData->og_image;
     if (!empty($content)) {
         $content = JURI::root(false, '') . JString::ltrim($content, '/');
         $openGraphData .= "\n" . '  <meta property="og:image" content="' . $content . '" />';
     }
     // insert site name
     if ($sefConfig->ogEnableSiteName && $customData->og_enable_site_name == SH404SEF_OPTION_VALUE_USE_DEFAULT || $customData->og_enable_site_name == SH404SEF_OPTION_VALUE_YES) {
         $content = empty($customData->og_site_name) ? $sefConfig->ogSiteName : $customData->og_site_name;
         $content = empty($content) ? JFactory::getApplication()->getCfg('sitename') : $content;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:site_name" content="' . $content . '" />';
         }
     }
     // insert location
     // disabled: Facebook removed all of that after reducing number of object types to bare minimum
     if (false && ($sefConfig->ogEnableLocation && $customData->og_enable_location == SH404SEF_OPTION_VALUE_USE_DEFAULT || $customData->og_enable_location == SH404SEF_OPTION_VALUE_YES)) {
         $content = empty($customData->og_latitude) ? $sefConfig->ogLatitude : $customData->og_latitude;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:latitude" content="' . $content . '" />';
         }
         $content = empty($customData->og_longitude) ? $sefConfig->ogLongitude : $customData->og_longitude;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:longitude" content="' . $content . '" />';
         }
         $content = empty($customData->og_street_address) ? $sefConfig->ogStreetAddress : $customData->og_street_address;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:street-address" content="' . $content . '" />';
         }
         $content = empty($customData->og_locality) ? $sefConfig->ogLocality : $customData->og_locality;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:locality" content="' . $content . '" />';
         }
         $content = empty($customData->og_postal_code) ? $sefConfig->ogPostalCode : $customData->og_postal_code;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:postal-code" content="' . $content . '" />';
         }
         $content = empty($customData->og_region) ? $sefConfig->ogRegion : $customData->og_region;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:region" content="' . $content . '" />';
         }
         $content = empty($customData->og_country_name) ? $sefConfig->ogCountryName : $customData->og_country_name;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:country-name" content="' . $content . '" />';
         }
     }
     // insert contact
     // disabled: Facebook removed all of that after reducing number of object types to bare minimum
     if (false && ($sefConfig->ogEnableContact && $customData->og_enable_contact == SH404SEF_OPTION_VALUE_USE_DEFAULT || $customData->og_enable_contact == SH404SEF_OPTION_VALUE_YES)) {
         $content = empty($customData->og_email) ? $sefConfig->ogEmail : $customData->og_email;
         if (!empty($content)) {
             $content = htmlspecialchars(shCleanUpDesc($content), ENT_COMPAT, 'UTF-8');
             $openGraphData .= "\n" . '  <meta property="og:email" content="' . $content . '" />';
         }
         $content = empty($customData->og_phone_number) ? $sefConfig->ogPhoneNumber : $customData->og_phone_number;
//.........这里部分代码省略.........
开发者ID:alesconti,项目名称:FF_2015,代码行数:101,代码来源:shPageRewrite.php


示例20: makeLink

 /**
  * Builds up an html link using the various parts supplied
  *
  * @param $view a JView object, to be able to escape output text
  * @param $linkData an array of key/value pairs to build up the target links
  * @param $elementData an array holding element data : title, class, rel
  * @param $modal boolean, if true, required stuff to make the link open in modal box is added
  * @param $hasTip boolean, if true, required stuff to turn elementData['title'] into a tooltip is added
  * @param $extra an array holding key/value pairs, will be added as raw attributes to the link
  */
 public static function makeLink($view, $linkData, $elementData, $modal = false, $modalOptions = array(), $hasTip = false, $extra = array())
 {
     // calculate target link
     if ($modal) {
         $linkData['tmpl'] = 'component';
     }
     $url = Sh404sefHelperGeneral::buildUrl($linkData);
     $url = JRoute::_($url);
     // calculate title
     $title = empty($elementData['title']) ? '' : $elementData['title'];
     $title = is_null($view) ? $title : $view->escape($title);
     $attribs = array();
     // calculate class
     $class = empty($elementData['class']) ? '' : $elementData['class'];
     if ($hasTip) {
         $class .= ' ' . $hasTip;
     }
     // store title in attributes array
     if (!empty($title)) {
         $attribs['title'] = $title;
     }
     // store in attributes array
     if (!empty($class)) {
         $attribs['class'] = $class;
     }
     // calculate modal information
     $rel = empty($elementData['rel']) || is_null($view) ? '' : $view->escape($elementData['rel']);
     if ($modal) {
         $modalOptionsString = Sh404sefHelperHtml::makeSqueezeboxOptions($modalOptions);
         $rel .= ' {handler: \'iframe\'' . (empty($modalOptionsString) ? '' : ', ' . $modalOptionsString) . '}';
     }
     // store in attributes array
     if (!empty($rel)) {
         $attribs['rel'] = $rel;
     }
     // any custom attibutes ?
     if (!empty($extra)) {
         foreach ($extra as $key => $value) {
             $attribs[$key] = $value;
         }
     }
     // finish link
     $anchor = empty($elementData['anchor']) ? $title : $elementData['anchor'];
     return JHTML::link($url, $anchor, $attribs);
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:55,代码来源:html.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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