Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_plugins
  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 plugins.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_plugins
  17.  * @since       1.5
  18.  */
  19. {
  20.     protected $items;
  21.  
  22.     protected $pagination;
  23.  
  24.     protected $state;
  25.  
  26.     /**
  27.      * Display the view
  28.      */
  29.     public function display($tpl null)
  30.     {
  31.         $this->items      = $this->get('Items');
  32.         $this->pagination = $this->get('Pagination');
  33.         $this->state      = $this->get('State');
  34.  
  35.         // Check for errors.
  36.         if (count($errors $this->get('Errors')))
  37.         {
  38.             JError::raiseError(500implode("\n"$errors));
  39.             return false;
  40.         }
  41.  
  42.         // Check if there are no matching items
  43.         if (!count($this->items))
  44.         {
  45.             JFactory::getApplication()->enqueueMessage(
  46.                 JText::_('COM_PLUGINS_MSG_MANAGE_NO_PLUGINS'),
  47.                 'warning'
  48.             );
  49.         }
  50.  
  51.         $this->addToolbar();
  52.         parent::display($tpl);
  53.     }
  54.  
  55.     /**
  56.      * Add the page title and toolbar.
  57.      *
  58.      * @since   1.6
  59.      */
  60.     protected function addToolbar()
  61.     {
  62.         $canDo PluginsHelper::getActions();
  63.  
  64.         JToolbarHelper::title(JText::_('COM_PLUGINS_MANAGER_PLUGINS')'power-cord plugin');
  65.  
  66.         if ($canDo->get('core.edit'))
  67.         {
  68.             JToolbarHelper::editList('plugin.edit');
  69.         }
  70.  
  71.         if ($canDo->get('core.edit.state'))
  72.         {
  73.             JToolbarHelper::publish('plugins.publish''JTOOLBAR_ENABLE'true);
  74.             JToolbarHelper::unpublish('plugins.unpublish''JTOOLBAR_DISABLE'true);
  75.             JToolbarHelper::checkin('plugins.checkin');
  76.         }
  77.  
  78.         if ($canDo->get('core.admin'))
  79.         {
  80.             JToolbarHelper::preferences('com_plugins');
  81.         }
  82.  
  83.         JToolbarHelper::help('JHELP_EXTENSIONS_PLUGIN_MANAGER');
  84.  
  85.         JHtmlSidebar::setAction('index.php?option=com_plugins&view=plugins');
  86.  
  87.         JHtmlSidebar::addFilter(
  88.                 JText::_('JOPTION_SELECT_PUBLISHED'),
  89.                 'filter_enabled',
  90.                 JHtml::_('select.options'PluginsHelper::publishedOptions()'value''text'$this->state->get('filter.enabled')true)
  91.         );
  92.  
  93.         JHtmlSidebar::addFilter(
  94.                 JText::_('COM_PLUGINS_OPTION_FOLDER'),
  95.                 'filter_folder',
  96.                 JHtml::_('select.options'PluginsHelper::folderOptions()'value''text'$this->state->get('filter.folder'))
  97.         );
  98.  
  99.         JHtmlSidebar::addFilter(
  100.                 JText::_('JOPTION_SELECT_ACCESS'),
  101.                 'filter_access',
  102.                 JHtml::_('select.options'JHtml::_('access.assetgroups')'value''text'$this->state->get('filter.access'))
  103.         );
  104.  
  105.         $this->sidebar JHtmlSidebar::render();
  106.  
  107.     }
  108.  
  109.     /**
  110.      * Returns an array of fields the table can be sorted by
  111.      *
  112.      * @return  array  Array containing the field name to sort by as the key and display text as value
  113.      *
  114.      * @since   3.0
  115.      */
  116.     protected function getSortFields()
  117.     {
  118.         return array(
  119.                 'ordering' => JText::_('JGRID_HEADING_ORDERING'),
  120.                 'a.state' => JText::_('JSTATUS'),
  121.                 'name' => JText::_('JGLOBAL_TITLE'),
  122.                 'folder' => JText::_('COM_PLUGINS_FOLDER_HEADING'),
  123.                 'element' => JText::_('COM_PLUGINS_ELEMENT_HEADING'),
  124.                 'access' => JText::_('JGRID_HEADING_ACCESS'),
  125.                 'extension_id' => JText::_('JGRID_HEADING_ID')
  126.         );
  127.     }
  128. }

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