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

Documentation generated on Tue, 19 Nov 2013 15:17:00 +0100 by phpDocumentor 1.4.3