[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/components/com_user/views/login/ -> 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    Login
   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   * User component login view class
  22   *
  23   * @package        Joomla
  24   * @subpackage    Users
  25   * @since    1.0
  26   */
  27  class UserViewLogin extends JView
  28  {
  29  	function display($tpl = null)
  30      {
  31          global $mainframe, $option;
  32  
  33          // Initialize variables
  34          $document    =& JFactory::getDocument();
  35          $user        =& JFactory::getUser();
  36          $pathway    =& $mainframe->getPathway();
  37          $image        = '';
  38  
  39          $menu   =& JSite::getMenu();
  40          $item   = $menu->getActive();
  41          if($item)
  42              $params    =& $menu->getParams($item->id);
  43          else
  44              $params    =& $menu->getParams(null);
  45  
  46  
  47          $type = (!$user->get('guest')) ? 'logout' : 'login';
  48  
  49          // Set some default page parameters if not set
  50          $params->def( 'show_page_title',                 1 );
  51          if (!$params->get( 'page_title')) {
  52                  $params->set('page_title',    JText::_( 'Login' ));
  53              }
  54          if(!$item)
  55          {
  56              $params->def( 'header_login',             '' );
  57              $params->def( 'header_logout',             '' );
  58          }
  59  
  60          $params->def( 'pageclass_sfx',             '' );
  61          $params->def( 'login',                     'index.php' );
  62          $params->def( 'logout',                 'index.php' );
  63          $params->def( 'description_login',         1 );
  64          $params->def( 'description_logout',         1 );
  65          $params->def( 'description_login_text',     JText::_( 'LOGIN_DESCRIPTION' ) );
  66          $params->def( 'description_logout_text',    JText::_( 'LOGOUT_DESCRIPTION' ) );
  67          $params->def( 'image_login',                 'key.jpg' );
  68          $params->def( 'image_logout',                 'key.jpg' );
  69          $params->def( 'image_login_align',             'right' );
  70          $params->def( 'image_logout_align',         'right' );
  71          $usersConfig = &JComponentHelper::getParams( 'com_users' );
  72          $params->def( 'registration',                 $usersConfig->get( 'allowUserRegistration' ) );
  73  
  74          if ( !$user->get('guest') )
  75          {
  76              $title = JText::_( 'Logout');
  77  
  78              // pathway item
  79              $pathway->addItem($title, '' );
  80              // Set page title
  81              $document->setTitle( $title );
  82          }
  83          else
  84          {
  85              $title = JText::_( 'Login');
  86  
  87              // pathway item
  88              $pathway->addItem($title, '' );
  89              // Set page title
  90              $document->setTitle( $title );
  91          }
  92  
  93          // Build login image if enabled
  94          if ( $params->get( 'image_'.$type ) != -1 ) {
  95              $image = 'images/stories/'.$params->get( 'image_'.$type );
  96              $image = '<img src="'. $image  .'" align="'. $params->get( 'image_'.$type.'_align' ) .'" hspace="10" alt="" />';
  97          }
  98  
  99          // Get the return URL
 100          if (!$url = JRequest::getVar('return', '', 'method', 'base64')) {
 101              $url = base64_encode($params->get($type));
 102          }
 103  
 104          $errors =& JError::getErrors();
 105  
 106          $this->assign('image' , $image);
 107          $this->assign('type'  , $type);
 108          $this->assign('return', $url);
 109  
 110          $this->assignRef('params', $params);
 111  
 112  
 113          parent::display($tpl);
 114      }
 115  }
 116  


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