Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_languages
  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 language overrides list
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_languages
  17.  * @since       2.5
  18.  */
  19. {
  20.     /**
  21.      * The items to list
  22.      *
  23.      * @var        array 
  24.      * @since    2.5
  25.      */
  26.     protected $items;
  27.  
  28.     /**
  29.      * The pagination object
  30.      *
  31.      * @var        object 
  32.      * @since    2.5
  33.      */
  34.     protected $pagination;
  35.  
  36.     /**
  37.      * The model state
  38.      *
  39.      * @var        object 
  40.      * @since    2.5
  41.      */
  42.     protected $state;
  43.  
  44.     /**
  45.      * Displays the view
  46.      *
  47.      * @param       string    $tpl    The name of the template file to parse
  48.      *
  49.      * @return  void 
  50.      *
  51.      * @since        2.5
  52.      */
  53.     public function display($tpl null)
  54.     {
  55.         $this->state      = $this->get('State');
  56.         $this->items      = $this->get('Overrides');
  57.         $this->languages  $this->get('Languages');
  58.         $this->pagination = $this->get('Pagination');
  59.  
  60.         LanguagesHelper::addSubmenu('overrides');
  61.  
  62.         // Check for errors
  63.         if (count($errors $this->get('Errors')))
  64.         {
  65.             throw new Exception(implode("\n"$errors));
  66.         }
  67.  
  68.         $this->addToolbar();
  69.         parent::display($tpl);
  70.     }
  71.  
  72.     /**
  73.      * Adds the page title and toolbar
  74.      *
  75.      * @return  void 
  76.      *
  77.      * @since        2.5
  78.      */
  79.     protected function addToolbar()
  80.     {
  81.         // Get the results for each action
  82.         $canDo LanguagesHelper::getActions();
  83.  
  84.         JToolbarHelper::title(JText::_('COM_LANGUAGES_VIEW_OVERRIDES_TITLE')'comments-2 langmanager');
  85.  
  86.         if ($canDo->get('core.create'))
  87.         {
  88.             JToolbarHelper::addNew('override.add');
  89.         }
  90.  
  91.         if ($canDo->get('core.edit'&& $this->pagination->total)
  92.         {
  93.             JToolbarHelper::editList('override.edit');
  94.         }
  95.  
  96.         if ($canDo->get('core.delete'&& $this->pagination->total)
  97.         {
  98.             JToolbarHelper::deleteList('''overrides.delete');
  99.         }
  100.  
  101.         if ($canDo->get('core.admin'))
  102.         {
  103.             JToolbarHelper::preferences('com_languages');
  104.         }
  105.         JToolbarHelper::divider();
  106.         JToolbarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_OVERRIDES');
  107.  
  108.         JHtmlSidebar::setAction('index.php?option=com_languages&view=overrides');
  109.  
  110.         JHtmlSidebar::addFilter(
  111.             // @todo need a label here
  112.             '',
  113.             'filter_language_client',
  114.             JHtml::_('select.options'$this->languagesnull'text'$this->state->get('filter.language_client')),
  115.             true
  116.         );
  117.  
  118.         $this->sidebar JHtmlSidebar::render();
  119.     }
  120. }

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