Source for file json.php

Documentation is available at json.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_config
  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.  * View for the component configuration
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_config
  17.  * @since       3.2
  18.  */
  19. {
  20.     public $state;
  21.  
  22.     public $data;
  23.  
  24.     /**
  25.      * Display the view
  26.      *
  27.      * @return  string  The rendered view.
  28.      *
  29.      * @since   3.2
  30.      */
  31.     public function render()
  32.     {
  33.         try
  34.         {
  35.             $this->data = $this->model->getData();
  36.             $user JFactory::getUser();
  37.         }
  38.         catch (Exception $e)
  39.         {
  40.             JFactory::getApplication()->enqueueMessage($e->getMessage()'error');
  41.  
  42.             return false;
  43.         }
  44.  
  45.         $this->userIsSuperAdmin $user->authorise('core.admin');
  46.  
  47.         // Required data
  48.         $requiredData array(
  49.             "sitename"            => null,
  50.             "offline"             => null,
  51.             "access"              => null,
  52.             "list_limit"          => null,
  53.             "MetaDesc"            => null,
  54.             "MetaKeys"            => null,
  55.             "MetaRights"          => null,
  56.             "sef"                 => null,
  57.             "sitename_pagetitles" => null,
  58.             "debug"               => null,
  59.             "debug_lang"          => null,
  60.             "error_reporting"     => null,
  61.             "mailfrom"            => null,
  62.             "fromname"            => null
  63.         );
  64.  
  65.         $this->data = array_intersect_key($this->data$requiredData);
  66.  
  67.         return json_encode($this->data);
  68.     }
  69. }

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