Joomla! PHP Cross Reference Web Portals

Source: /administrator/components/com_languages/views/languages/view.html.php - 111 lines - 3016 bytes - Summary - Text - Print

   1  <?php
   2  /**
   3   * @package     Joomla.Administrator
   4   * @subpackage  com_languages
   5   *
   6   * @copyright   Copyright (C) 2005 - 2012 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   * HTML Languages View class for the Languages component
  14   *
  15   * @package     Joomla.Administrator
  16   * @subpackage  com_languages
  17   * @since       1.6
  18   */
  19  class LanguagesViewLanguages extends JViewLegacy
  20  {
  21      protected $items;
  22  
  23      protected $pagination;
  24  
  25      protected $state;
  26  
  27      /**
  28       * Display the view
  29       */
  30  	public function display($tpl = null)
  31      {
  32          $this->items        = $this->get('Items');
  33          $this->pagination    = $this->get('Pagination');
  34          $this->state        = $this->get('State');
  35  
  36          LanguagesHelper::addSubmenu('languages');
  37  
  38          // Check for errors.
  39          if (count($errors = $this->get('Errors'))) {
  40              JError::raiseError(500, implode("\n", $errors));
  41              return false;
  42          }
  43  
  44          $this->addToolbar();
  45          $this->sidebar = JHtmlSidebar::render();
  46          parent::display($tpl);
  47      }
  48  
  49      /**
  50       * Add the page title and toolbar.
  51       *
  52       * @since    1.6
  53       */
  54  	protected function addToolbar()
  55      {
  56          require_once  JPATH_COMPONENT.'/helpers/languages.php';
  57          $canDo    = LanguagesHelper::getActions();
  58  
  59          JToolbarHelper::title(JText::_('COM_LANGUAGES_VIEW_LANGUAGES_TITLE'), 'langmanager.png');
  60  
  61          if ($canDo->get('core.create')) {
  62              JToolbarHelper::addNew('language.add');
  63          }
  64  
  65          if ($canDo->get('core.edit')) {
  66              JToolbarHelper::editList('language.edit');
  67              JToolbarHelper::divider();
  68          }
  69  
  70          if ($canDo->get('core.edit.state')) {
  71              if ($this->state->get('filter.published') != 2) {
  72                  JToolbarHelper::publishList('languages.publish');
  73                  JToolbarHelper::unpublishList('languages.unpublish');
  74              }
  75          }
  76  
  77          if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
  78              JToolbarHelper::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH');
  79              JToolbarHelper::divider();
  80          } elseif ($canDo->get('core.edit.state')) {
  81              JToolbarHelper::trash('languages.trash');
  82              JToolbarHelper::divider();
  83          }
  84  
  85          if ($canDo->get('core.admin')) {
  86              // Add install languages link to the lang installer component
  87              $bar = JToolbar::getInstance('toolbar');
  88              $bar->appendButton('Link', 'upload', 'COM_LANGUAGES_INSTALL', 'index.php?option=com_installer&view=languages');
  89              JToolbarHelper::divider();
  90  
  91              JToolbarHelper::preferences('com_languages');
  92              JToolbarHelper::divider();
  93          }
  94  
  95          JToolbarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_CONTENT');
  96  
  97          JHtmlSidebar::setAction('index.php?option=com_languages&view=languages');
  98  
  99          JHtmlSidebar::addFilter(
 100              JText::_('JOPTION_SELECT_PUBLISHED'),
 101              'filter_published',
 102              JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
 103          );
 104  
 105          JHtmlSidebar::addFilter(
 106              JText::_('JOPTION_SELECT_ACCESS'),
 107              'filter_access',
 108              JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
 109          );
 110      }
 111  }

title

Description

title

Description

title

Description

title

title

Body