/** * Get Update information */ public static function getUpdate() { require_once JPATH_BASE . "/components/com_installer/models/update.php"; $model = new InstallerModelUpdate(); $items = $model->getItems(); if (is_array($items)) { foreach ($items as $item) { if ($item->name == "JDeveloper") { return $item; } } } return null; }
/** * Finds new Languages. * * @return void * * @since 2.5.7 */ public function find() { require_once JPATH_ADMINISTRATOR . '/components/com_installer/models/update.php'; // Purge the updates list $config = array(); $model = new InstallerModelUpdate($config); $model->purge(); // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Get the caching duration $params = JComponentHelper::getParams('com_installer'); $cache_timeout = $params->get('cachetimeout', 6, 'int'); $cache_timeout = 3600 * $cache_timeout; // Find updates $updater = JUpdater::getInstance(); /* * The following function uses extension_id 600, that is the english language extension id. * In #__update_sites_extensions you should have 600 linked to the Accredited Translations Repo */ $updater->findUpdates(array(600), $cache_timeout); $this->setRedirect(JRoute::_('index.php?option=com_jalang&view=tool', false)); }
/** * Updates an extension * * @param $extensionId */ public function doUpdate($extensionId) { require JPATH_BASE . '/administrator/components/com_installer/models/update.php'; $model = new InstallerModelUpdate(); if ($res = $model->update(array($extensionId))) { $cache = JFactory::getCache('mod_menu'); $cache->clean(); } return $model->getState('result'); }
function __construct() { parent::__construct(); }