[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/administrator/components/com_installer/views/manage/ -> view.html.php (source)

   1  <?php
   2  /**
   3   * @package        Joomla.Administrator
   4   * @subpackage    com_installer
   5   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   6   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   7   */
   8  
   9  // No direct access.
  10  defined('_JEXEC') or die;
  11  
  12  include_once dirname(__FILE__).'/../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  class InstallerViewManage extends InstallerViewDefault
  22  {
  23      protected $items;
  24      protected $pagination;
  25      protected $form;
  26      protected $state;
  27  
  28      /**
  29       * @since    1.6
  30       */
  31  	function display($tpl=null)
  32      {
  33          // Get data from the model
  34          $this->state        = $this->get('State');
  35          $this->items        = $this->get('Items');
  36          $this->pagination    = $this->get('Pagination');
  37          $this->form            = $this->get('Form');
  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_INSTALLER_MSG_MANAGE_NOEXTENSION')
  49                  , 'warning'
  50              );
  51          }
  52  
  53          // Include the component HTML helpers.
  54          JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
  55  
  56          // Display the view
  57          parent::display($tpl);
  58      }
  59  
  60      /**
  61       * Add the page title and toolbar.
  62       *
  63       * @since    1.6
  64       */
  65  	protected function addToolbar()
  66      {
  67          $canDo    = InstallerHelper::getActions();
  68          if ($canDo->get('core.edit.state')) {
  69              JToolBarHelper::publish('manage.publish', 'JTOOLBAR_ENABLE', true);
  70              JToolBarHelper::unpublish('manage.unpublish', 'JTOOLBAR_DISABLE', true);
  71              JToolBarHelper::divider();
  72          }
  73          JToolBarHelper::custom('manage.refresh', 'refresh', 'refresh', 'JTOOLBAR_REFRESH_CACHE', true);
  74          JToolBarHelper::divider();
  75          if ($canDo->get('core.delete')) {
  76              JToolBarHelper::deleteList('', 'manage.remove', 'JTOOLBAR_UNINSTALL');
  77              JToolBarHelper::divider();
  78          }
  79          parent::addToolbar();
  80          JToolBarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_MANAGE');
  81      }
  82  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1