/administrator/components/com_users/views/debuggroup/view.html.php

https://bitbucket.org/eternaware/joomus · PHP · 89 lines · 51 code · 15 blank · 23 comment · 2 complexity · b4ca4ed8a83b8323bb7efb4a51584ca4 MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage com_users
  5. *
  6. * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. defined('_JEXEC') or die;
  10. /**
  11. * View class for a list of users.
  12. *
  13. * @package Joomla.Administrator
  14. * @subpackage com_users
  15. * @since 1.6
  16. */
  17. class UsersViewDebugGroup extends JViewLegacy
  18. {
  19. protected $actions;
  20. protected $items;
  21. protected $pagination;
  22. protected $state;
  23. /**
  24. * Display the view
  25. */
  26. public function display($tpl = null)
  27. {
  28. $this->actions = $this->get('DebugActions');
  29. $this->items = $this->get('Items');
  30. $this->pagination = $this->get('Pagination');
  31. $this->state = $this->get('State');
  32. $this->group = $this->get('Group');
  33. $this->levels = UsersHelperDebug::getLevelsOptions();
  34. $this->components = UsersHelperDebug::getComponents();
  35. // Check for errors.
  36. if (count($errors = $this->get('Errors'))) {
  37. JError::raiseError(500, implode("\n", $errors));
  38. return false;
  39. }
  40. $this->addToolbar();
  41. parent::display($tpl);
  42. }
  43. /**
  44. * Add the page title and toolbar.
  45. *
  46. * @since 1.6
  47. */
  48. protected function addToolbar()
  49. {
  50. JToolbarHelper::title(JText::sprintf('COM_USERS_VIEW_DEBUG_GROUP_TITLE', $this->group->id, $this->group->title), 'groups');
  51. JToolbarHelper::help('JHELP_USERS_DEBUG_GROUPS');
  52. JSubMenuHelper::setAction('index.php?option=com_users&view=debuggroup&user_id=' . (int) $this->state->get('filter.user_id'));
  53. $option = '';
  54. if (!empty($this->components))
  55. {
  56. $option = JHtml::_('select.options', $this->components, 'value', 'text', $this->state->get('filter.component'));
  57. }
  58. JSubMenuHelper::addFilter(
  59. JText::_('COM_USERS_OPTION_SELECT_COMPONENT'),
  60. 'filter_component',
  61. $option
  62. );
  63. JSubMenuHelper::addFilter(
  64. JText::_('COM_USERS_OPTION_SELECT_LEVEL_START'),
  65. 'filter_level_start',
  66. JHtml::_('select.options', $this->levels, 'value', 'text', $this->state->get('filter.level_start'))
  67. );
  68. JSubMenuHelper::addFilter(
  69. JText::_('COM_USERS_OPTION_SELECT_LEVEL_END'),
  70. 'filter_level_end',
  71. JHtml::_('select.options', $this->levels, 'value', 'text', $this->state->get('filter.level_end'))
  72. );
  73. }
  74. }