Example #1
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_SEF_JOOMSEF'), 'artio.png');
     $user = JFactory::getUser();
     if ($user->authorise('core.admin', 'com_sef')) {
         JToolBarHelper::preferences('com_sef');
     }
     // Get number of URLs for purge warning
     $model = SEFModel::getInstance('URLs', 'SEFModel');
     $this->assign('purgeCount', $model->getCount(0));
     // Get newest version available
     $sefConfig = SEFConfig::getConfig();
     if ($sefConfig->versionChecker) {
         $model2 = SEFModel::getInstance('Upgrade', 'SEFModel');
         $newVer = $model2->getNewSEFVersion();
         $sefinfo = SEFTools::getSEFInfo();
         if (strnatcasecmp($newVer, $sefinfo['version']) > 0 || strnatcasecmp($newVer, substr($sefinfo['version'], 0, strpos($sefinfo['version'], '-'))) == 0) {
             $newVer = '<span style="font-weight: bold; color: red;">' . $newVer . '</span>&nbsp;&nbsp;<input type="button" class="btn btn-small" onclick="showUpgrade();" value="' . JText::_('COM_SEF_GO_TO_UPGRADE_PAGE') . '" />';
         }
         $newVer .= ' <input type="button" class="btn btn-danger btn-small" onclick="disableStatus(\'versioncheck\');" value="' . JText::_('COM_SEF_DISABLE_VERSION_CHECKER') . '" />';
         $this->assign('newestVersion', $newVer);
     } else {
         $newestVersion = JText::_('COM_SEF_VERSION_CHECKER_DISABLED') . '&nbsp;&nbsp;<input type="button" class="btn btn-success btn-small" onclick="enableStatus(\'versioncheck\');" value="' . JText::_('COM_SEF_ENABLE') . '" />';
         $this->assign('newestVersion', $newestVersion);
     }
     // Get statistics
     $stats = $model->getStatistics();
     $this->assignRef('stats', $stats);
     // Get feed
     $feed = $this->get('Feed');
     $this->assignRef('feed', $feed);
     // Check language filter plugin
     $this->getModel('sef')->checkLanguagePlugins();
     parent::display($tpl);
 }
Example #2
0
 function getExtension()
 {
     // Load the data
     if (empty($this->_extension)) {
         $query = $this->_db->getQuery(true);
         $query->select('*')->from('#__extensions')->where('state>=0')->where('enabled=1')->where('type=' . $this->_db->quote('sef_ext'))->where('element=' . $this->_db->quote($this->_id));
         $this->_db->setQuery($query);
         $row = $this->_db->loadObject();
         if (is_null($row)) {
             $row = new stdClass();
         }
         $option = str_replace('ext_joomsef4_', 'com_', $this->_id);
         // Try to load language file for this extension
         $langFile = str_replace('com_', 'sef_ext_', $option);
         $lang = JFactory::getLanguage();
         $lang->load($langFile, JPATH_ADMINISTRATOR);
         $row->id = $this->_id;
         $row->description = '';
         $row->name = '';
         $row->version = '';
         $row->params =& SEFTools::getExtParams($option);
         $row->form =& SEFTools::getExtParamsForm($option);
         $row->option = $option;
         $xml = SEFTools::getExtXML($option);
         if ($xml) {
             $version = (string) $xml['version'];
             if ($xml->getName() == 'extension' && version_compare($version, '1.6', '>=') && (string) $xml['type'] == 'sef_ext') {
                 $element = $xml->description;
                 $row->description = $element ? trim((string) $element) : '';
                 $element = $xml->name;
                 $row->name = $element ? trim((string) $element) : '';
                 $element = $xml->version;
                 $row->version = $element ? trim((string) $element) : '';
             }
         }
         // Get the component for this extension
         $model = SEFModel::getInstance('Extensions', 'SEFModel');
         $row->component = $model->_getComponent($option);
         $this->_extension = $row;
     }
     return $this->_extension;
 }
Example #3
0
 function __construct()
 {
     parent::__construct();
     $this->_getVars();
 }
Example #4
0
 /**
  * Constructor that retrieves the ID from the request
  *
  * @access    public
  * @return    void
  */
 function __construct()
 {
     parent::__construct();
     $array = JRequest::getVar('cid', 0, '', 'array');
     $this->setId((int) $array[0]);
 }
Example #5
0
 /**
  * Constructor that retrieves variables from the request
  */
 function __construct()
 {
     parent::__construct();
 }
Example #6
0
 function _loadNewVersions()
 {
     if (isset($this->_newVersions)) {
         return;
     }
     $upgradeModel = SEFModel::getInstance('Upgrade', 'SEFModel');
     $this->_newVersions =& $upgradeModel->getVersions();
     /*echo "<pre>";
       print_r($this->_newVersions);
       echo "</pre>";
       exit;*/
 }