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.     /**
  21.      * @var        array 
  22.      * @since   1.6
  23.      */
  24.     protected $items;
  25.  
  26.     /**
  27.      * @var        object 
  28.      * @since   1.6
  29.      */
  30.     protected $pagination;
  31.  
  32.     /**
  33.      * @var        object 
  34.      * @since   1.6
  35.      */
  36.     protected $state;
  37.  
  38.     /**
  39.      * @var        string 
  40.      * @since   3.2
  41.      */
  42.     protected $file;
  43.  
  44.     /**
  45.      * Execute and display a template script.
  46.      *
  47.      * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  48.      *
  49.      * @return  mixed  A string if successful, otherwise a Error object.
  50.      *
  51.      * @since   1.6
  52.      */
  53.     public function display($tpl null)
  54.     {
  55.         $this->items      = $this->get('Items');
  56.         $this->pagination = $this->get('Pagination');
  57.         $this->state      = $this->get('State');
  58.         $this->preview    JComponentHelper::getParams('com_templates')->get('template_positions_display');
  59.         $this->file       = base64_encode('home');
  60.  
  61.         TemplatesHelper::addSubmenu('templates');
  62.  
  63.         // Check for errors.
  64.         if (count($errors $this->get('Errors')))
  65.         {
  66.             JError::raiseError(500implode("\n"$errors));
  67.  
  68.             return false;
  69.         }
  70.  
  71.         // Check if there are no matching items
  72.         if (!count($this->items))
  73.         {
  74.             JFactory::getApplication()->enqueueMessage(
  75.                 JText::_('COM_TEMPLATES_MSG_MANAGE_NO_TEMPLATES'),
  76.                 'warning'
  77.             );
  78.         }
  79.  
  80.         $this->addToolbar();
  81.         return parent::display($tpl);
  82.     }
  83.  
  84.     /**
  85.      * Add the page title and toolbar.
  86.      *
  87.      * @return  void 
  88.      *
  89.      * @since   1.6
  90.      */
  91.     protected function addToolbar()
  92.     {
  93.         $canDo TemplatesHelper::getActions();
  94.  
  95.         JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_TEMPLATES')'eye thememanager');
  96.  
  97.         if ($canDo->get('core.admin'))
  98.         {
  99.             JToolbarHelper::preferences('com_templates');
  100.             JToolbarHelper::divider();
  101.         }
  102.  
  103.         JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES');
  104.  
  105.         JHtmlSidebar::setAction('index.php?option=com_templates&view=templates');
  106.  
  107.         JHtmlSidebar::addFilter(
  108.             JText::_('JGLOBAL_FILTER_CLIENT'),
  109.             'filter_client_id',
  110.             JHtml::_('select.options'TemplatesHelper::getClientOptions()'value''text'$this->state->get('filter.client_id'))
  111.         );
  112.  
  113.         $this->sidebar JHtmlSidebar::render();
  114.     }
  115. }

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