Source for file languages.php

Documentation is available at languages.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_installer
  5.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  6.  * @license     GNU General Public License, see LICENSE.php
  7.  */
  8.  
  9. defined('_JEXEC'or die;
  10.  
  11. /**
  12.  * Languages Installer Controller
  13.  *
  14.  * @package     Joomla.Administrator
  15.  * @subpackage  com_installer
  16.  * @since       2.5.7
  17.  */
  18. {
  19.     /**
  20.      * Finds new Languages.
  21.      *
  22.      * @return  void 
  23.      *
  24.      * @since   2.5.7
  25.      */
  26.     public function find()
  27.     {
  28.         // Purge the updates list
  29.         $model $this->getModel('update');
  30.         $model->purge();
  31.  
  32.         // Check for request forgeries
  33.         JSession::checkToken(or jexit(JText::_('JINVALID_TOKEN'));
  34.  
  35.         // Get the caching duration
  36.         $component JComponentHelper::getComponent('com_installer');
  37.         $params $component->params;
  38.         $cache_timeout $params->get('cachetimeout'6'int');
  39.         $cache_timeout 3600 $cache_timeout;
  40.  
  41.         // Find updates
  42.         $model    $this->getModel('languages');
  43.         $model->findLanguages($cache_timeout);
  44.  
  45.         $this->setRedirect(JRoute::_('index.php?option=com_installer&view=languages'false));
  46.     }
  47.  
  48.     /**
  49.      * Purge the updates list.
  50.      *
  51.      * @return  void 
  52.      *
  53.      * @since   2.5.7
  54.      */
  55.     public function purge()
  56.     {
  57.         // Check for request forgeries
  58.         JSession::checkToken(or jexit(JText::_('JINVALID_TOKEN'));
  59.  
  60.         // Purge updates
  61.         $model $this->getModel('update');
  62.         $model->purge();
  63.         $model->enableSites();
  64.         $this->setRedirect(JRoute::_('index.php?option=com_installer&view=languages'false)$model->_message);
  65.     }
  66.  
  67.     /**
  68.      * Install languages.
  69.      *
  70.      * @return  void 
  71.      *
  72.      * @since   2.5.7
  73.      */
  74.     public function install()
  75.     {
  76.         $model $this->getModel('languages');
  77.  
  78.         // Get array of selected languages
  79.         $lids $this->input->get('cid'array()'array');
  80.         JArrayHelper::toInteger($lidsarray());
  81.  
  82.         if (!$lids)
  83.         {
  84.             // No languages have been selected
  85.             $app JFactory::getApplication();
  86.             $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_DISCOVER_NOEXTENSIONSELECTED'));
  87.         }
  88.         else
  89.         {
  90.             // Install selected languages
  91.             $model->install($lids);
  92.         }
  93.  
  94.         $this->setRedirect(JRoute::_('index.php?option=com_installer&view=languages'false));
  95.     }
  96. }

Documentation generated on Tue, 19 Nov 2013 15:06:36 +0100 by phpDocumentor 1.4.3