Joomla! PHP Cross Reference Web Portals

Source: /administrator/components/com_templates/views/styles/view.html.php - 109 lines - 2908 bytes - Summary - Text - Print

   1  <?php
   2  /**
   3   * @package     Joomla.Administrator
   4   * @subpackage  com_templates
   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   * View class for a list of template styles.
  14   *
  15   * @package     Joomla.Administrator
  16   * @subpackage  com_templates
  17   * @since       1.6
  18   */
  19  class TemplatesViewStyles 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          $this->preview        = JComponentHelper::getParams('com_templates')->get('template_positions_display');
  36  
  37          TemplatesHelper::addSubmenu('styles');
  38  
  39          // Check for errors.
  40          if (count($errors = $this->get('Errors'))) {
  41              JError::raiseError(500, implode("\n", $errors));
  42              return false;
  43          }
  44  
  45              // Check if there are no matching items
  46          if(!count($this->items)) {
  47              JFactory::getApplication()->enqueueMessage(
  48                  JText::_('COM_TEMPLATES_MSG_MANAGE_NO_STYLES'),
  49                  'warning'
  50              );
  51          }
  52  
  53          $this->addToolbar();
  54          $this->sidebar = JHtmlSidebar::render();
  55          parent::display($tpl);
  56      }
  57  
  58      /**
  59       * Add the page title and toolbar.
  60       *
  61       * @since    1.6
  62       */
  63  	protected function addToolbar()
  64      {
  65          $state    = $this->get('State');
  66          $canDo    = TemplatesHelper::getActions();
  67          $isSite    = ($state->get('filter.client_id') == 0);
  68  
  69          JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'thememanager');
  70  
  71          if ($canDo->get('core.edit.state')) {
  72              JToolbarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
  73              JToolbarHelper::divider();
  74          }
  75  
  76          if ($canDo->get('core.edit')) {
  77              JToolbarHelper::editList('style.edit');
  78          }
  79          if ($canDo->get('core.create')) {
  80              JToolbarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
  81              JToolbarHelper::divider();
  82          }
  83  
  84          if ($canDo->get('core.delete')) {
  85              JToolbarHelper::deleteList('', 'styles.delete');
  86              JToolbarHelper::divider();
  87          }
  88  
  89          if ($canDo->get('core.admin')) {
  90              JToolbarHelper::preferences('com_templates');
  91              JToolbarHelper::divider();
  92          }
  93          JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
  94  
  95          JHtmlSidebar::setAction('index.php?option=com_templates&view=styles');
  96  
  97          JHtmlSidebar::addFilter(
  98              JText::_('COM_TEMPLATES_FILTER_TEMPLATE'),
  99              'filter_template',
 100              JHtml::_('select.options', TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.template'))
 101          );
 102  
 103          JHtmlSidebar::addFilter(
 104              JText::_('JGLOBAL_FILTER_CLIENT'),
 105              'filter_client_id',
 106              JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'))
 107          );
 108      }
 109  }

title

Description

title

Description

title

Description

title

title

Body