Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_installer
  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. include_once __DIR__ . '/../default/view.php';
  13.  
  14. /**
  15.  * Extension Manager Manage View
  16.  *
  17.  * @package     Joomla.Administrator
  18.  * @subpackage  com_installer
  19.  * @since       1.6
  20.  */
  21. {
  22.     protected $items;
  23.  
  24.     protected $pagination;
  25.  
  26.     protected $form;
  27.  
  28.     protected $state;
  29.  
  30.     /**
  31.      * Display the view
  32.      *
  33.      * @param   string  $tpl  Template
  34.      *
  35.      * @return  mixed|void
  36.      *
  37.      * @since   1.6
  38.      */
  39.     public function display($tpl = null)
  40.     {
  41.         // Get data from the model
  42.         $this->state      = $this->get('State');
  43.         $this->items      = $this->get('Items');
  44.         $this->pagination = $this->get('Pagination');
  45.  
  46.         // Check for errors.
  47.         if (count($errors = $this->get('Errors')))
  48.         {
  49.             JError::raiseError(500, implode("\n", $errors));
  50.             return false;
  51.         }
  52.  
  53.         // Check if there are no matching items
  54.         if (!count($this->items))
  55.         {
  56.             JFactory::getApplication()->enqueueMessage(
  57.                 JText::_('COM_INSTALLER_MSG_MANAGE_NOEXTENSION'),
  58.                 'warning'
  59.             );
  60.         }
  61.  
  62.         // Include the component HTML helpers.
  63.         JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
  64.  
  65.         // Display the view
  66.         parent::display($tpl);
  67.     }
  68.  
  69.     /**
  70.      * Add the page title and toolbar.
  71.      *
  72.      * @return  void 
  73.      *
  74.      * @since   1.6
  75.      */
  76.     protected function addToolbar()
  77.     {
  78.         $canDo    = InstallerHelper::getActions();
  79.         if ($canDo->get('core.edit.state'))
  80.         {
  81.             JToolbarHelper::publish('manage.publish', 'JTOOLBAR_ENABLE', true);
  82.             JToolbarHelper::unpublish('manage.unpublish', 'JTOOLBAR_DISABLE', true);
  83.             JToolbarHelper::divider();
  84.         }
  85.         JToolbarHelper::custom('manage.refresh', 'refresh', 'refresh', 'JTOOLBAR_REFRESH_CACHE', true);
  86.         JToolbarHelper::divider();
  87.         if ($canDo->get('core.delete'))
  88.         {
  89.             JToolbarHelper::deleteList('', 'manage.remove', 'JTOOLBAR_UNINSTALL');
  90.             JToolbarHelper::divider();
  91.         }
  92.  
  93.         JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_MANAGE');
  94.  
  95.         JHtmlSidebar::setAction('index.php?option=com_installer&view=manage');
  96.  
  97.         JHtmlSidebar::addFilter(
  98.             JText::_('COM_INSTALLER_VALUE_CLIENT_SELECT'),
  99.             'filter_client_id',
  100.             JHtml::_('select.options', array('0' => 'JSITE', '1' => 'JADMINISTRATOR'), 'value', 'text', $this->state->get('filter.client_id'), true)
  101.         );
  102.  
  103.         JHtmlSidebar::addFilter(
  104.             JText::_('COM_INSTALLER_VALUE_STATE_SELECT'),
  105.             'filter_status',
  106.             JHtml::_('select.options', array('0' => 'JDISABLED', '1' => 'JENABLED', '2' => 'JPROTECTED', '3' => 'JUNPROTECTED'), 'value', 'text', $this->state->get('filter.status'), true)
  107.         );
  108.  
  109.         JHtmlSidebar::addFilter(
  110.             JText::_('COM_INSTALLER_VALUE_TYPE_SELECT'),
  111.             'filter_type',
  112.             JHtml::_('select.options', InstallerHelper::getExtensionTypes(), 'value', 'text', $this->state->get('filter.type'), true)
  113.         );
  114.  
  115.         JHtmlSidebar::addFilter(
  116.             JText::_('COM_INSTALLER_VALUE_FOLDER_SELECT'),
  117.             'filter_group',
  118.             JHtml::_('select.options', array_merge(InstallerHelper::getExtensionGroupes(), array('*' => JText::_('COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE'))), 'value', 'text', $this->state->get('filter.group'), true)
  119.         );
  120.  
  121.         parent::addToolbar();
  122.     }
  123. }

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