PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
 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
10defined('_JEXEC') or die;
11
12/**
13 * View class for a list of users.
14 *
15 * @package     Joomla.Administrator
16 * @subpackage  com_users
17 * @since       1.6
18 */
19class UsersViewDebugGroup extends JViewLegacy
20{
21	protected $actions;
22
23	protected $items;
24
25	protected $pagination;
26
27	protected $state;
28
29	/**
30	 * Display the view
31	 */
32	public function display($tpl = null)
33	{
34		$this->actions		= $this->get('DebugActions');
35		$this->items		= $this->get('Items');
36		$this->pagination	= $this->get('Pagination');
37		$this->state		= $this->get('State');
38		$this->group		= $this->get('Group');
39		$this->levels		= UsersHelperDebug::getLevelsOptions();
40		$this->components	= UsersHelperDebug::getComponents();
41
42		// Check for errors.
43		if (count($errors = $this->get('Errors'))) {
44			JError::raiseError(500, implode("\n", $errors));
45			return false;
46		}
47
48		$this->addToolbar();
49		parent::display($tpl);
50	}
51
52	/**
53	 * Add the page title and toolbar.
54	 *
55	 * @since	1.6
56	 */
57	protected function addToolbar()
58	{
59		JToolbarHelper::title(JText::sprintf('COM_USERS_VIEW_DEBUG_GROUP_TITLE', $this->group->id, $this->group->title), 'groups');
60
61		JToolbarHelper::help('JHELP_USERS_DEBUG_GROUPS');
62
63		JSubMenuHelper::setAction('index.php?option=com_users&view=debuggroup&user_id=' . (int) $this->state->get('filter.user_id'));
64
65		$option = '';
66		if (!empty($this->components))
67		{
68			$option = JHtml::_('select.options', $this->components, 'value', 'text', $this->state->get('filter.component'));
69		}
70
71		JSubMenuHelper::addFilter(
72			JText::_('COM_USERS_OPTION_SELECT_COMPONENT'),
73			'filter_component',
74			$option
75		);
76
77		JSubMenuHelper::addFilter(
78			JText::_('COM_USERS_OPTION_SELECT_LEVEL_START'),
79			'filter_level_start',
80			JHtml::_('select.options', $this->levels, 'value', 'text', $this->state->get('filter.level_start'))
81		);
82
83		JSubMenuHelper::addFilter(
84			JText::_('COM_USERS_OPTION_SELECT_LEVEL_END'),
85			'filter_level_end',
86			JHtml::_('select.options', $this->levels, 'value', 'text', $this->state->get('filter.level_end'))
87		);
88	}
89}