[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/components/com_user/views/user/ -> view.html.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: view.html.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla
   5  * @subpackage    Weblinks
   6  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7  * @license        GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  */
  14  
  15  // Check to ensure this file is included in Joomla!
  16  defined( '_JEXEC' ) or die( 'Restricted access' );
  17  
  18  jimport( 'joomla.application.component.view');
  19  
  20  /**
  21   * HTML View class for the Users component
  22   *
  23   * @static
  24   * @package        Joomla
  25   * @subpackage    Weblinks
  26   * @since 1.0
  27   */
  28  class UserViewUser extends JView
  29  {
  30  	function display( $tpl = null)
  31      {
  32          global $mainframe;
  33  
  34          $layout    = $this->getLayout();
  35          if( $layout == 'form') {
  36              $this->_displayForm($tpl);
  37              return;
  38          }
  39  
  40          if ( $layout == 'login' ) {
  41              parent::display($tpl);
  42              return;
  43          }
  44  
  45          $user =& JFactory::getUser();
  46  
  47          // Get the page/component configuration
  48          $params = &$mainframe->getParams();
  49  
  50          $menus    = &JSite::getMenu();
  51          $menu    = $menus->getActive();
  52  
  53          // because the application sets a default page title, we need to get it
  54          // right from the menu item itself
  55          if (is_object( $menu )) {
  56              $menu_params = new JParameter( $menu->params );
  57              if (!$menu_params->get( 'page_title')) {
  58                  $params->set('page_title',    JText::_( 'Registered Area' ));
  59              }
  60          } else {
  61              $params->set('page_title',    JText::_( 'Registered Area' ));
  62          }
  63          $document    = &JFactory::getDocument();
  64          $document->setTitle( $params->get( 'page_title' ) );
  65  
  66          // Set pathway information
  67          $this->assignRef('user'   , $user);
  68          $this->assignRef('params',        $params);
  69  
  70          parent::display($tpl);
  71      }
  72  
  73  	function _displayForm($tpl = null)
  74      {
  75          global $mainframe;
  76  
  77          // Load the form validation behavior
  78          JHTML::_('behavior.formvalidation');
  79  
  80          $user     =& JFactory::getUser();
  81          $params = &$mainframe->getParams();
  82  
  83          // check to see if Frontend User Params have been enabled
  84          $usersConfig = &JComponentHelper::getParams( 'com_users' );
  85          $check = $usersConfig->get('frontend_userparams');
  86  
  87          if ($check == '1' || $check == 1 || $check == NULL)
  88          {
  89              if($user->authorize( 'com_user', 'edit' )) {
  90                  $params        = $user->getParameters(true);
  91              }
  92          }
  93          $params->merge( $params );
  94          $menus    = &JSite::getMenu();
  95          $menu    = $menus->getActive();
  96  
  97          // because the application sets a default page title, we need to get it
  98          // right from the menu item itself
  99          if (is_object( $menu )) {
 100              $menu_params = new JParameter( $menu->params );
 101              if (!$menu_params->get( 'page_title')) {
 102                  $params->set('page_title',    JText::_( 'Edit Your Details' ));
 103              }
 104          } else {
 105              $params->set('page_title',    JText::_( 'Edit Your Details' ));
 106          }
 107          $document    = &JFactory::getDocument();
 108          $document->setTitle( $params->get( 'page_title' ) );
 109  
 110          $this->assignRef('user'  , $user);
 111          $this->assignRef('params', $params);
 112  
 113          parent::display($tpl);
 114      }
 115  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1