Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_templates
  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 class for a list of template styles.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_templates
  17.  * @since       1.6
  18.  */
  19. {
  20.     protected $items;
  21.  
  22.     protected $pagination;
  23.  
  24.     protected $state;
  25.  
  26.     /**
  27.      * Execute and display a template script.
  28.      *
  29.      * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  30.      *
  31.      * @return  mixed  A string if successful, otherwise a Error object.
  32.      */
  33.     public function display($tpl null)
  34.     {
  35.         $this->items      = $this->get('Items');
  36.         $this->pagination = $this->get('Pagination');
  37.         $this->state      = $this->get('State');
  38.         $this->preview    JComponentHelper::getParams('com_templates')->get('template_positions_display');
  39.  
  40.         TemplatesHelper::addSubmenu('styles');
  41.  
  42.         // Check for errors.
  43.         if (count($errors $this->get('Errors')))
  44.         {
  45.             JError::raiseError(500implode("\n"$errors));
  46.  
  47.             return false;
  48.         }
  49.  
  50.             // Check if there are no matching items
  51.         if (!count($this->items))
  52.         {
  53.             JFactory::getApplication()->enqueueMessage(
  54.                 JText::_('COM_TEMPLATES_MSG_MANAGE_NO_STYLES'),
  55.                 'warning'
  56.             );
  57.         }
  58.  
  59.         $this->addToolbar();
  60.         $this->sidebar JHtmlSidebar::render();
  61.  
  62.         return parent::display($tpl);
  63.     }
  64.  
  65.     /**
  66.      * Add the page title and toolbar.
  67.      *
  68.      * @return  void 
  69.      *
  70.      * @since   1.6
  71.      */
  72.     protected function addToolbar()
  73.     {
  74.         $canDo TemplatesHelper::getActions();
  75.  
  76.         JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES')'eye thememanager');
  77.  
  78.         if ($canDo->get('core.edit.state'))
  79.         {
  80.             JToolbarHelper::makeDefault('styles.setDefault''COM_TEMPLATES_TOOLBAR_SET_HOME');
  81.             JToolbarHelper::divider();
  82.         }
  83.  
  84.         if ($canDo->get('core.edit'))
  85.         {
  86.             JToolbarHelper::editList('style.edit');
  87.         }
  88.  
  89.         if ($canDo->get('core.create'))
  90.         {
  91.             JToolbarHelper::custom('styles.duplicate''copy.png''copy_f2.png''JTOOLBAR_DUPLICATE'true);
  92.             JToolbarHelper::divider();
  93.         }
  94.  
  95.         if ($canDo->get('core.delete'))
  96.         {
  97.             JToolbarHelper::deleteList('''styles.delete');
  98.             JToolbarHelper::divider();
  99.         }
  100.  
  101.         if ($canDo->get('core.admin'))
  102.         {
  103.             JToolbarHelper::preferences('com_templates');
  104.             JToolbarHelper::divider();
  105.         }
  106.  
  107.         JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
  108.  
  109.         JHtmlSidebar::setAction('index.php?option=com_templates&view=styles');
  110.  
  111.         JHtmlSidebar::addFilter(
  112.             JText::_('COM_TEMPLATES_FILTER_TEMPLATE'),
  113.             'filter_template',
  114.             JHtml::_(
  115.                 'select.options',
  116.                 TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')),
  117.                 'value',
  118.                 'text',
  119.                 $this->state->get('filter.template')
  120.             )
  121.         );
  122.  
  123.         JHtmlSidebar::addFilter(
  124.             JText::_('JGLOBAL_FILTER_CLIENT'),
  125.             'filter_client_id',
  126.             JHtml::_('select.options'TemplatesHelper::getClientOptions()'value''text'$this->state->get('filter.client_id'))
  127.         );
  128.     }
  129. }

Documentation generated on Tue, 19 Nov 2013 15:17:25 +0100 by phpDocumentor 1.4.3