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.  * @package     Joomla.Administrator
  14.  * @subpackage  com_users
  15.  * @since       1.5
  16.  */
  17. class UsersViewUser extends JViewLegacy
  18. {
  19.     protected $form;
  20.  
  21.     protected $item;
  22.  
  23.     protected $grouplist;
  24.  
  25.     protected $groups;
  26.  
  27.     protected $state;
  28.  
  29.     /**
  30.      * Display the view
  31.      *
  32.      * @since  1.5
  33.      */
  34.     public function display($tpl null)
  35.     {
  36.         $this->form            = $this->get('Form');
  37.         $this->item            = $this->get('Item');
  38.         $this->grouplist    = $this->get('Groups');
  39.         $this->groups        = $this->get('AssignedGroups');
  40.         $this->state        = $this->get('State');
  41.         $this->tfaform        $this->get('Twofactorform');
  42.         $this->otpConfig    $this->get('otpConfig');
  43.  
  44.         // Check for errors.
  45.         if (count($errors $this->get('Errors')))
  46.         {
  47.             JError::raiseError(500implode("\n"$errors));
  48.             return false;
  49.         }
  50.  
  51.         $this->form->setValue('password'null);
  52.         $this->form->setValue('password2',    null);
  53.  
  54.         parent::display($tpl);
  55.         $this->addToolbar();
  56.     }
  57.  
  58.     /**
  59.      * Add the page title and toolbar.
  60.      *
  61.      * @since   1.6
  62.      */
  63.     protected function addToolbar()
  64.     {
  65.         JFactory::getApplication()->input->set('hidemainmenu'true);
  66.  
  67.         $user  JFactory::getUser();
  68.         $canDo UsersHelper::getActions();
  69.         $isNew    ($this->item->id == 0);
  70.         $isProfile $this->item->id == $user->id;
  71.  
  72.         JToolbarHelper::title(JText::_($isNew 'COM_USERS_VIEW_NEW_USER_TITLE' ($isProfile 'COM_USERS_VIEW_EDIT_PROFILE_TITLE' 'COM_USERS_VIEW_EDIT_USER_TITLE'))'user ' ($isNew 'user-add' ($isProfile 'user-profile' 'user-edit')));
  73.         if ($canDo->get('core.edit')||$canDo->get('core.create'))
  74.         {
  75.             JToolbarHelper::apply('user.apply');
  76.             JToolbarHelper::save('user.save');
  77.         }
  78.         if ($canDo->get('core.create')&&$canDo->get('core.manage'))
  79.         {
  80.             JToolbarHelper::save2new('user.save2new');
  81.         }
  82.         if (empty($this->item->id))
  83.         {
  84.             JToolbarHelper::cancel('user.cancel');
  85.         }
  86.         else
  87.         {
  88.             JToolbarHelper::cancel('user.cancel''JTOOLBAR_CLOSE');
  89.         }
  90.         JToolbarHelper::divider();
  91.         JToolbarHelper::help('JHELP_USERS_USER_MANAGER_EDIT');
  92.     }
  93. }

Documentation generated on Tue, 19 Nov 2013 15:18:10 +0100 by phpDocumentor 1.4.3