Source for file languages.php

Documentation is available at languages.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Installation
  4.  * @subpackage  Controller
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Controller class to install additional languages for the Joomla Installer.
  14.  *
  15.  * @package     Joomla.Installation
  16.  * @subpackage  Controller
  17.  * @since       3.1
  18.  */
  19. {
  20.     /**
  21.      * Constructor.
  22.      *
  23.      * @since   3.1
  24.      */
  25.     public function __construct()
  26.     {
  27.         parent::__construct();
  28.  
  29.         // Overrides application config and set the configuration.php file so tokens and database works
  30.         JFactory::$config null;
  31.         JFactory::getConfig(JPATH_SITE '/configuration.php');
  32.         JFactory::$session null;
  33.     }
  34.  
  35.     /**
  36.      * Execute the controller.
  37.      *
  38.      * @return  void 
  39.      *
  40.      * @since   3.1
  41.      */
  42.     public function execute()
  43.     {
  44.         // Get the application
  45.         /* @var InstallationApplicationWeb $app */
  46.         $app $this->getApplication();
  47.  
  48.         // Check for request forgeries.
  49.         JSession::checkToken(or $app->sendJsonResponse(new Exception(JText::_('JINVALID_TOKEN')403));
  50.  
  51.         // Get array of selected languages
  52.         $lids $this->input->get('cid'array()'array');
  53.         JArrayHelper::toInteger($lidsarray());
  54.  
  55.         // Get the languages model.
  56.         $model new InstallationModelLanguages;
  57.  
  58.         if (!$lids)
  59.         {
  60.             // No languages have been selected
  61.             $app->enqueueMessage(JText::_('INSTL_LANGUAGES_NO_LANGUAGE_SELECTED'));
  62.         }
  63.         else
  64.         {
  65.             // Install selected languages
  66.             $model->install($lids);
  67.         }
  68.  
  69.         // Redirect to the page.
  70.         $r new stdClass;
  71.         $r->view 'defaultlanguage';
  72.         $app->sendJsonResponse($r);
  73.     }
  74. }

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