Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_users
  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 user groups.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_users
  17.  * @since       1.6
  18.  */
  19. class UsersViewGroups extends JViewLegacy
  20. {
  21.     protected $items;
  22.  
  23.     protected $pagination;
  24.  
  25.     protected $state;
  26.  
  27.     /**
  28.      * Display the view
  29.      */
  30.     public function display($tpl null)
  31.     {
  32.         $this->items        = $this->get('Items');
  33.         $this->pagination    = $this->get('Pagination');
  34.         $this->state        = $this->get('State');
  35.  
  36.         UsersHelper::addSubmenu('groups');
  37.  
  38.         // Check for errors.
  39.         if (count($errors $this->get('Errors')))
  40.         {
  41.             JError::raiseError(500implode("\n"$errors));
  42.             return false;
  43.         }
  44.  
  45.         $this->addToolbar();
  46.         $this->sidebar JHtmlSidebar::render();
  47.         parent::display($tpl);
  48.     }
  49.  
  50.     /**
  51.      * Add the page title and toolbar.
  52.      *
  53.      * @since   1.6
  54.      */
  55.     protected function addToolbar()
  56.     {
  57.         $canDo    UsersHelper::getActions();
  58.  
  59.         JToolbarHelper::title(JText::_('COM_USERS_VIEW_GROUPS_TITLE')'users groups');
  60.  
  61.         if ($canDo->get('core.create'))
  62.         {
  63.             JToolbarHelper::addNew('group.add');
  64.         }
  65.         if ($canDo->get('core.edit'))
  66.         {
  67.             JToolbarHelper::editList('group.edit');
  68.             JToolbarHelper::divider();
  69.         }
  70.         if ($canDo->get('core.delete'))
  71.         {
  72.             JToolbarHelper::deleteList('''groups.delete');
  73.             JToolbarHelper::divider();
  74.         }
  75.  
  76.         if ($canDo->get('core.admin'))
  77.         {
  78.             JToolbarHelper::preferences('com_users');
  79.             JToolbarHelper::divider();
  80.         }
  81.         JToolbarHelper::help('JHELP_USERS_GROUPS');
  82.     }
  83.  
  84.     /**
  85.      * Returns an array of fields the table can be sorted by
  86.      *
  87.      * @return  array  Array containing the field name to sort by as the key and display text as value
  88.      *
  89.      * @since   3.0
  90.      */
  91.     protected function getSortFields()
  92.     {
  93.         return array(
  94.                 'a.title' => JText::_('COM_USERS_HEADING_GROUP_TITLE'),
  95.                 'a.id' => JText::_('JGRID_HEADING_ID')
  96.         );
  97.     }
  98. }

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