[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_users/src/View/Debuggroup/ -> HtmlView.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_users
   6   *
   7   * @copyright   (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Users\Administrator\View\Debuggroup;
  12  
  13  use Joomla\CMS\Access\Exception\NotAllowed;
  14  use Joomla\CMS\Helper\ContentHelper;
  15  use Joomla\CMS\Language\Text;
  16  use Joomla\CMS\MVC\View\GenericDataException;
  17  use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
  18  use Joomla\CMS\Object\CMSObject;
  19  use Joomla\CMS\Toolbar\ToolbarHelper;
  20  
  21  // phpcs:disable PSR1.Files.SideEffects
  22  \defined('_JEXEC') or die;
  23  // phpcs:enable PSR1.Files.SideEffects
  24  
  25  /**
  26   * View class for a list of User Group ACL permissions.
  27   *
  28   * @since  1.6
  29   */
  30  class HtmlView extends BaseHtmlView
  31  {
  32      /**
  33       * List of component actions
  34       *
  35       * @var  array
  36       */
  37      protected $actions;
  38  
  39      /**
  40       * The item data.
  41       *
  42       * @var   object
  43       * @since 1.6
  44       */
  45      protected $items;
  46  
  47      /**
  48       * The pagination object.
  49       *
  50       * @var   \Joomla\CMS\Pagination\Pagination
  51       * @since 1.6
  52       */
  53      protected $pagination;
  54  
  55      /**
  56       * The model state.
  57       *
  58       * @var   CMSObject
  59       * @since 1.6
  60       */
  61      protected $state;
  62  
  63      /**
  64       * The id and title for the user group.
  65       *
  66       * @var   \stdClass
  67       * @since 4.0.0
  68       */
  69      protected $group;
  70  
  71      /**
  72       * Form object for search filters
  73       *
  74       * @var  \Joomla\CMS\Form\Form
  75       */
  76      public $filterForm;
  77  
  78      /**
  79       * The active search filters
  80       *
  81       * @var  array
  82       */
  83      public $activeFilters;
  84  
  85      /**
  86       * Display the view
  87       *
  88       * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  89       *
  90       * @return  void
  91       */
  92      public function display($tpl = null)
  93      {
  94          // Access check.
  95          if (!$this->getCurrentUser()->authorise('core.manage', 'com_users')) {
  96              throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
  97          }
  98  
  99          $this->actions       = $this->get('DebugActions');
 100          $this->items         = $this->get('Items');
 101          $this->pagination    = $this->get('Pagination');
 102          $this->state         = $this->get('State');
 103          $this->group         = $this->get('Group');
 104          $this->filterForm    = $this->get('FilterForm');
 105          $this->activeFilters = $this->get('ActiveFilters');
 106  
 107          // Check for errors.
 108          if (count($errors = $this->get('Errors'))) {
 109              throw new GenericDataException(implode("\n", $errors), 500);
 110          }
 111  
 112          $this->addToolbar();
 113  
 114          parent::display($tpl);
 115      }
 116  
 117      /**
 118       * Add the page title and toolbar.
 119       *
 120       * @return  void
 121       *
 122       * @since   1.6
 123       */
 124      protected function addToolbar()
 125      {
 126          $canDo = ContentHelper::getActions('com_users');
 127  
 128          ToolbarHelper::title(Text::sprintf('COM_USERS_VIEW_DEBUG_GROUP_TITLE', $this->group->id, $this->escape($this->group->title)), 'users groups');
 129          ToolbarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE');
 130  
 131          if ($canDo->get('core.admin') || $canDo->get('core.options')) {
 132              ToolbarHelper::preferences('com_users');
 133              ToolbarHelper::divider();
 134          }
 135  
 136          ToolbarHelper::help('Permissions_for_Group');
 137      }
 138  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer