Пример #1
0
 /**
  * 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));
 }