- md5
- 7955ec6ba054617eec6f471a03c444d6
- sha1
- 41381971a7bab02eff842b6d78c9a8b12315abcf
- sha256
- 64527235183f7ddedff6885aa9a67d7d9ec266cadd3c7c2b2419bfce88c5dafd
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
<?php
/**
* @version $Id: view.html.php 21655 2011-06-23 05:43:24Z chdemko $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
/**
* View to edit a user view level.
*
* @package Joomla.Administrator
* @subpackage com_users
* @since 1.6
*/
class UsersViewLevel extends JView
{
protected $form;
protected $item;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', 1);
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$canDo = UsersHelper::getActions();
JToolBarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_LEVEL_TITLE' : 'COM_USERS_VIEW_EDIT_LEVEL_TITLE'), 'levels-add');
if ($canDo->get('core.edit')||$canDo->get('core.create')) {
JToolBarHelper::apply('level.apply');
JToolBarHelper::save('level.save');
}
if ($canDo->get('core.create')) {
JToolBarHelper::save2new('level.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')){
JToolBarHelper::save2copy('level.save2copy');
}
if (empty($this->item->id)){
JToolBarHelper::cancel('level.cancel');
} else {
JToolBarHelper::cancel('level.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_USERS_ACCESS_LEVELS_EDIT');
}
}
The same content is in 3 releases, Joomla 1.7.0 to 1.7.2. See them all, or every version of this file.