Пример #1
0
 public function display($tpl = null)
 {
     // Fetch common objects from JFactory
     $application =& JFactory::getApplication();
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $document =& JFactory::getDocument();
     $data = JApplicationHelper::parseXMLInstallFile(JPATH_COMPONENT . '/simplelists.xml');
     require_once JPATH_COMPONENT . '/helpers/update.php';
     $update = SimplelistsUpdate::getUpdate($data['authorUrl']);
     $this->assignRef('data', $data);
     $this->assignRef('update', $update);
     parent::display($tpl);
 }
Пример #2
0
 /**
  * Method to get the title of the specified link type
  *
  * @access public
  * @param int ID of link type
  * @return string Title of link type
  */
 public function getUpdate($url)
 {
     $update = array('name' => '', 'version' => '', 'install' => '');
     if (empty($url)) {
         $url = 'https://www.yireo.com/documents/simplelists.xml';
     }
     $content = SimplelistsUpdate::getRemote($url);
     if (empty($content)) {
         return $update;
     }
     $xml =& JFactory::getXMLParser('Simple');
     if (!$xml->loadString($content)) {
         return $update;
     }
     $update['name'] = $xml->document->name[0]->data();
     $update['version'] = $xml->document->version[0]->data();
     $update['install'] = $xml->document->install[0]->data();
     return $update;
 }