Source for file view.html.php

Documentation is available at view.html.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Site
  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.  * Registration view class for Users.
  14.  *
  15.  * @package     Joomla.Site
  16.  * @subpackage  com_users
  17.  * @since       1.6
  18.  */
  19. {
  20.     protected $data;
  21.  
  22.     protected $form;
  23.  
  24.     protected $params;
  25.  
  26.     protected $state;
  27.  
  28.     /**
  29.      * Method to display the view.
  30.      *
  31.      * @param   string    The template file to include
  32.      * @since   1.6
  33.      */
  34.     public function display($tpl null)
  35.     {
  36.         // Get the view data.
  37.         $this->data        = $this->get('Data');
  38.         $this->form        = $this->get('Form');
  39.         $this->state    = $this->get('State');
  40.         $this->params    = $this->state->get('params');
  41.  
  42.         // Check for errors.
  43.         if (count($errors $this->get('Errors')))
  44.         {
  45.             JError::raiseError(500implode('<br />'$errors));
  46.             return false;
  47.         }
  48.  
  49.         // Check for layout override
  50.         $active JFactory::getApplication()->getMenu()->getActive();
  51.         if (isset($active->query['layout']))
  52.         {
  53.             $this->setLayout($active->query['layout']);
  54.         }
  55.  
  56.         //Escape strings for HTML output
  57.         $this->pageclass_sfx htmlspecialchars($this->params->get('pageclass_sfx'));
  58.  
  59.         $this->prepareDocument();
  60.  
  61.         parent::display($tpl);
  62.     }
  63.  
  64.     /**
  65.      * Prepares the document.
  66.      *
  67.      * @since   1.6
  68.      */
  69.     protected function prepareDocument()
  70.     {
  71.         $app        JFactory::getApplication();
  72.         $menus        $app->getMenu();
  73.         $title         null;
  74.  
  75.         // Because the application sets a default page title,
  76.         // we need to get it from the menu item itself
  77.         $menu $menus->getActive();
  78.         if ($menu)
  79.         {
  80.             $this->params->def('page_heading'$this->params->get('page_title'$menu->title));
  81.         }
  82.         else
  83.         {
  84.             $this->params->def('page_heading'JText::_('COM_USERS_REGISTRATION'));
  85.         }
  86.  
  87.         $title $this->params->get('page_title''');
  88.         if (empty($title))
  89.         {
  90.             $title $app->getCfg('sitename');
  91.         }
  92.         elseif ($app->getCfg('sitename_pagetitles'0== 1)
  93.         {
  94.             $title JText::sprintf('JPAGETITLE'$app->getCfg('sitename')$title);
  95.         }
  96.         elseif ($app->getCfg('sitename_pagetitles'0== 2)
  97.         {
  98.             $title JText::sprintf('JPAGETITLE'$title$app->getCfg('sitename'));
  99.         }
  100.         $this->document->setTitle($title);
  101.  
  102.         if ($this->params->get('menu-meta_description'))
  103.         {
  104.             $this->document->setDescription($this->params->get('menu-meta_description'));
  105.         }
  106.  
  107.         if ($this->params->get('menu-meta_keywords'))
  108.         {
  109.             $this->document->setMetadata('keywords'$this->params->get('menu-meta_keywords'));
  110.         }
  111.  
  112.         if ($this->params->get('robots'))
  113.         {
  114.             $this->document->setMetadata('robots'$this->params->get('robots'));
  115.         }
  116.     }
  117. }

Documentation generated on Tue, 19 Nov 2013 15:16:50 +0100 by phpDocumentor 1.4.3