29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-07-01 17:43:42 +00:00

Optimised page title handling

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@8843 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
This commit is contained in:
Johan Janssens 2007-09-12 01:30:07 +00:00
parent 38e43b5bd1
commit 1721d8b502
29 changed files with 144 additions and 202 deletions

View File

@ -43,6 +43,7 @@ Legend:
^ Refactored JUser to use JObject setError and improved flexibility of the user data ^ Refactored JUser to use JObject setError and improved flexibility of the user data
store through JUser::getTable function. This change allows to easily extend the user store through JUser::getTable function. This change allows to easily extend the user
database tables database tables
^ Renamed JSite::getPageParameters to getParams to maintain consistency
11-Sep-2007 Nur Aini Rakhmawati 11-Sep-2007 Nur Aini Rakhmawati
# Fixed [#6104] Components menu with invalid + duplicate id attributes # Fixed [#6104] Components menu with invalid + duplicate id attributes

View File

@ -149,7 +149,7 @@ class ContactController extends JController
// Passed Validation: Process the contact plugins to integrate with other applications // Passed Validation: Process the contact plugins to integrate with other applications
$results = $dispatcher->trigger( 'onSubmitContact', array( &$contact, &$post ) ); $results = $dispatcher->trigger( 'onSubmitContact', array( &$contact, &$post ) );
$pparams = &$mainframe->getPageParameters('com_contact'); $pparams = &$mainframe->getParams('com_contact');
if (!$pparams->get( 'custom_reply' )) if (!$pparams->get( 'custom_reply' ))
{ {
$MailFrom = $mainframe->getCfg('mailfrom'); $MailFrom = $mainframe->getCfg('mailfrom');
@ -218,7 +218,7 @@ class ContactController extends JController
$contact->load($contactId); $contact->load($contactId);
// Get the contact detail parameters // Get the contact detail parameters
$pparams = &$mainframe->getPageParameters('com_contact'); $pparams = &$mainframe->getParams('com_contact');
// Should we show the vcard? // Should we show the vcard?
if ($pparams->get('allow_vcard', 0)) if ($pparams->get('allow_vcard', 0))
@ -317,7 +317,7 @@ class ContactController extends JController
// Get params and component configurations // Get params and component configurations
$params = new JParameter($contact->params); $params = new JParameter($contact->params);
$pparams = &$mainframe->getPageParameters('com_contact'); $pparams = &$mainframe->getParams('com_contact');
// check for session cookie // check for session cookie
$sessionCheck = $pparams->get( 'validate_session', 1 ); $sessionCheck = $pparams->get( 'validate_session', 1 );

View File

@ -32,11 +32,7 @@ class ContactViewCategory extends JView
$model = &$this->getModel(); $model = &$this->getModel();
$document =& JFactory::getDocument(); $document =& JFactory::getDocument();
// Get the parameters of the active menu item $pparams = &$mainframe->getParams('com_contact');
$menus =& JSite::getMenu();
$menu = $menus->getActive();
$pparams = &$mainframe->getPageParameters('com_contact');
// Selected Request vars // Selected Request vars
$categoryId = JRequest::getVar('catid', 0, '', 'int'); $categoryId = JRequest::getVar('catid', 0, '', 'int');
@ -45,9 +41,6 @@ class ContactViewCategory extends JView
$filter_order = JRequest::getVar('filter_order', 'cd.ordering', '', 'cmd'); $filter_order = JRequest::getVar('filter_order', 'cd.ordering', '', 'cmd');
$filter_order_Dir = JRequest::getVar('filter_order_Dir', 'ASC', '', 'word'); $filter_order_Dir = JRequest::getVar('filter_order_Dir', 'ASC', '', 'word');
// Set some defaults against system variables
$pparams->def('page_title', $menu->name);
// query options // query options
$options['aid'] = $user->get('aid', 0); $options['aid'] = $user->get('aid', 0);
$options['category_id'] = $categoryId; $options['category_id'] = $categoryId;

View File

@ -36,9 +36,7 @@ class ContactViewContact extends JView
$menus = &JSite::getMenu(); $menus = &JSite::getMenu();
$menu = $menus->getActive(); $menu = $menus->getActive();
$pparams = &$mainframe->getPageParameters('com_contact'); $pparams = &$mainframe->getParams();
$pparams->def('page_title', $menu->name );
// Push a model into the view // Push a model into the view
$model = &$this->getModel(); $model = &$this->getModel();

View File

@ -54,7 +54,7 @@ class ContentModelArchive extends JModel
if (empty($this->_data)) if (empty($this->_data))
{ {
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
// Get the pagination request variables // Get the pagination request variables
$limit = JRequest::getVar('limit', $params->get('display_num', 20), '', 'int'); $limit = JRequest::getVar('limit', $params->get('display_num', 20), '', 'int');
@ -90,7 +90,7 @@ class ContentModelArchive extends JModel
{ {
global $mainframe; global $mainframe;
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
// If voting is turned on, get voting data as well for the content items // If voting is turned on, get voting data as well for the content items
$voting = ContentHelperQuery::buildVotingQuery($params); $voting = ContentHelperQuery::buildVotingQuery($params);
@ -176,7 +176,7 @@ class ContentModelArchive extends JModel
$filter = $db->getEscaped($filter); $filter = $db->getEscaped($filter);
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
switch ($params->get('filter_type', 'title')) switch ($params->get('filter_type', 'title'))
{ {
case 'title' : case 'title' :

View File

@ -460,7 +460,7 @@ class ContentModelArticle extends JModel
if (empty($this->_article)) if (empty($this->_article))
{ {
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
// If voting is turned on, get voting data as well for the article // If voting is turned on, get voting data as well for the article
$voting = ContentHelperQuery::buildVotingQuery($params); $voting = ContentHelperQuery::buildVotingQuery($params);
@ -521,7 +521,7 @@ class ContentModelArticle extends JModel
} }
// Get the page/component configuration // Get the page/component configuration
$params = clone($mainframe->getPageParameters('com_content')); $params = clone($mainframe->getParams('com_content'));
// Merge article parameters into the page configuration // Merge article parameters into the page configuration
$aparams = new JParameter($this->_article->attribs); $aparams = new JParameter($this->_article->attribs);

View File

@ -252,7 +252,7 @@ class ContentModelCategory extends JModel
$user =& JFactory::getUser(); $user =& JFactory::getUser();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$noauth = !$params->get('show_noauth'); $noauth = !$params->get('show_noauth');
$gid = (int) $user->get('aid', 0); $gid = (int) $user->get('aid', 0);
@ -343,7 +343,7 @@ class ContentModelCategory extends JModel
{ {
global $mainframe; global $mainframe;
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
// If voting is turned on, get voting data as well for the content items // If voting is turned on, get voting data as well for the content items
$voting = ContentHelperQuery::buildVotingQuery($params); $voting = ContentHelperQuery::buildVotingQuery($params);
@ -372,7 +372,7 @@ class ContentModelCategory extends JModel
{ {
global $mainframe; global $mainframe;
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$filter_order = JRequest::getCmd('filter_order'); $filter_order = JRequest::getCmd('filter_order');
$filter_order_Dir = JRequest::getWord('filter_order_Dir'); $filter_order_Dir = JRequest::getWord('filter_order_Dir');
@ -424,7 +424,7 @@ class ContentModelCategory extends JModel
$now = $jnow->toMySQL(); $now = $jnow->toMySQL();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$noauth = !$params->get('show_noauth'); $noauth = !$params->get('show_noauth');
$nullDate = $this->_db->getNullDate(); $nullDate = $this->_db->getNullDate();

View File

@ -117,7 +117,7 @@ class ContentModelFrontpage extends JModel
{ {
global $mainframe; global $mainframe;
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
// Voting is turned on, get voting data as well for the content items // Voting is turned on, get voting data as well for the content items
$voting = ContentHelperQuery::buildVotingQuery($params); $voting = ContentHelperQuery::buildVotingQuery($params);
@ -151,7 +151,7 @@ class ContentModelFrontpage extends JModel
{ {
global $mainframe; global $mainframe;
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
if (!is_object($params)) { if (!is_object($params)) {
$params = &JComponentHelper::getParams('com_content'); $params = &JComponentHelper::getParams('com_content');
} }
@ -180,7 +180,7 @@ class ContentModelFrontpage extends JModel
$now = $jnow->toMySQL(); $now = $jnow->toMySQL();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$noauth = !$params->get('show_noauth'); $noauth = !$params->get('show_noauth');
$nullDate = $this->_db->getNullDate(); $nullDate = $this->_db->getNullDate();

View File

@ -259,7 +259,7 @@ class ContentModelSection extends JModel
{ {
$user =& JFactory::getUser(); $user =& JFactory::getUser();
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$noauth = !$params->get('show_noauth'); $noauth = !$params->get('show_noauth');
$gid = $user->get('aid', 0); $gid = $user->get('aid', 0);
@ -403,7 +403,7 @@ class ContentModelSection extends JModel
global $mainframe; global $mainframe;
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
// If voting is turned on, get voting data as well for the content items // If voting is turned on, get voting data as well for the content items
$voting = ContentHelperQuery::buildVotingQuery($params); $voting = ContentHelperQuery::buildVotingQuery($params);
@ -478,7 +478,7 @@ class ContentModelSection extends JModel
$now = $jnow->toMySQL(); $now = $jnow->toMySQL();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$noauth = !$params->get('show_noauth'); $noauth = !$params->get('show_noauth');
$nullDate = $this->_db->getNullDate(); $nullDate = $this->_db->getNullDate();

View File

@ -38,15 +38,10 @@ class ContentViewArchive extends ContentView
// Initialize some variables // Initialize some variables
$user =& JFactory::getUser(); $user =& JFactory::getUser();
$document =& JFactory::getDocument();
$pathway =& $mainframe->getPathway(); $pathway =& $mainframe->getPathway();
// Get the menu item object
$menus = &JSite::getMenu();
$menu = $menus->getActive();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters('com_content'); $params = &$mainframe->getParams('com_content');
// Request variables // Request variables
$task = JRequest::getCmd('task'); $task = JRequest::getCmd('task');
@ -64,8 +59,6 @@ class ContentViewArchive extends ContentView
// Add item to pathway // Add item to pathway
$pathway->addItem(JText::_('Archive'), ''); $pathway->addItem(JText::_('Archive'), '');
$document->setTitle($menu->name);
$params->def('filter', 1); $params->def('filter', 1);
$params->def('filter_type', 'title'); $params->def('filter_type', 'title');

View File

@ -31,7 +31,7 @@ class ContentViewCategory extends JView
global $mainframe; global $mainframe;
$doc =& JFactory::getDocument(); $doc =& JFactory::getDocument();
$params =& $mainframe->getPageParameters(); $params =& $mainframe->getParams();
$doc->link = JURI::base().JRoute::_('index.php?option=com_content&view=category&id='.JRequest::getVar('id',null, '', 'int')); $doc->link = JURI::base().JRoute::_('index.php?option=com_content&view=category&id='.JRequest::getVar('id',null, '', 'int'));
// Get some data from the model // Get some data from the model

View File

@ -32,7 +32,6 @@ class ContentViewCategory extends ContentView
// Initialize some variables // Initialize some variables
$user =& JFactory::getUser(); $user =& JFactory::getUser();
$document =& JFactory::getDocument();
$uri =& JFactory::getURI(); $uri =& JFactory::getURI();
$pathway =& $mainframe->getPathway(); $pathway =& $mainframe->getPathway();
@ -41,7 +40,7 @@ class ContentViewCategory extends ContentView
$menu = $menus->getActive(); $menu = $menus->getActive();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters('com_content'); $params = &$mainframe->getParams('com_content');
// Request variables // Request variables
$task = JRequest::getCmd('task'); $task = JRequest::getCmd('task');
@ -84,10 +83,7 @@ class ContentViewCategory extends ContentView
$pathway->addItem($category->title, ''); $pathway->addItem($category->title, '');
} }
$document->setTitle($menu->name);
$params->def('date_format', JText::_('DATE_FORMAT_LC1')); $params->def('date_format', JText::_('DATE_FORMAT_LC1'));
$params->def('page_title', $menu->name);
jimport('joomla.html.pagination'); jimport('joomla.html.pagination');
$pagination = new JPagination($total, $limitstart, $limit - $links); $pagination = new JPagination($total, $limitstart, $limit - $links);

View File

@ -34,7 +34,7 @@ class ContentViewFrontpage extends JView
// parameters // parameters
$db =& JFactory::getDBO(); $db =& JFactory::getDBO();
$document =& JFactory::getDocument(); $document =& JFactory::getDocument();
$params =& $mainframe->getPageParameters(); $params =& $mainframe->getParams();
$document->link = JURI::base().JRoute::_('index.php?option=com_content&view=frontpage'); $document->link = JURI::base().JRoute::_('index.php?option=com_content&view=frontpage');
// Get some data from the model // Get some data from the model

View File

@ -40,15 +40,10 @@ class ContentViewFrontpage extends ContentView
$limit = JRequest::getVar('limit', 5, '', 'int'); $limit = JRequest::getVar('limit', 5, '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
// Get the menu item object
$menus = &JSite::getMenu();
$menu = $menus->getActive();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters('com_content'); $params = &$mainframe->getParams();
// parameters // parameters
$title = $params->def('page_title', $mainframe->getCfg('sitename' ));
$intro = $params->def('num_intro_articles', 4); $intro = $params->def('num_intro_articles', 4);
$leading = $params->def('num_leading_articles', 1); $leading = $params->def('num_leading_articles', 1);
$links = $params->def('num_links', 4); $links = $params->def('num_links', 4);
@ -57,7 +52,6 @@ class ContentViewFrontpage extends ContentView
$descrip_image = $params->def('show_description_image',1); $descrip_image = $params->def('show_description_image',1);
$params->set('show_intro', 1); $params->set('show_intro', 1);
$params->def('page_title', $menu->name);
$limit = $intro + $leading + $links; $limit = $intro + $leading + $links;
JRequest::setVar('limit', (int) $limit); JRequest::setVar('limit', (int) $limit);
@ -82,9 +76,6 @@ class ContentViewFrontpage extends ContentView
$document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
} }
$document = &JFactory::getDocument();
$document->setTitle($title);
jimport('joomla.html.pagination'); jimport('joomla.html.pagination');
$this->pagination = new JPagination($total, $limitstart, $limit - $links); $this->pagination = new JPagination($total, $limitstart, $limit - $links);

View File

@ -31,7 +31,7 @@ class ContentViewSection extends JView
{ {
global $mainframe; global $mainframe;
$doc =& JFactory::getDocument(); $doc =& JFactory::getDocument();
$params =& $mainframe->getPageParameters(); $params =& $mainframe->getParams();
// Get some data from the model // Get some data from the model
JRequest::setVar('limit', $mainframe->getCfg('feed_limit')); JRequest::setVar('limit', $mainframe->getCfg('feed_limit'));

View File

@ -35,12 +35,8 @@ class ContentViewSection extends ContentView
$user =& JFactory::getUser(); $user =& JFactory::getUser();
$document =& JFactory::getDocument(); $document =& JFactory::getDocument();
// Get the menu item object
$menus = &JSite::getMenu();
$menu = $menus->getActive();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters('com_content'); $params = &$mainframe->getParams();
// Request variables // Request variables
$limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int'); $limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int');
@ -75,19 +71,13 @@ class ContentViewSection extends ContentView
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
} }
// Set the page title
if (!empty ($menu->name)) {
$document->setTitle($menu->name);
}
for($i = 0; $i < count($categories); $i++) for($i = 0; $i < count($categories); $i++)
{ {
$category =& $categories[$i]; $category =& $categories[$i];
$category->link = JRoute::_('index.php?view=category&id='.$category->slug); $category->link = JRoute::_('index.php?view=category&id='.$category->slug);
} }
$params->def('page_title', $menu->name);
if ($total == 0) { if ($total == 0) {
$params->set('show_categories', false); $params->set('show_categories', false);
} }

View File

@ -0,0 +1,80 @@
<?php
/**
* @version $Id: media.php 8660 2007-08-30 23:53:21Z louis $
* @package Joomla
* @subpackage Massmail
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport( 'joomla.application.component.controller' );
/**
* Media Manager Component Controller
*
* @package Joomla
* @subpackage Media
* @version 1.5
*/
class MediaController extends JController
{
/**
* Display the view
*/
function display()
{
global $mainframe;
$vName = JRequest::getCmd('view', 'images');
switch ($vName)
{
case 'imagesList':
$mName = 'list';
$vLayout = JRequest::getCmd( 'layout', 'default' );
break;
case 'images':
default:
$vLayout = JRequest::getCmd( 'layout', 'default' );
$mName = 'manager';
$vName = 'images';
break;
}
$document = &JFactory::getDocument();
$vType = $document->getType();
// Get/Create the view
$view = &$this->getView( $vName, $vType);
$view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.$vName.DS.'tmpl');
// Get/Create the model
if ($model = &$this->getModel($mName)) {
// Push the model into the view (as default)
$view->setModel($model, true);
}
// Set the layout
$view->setLayout($vLayout);
// Display the view
$view->display();
}
function ftpValidate()
{
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
}
}

View File

@ -31,72 +31,12 @@ define('COM_MEDIA_BASEURL', JURI::base().$params->get('image_path', 'images/stor
// Load the admin HTML view // Load the admin HTML view
require_once( JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'media.php' ); require_once( JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'media.php' );
jimport( 'joomla.application.component.controller' ); // Require the base controller
require_once (JPATH_COMPONENT.DS.'controller.php');
/**
* Media Manager Component Controller
*
* @package Joomla
* @subpackage Media
* @version 1.5
*/
class MediaController extends JController
{
/**
* Display the view
*/
function display()
{
global $mainframe;
$vName = JRequest::getCmd('view', 'images');
switch ($vName)
{
case 'imagesList':
$mName = 'list';
$vLayout = JRequest::getCmd( 'layout', 'default' );
break;
case 'images':
default:
$vLayout = JRequest::getCmd( 'layout', 'default' );
$mName = 'manager';
$vName = 'images';
break;
}
$document = &JFactory::getDocument();
$vType = $document->getType();
// Get/Create the view
$view = &$this->getView( $vName, $vType);
$view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.$vName.DS.'tmpl');
// Get/Create the model
if ($model = &$this->getModel($mName)) {
// Push the model into the view (as default)
$view->setModel($model, true);
}
// Set the layout
$view->setLayout($vLayout);
// Display the view
$view->display();
}
function ftpValidate()
{
// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');
}
}
$cmd = JRequest::getCmd('task', null); $cmd = JRequest::getCmd('task', null);
if (strpos($cmd, '.') != false && false) { if (strpos($cmd, '.') != false && false)
{
// We have a defined controller/task pair -- lets split them out // We have a defined controller/task pair -- lets split them out
list($controllerName, $task) = explode('.', $cmd); list($controllerName, $task) = explode('.', $cmd);
@ -110,7 +50,9 @@ if (strpos($cmd, '.') != false && false) {
} else { } else {
JError::raiseError(500, 'Invalid Controller'); JError::raiseError(500, 'Invalid Controller');
} }
} else { }
else
{
// Base controller, just set the task :) // Base controller, just set the task :)
$controllerName = null; $controllerName = null;
$task = $cmd; $task = $cmd;

View File

@ -32,21 +32,11 @@ class NewsfeedsViewCategories extends JView
{ {
global $mainframe; global $mainframe;
$document = &JFactory::getDocument();
// Load the menu object and parameters // Load the menu object and parameters
$menus = &JSite::getMenu(); $params = &$mainframe->getParams();
$menu = $menus->getActive();
$params = &$mainframe->getPageParameters();
$categories =& $this->get('data'); $categories =& $this->get('data');
// Parameters
$params->def( 'page_title', $menu->name );
// Set the page title
$document->setTitle($params->get('page_title'));
for($i = 0; $i < count($categories); $i++) for($i = 0; $i < count($categories); $i++)
{ {
$category =& $categories[$i]; $category =& $categories[$i];

View File

@ -38,16 +38,13 @@ class NewsfeedsViewCategory extends JView
// Get the parameters of the active menu item // Get the parameters of the active menu item
$menus = &JSite::getMenu(); $menus = &JSite::getMenu();
$menu = $menus->getActive(); $menu = $menus->getActive();
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$category = $this->get('category'); $category = $this->get('category');
$items = $this->get('data'); $items = $this->get('data');
$total = $this->get('total'); $total = $this->get('total');
$pagination = &$this->get('pagination'); $pagination = &$this->get('pagination');
// Parameters
$params->def( 'page_title', $menu->name );
// Set page title per category // Set page title per category
$document->setTitle( $category->title. ' - '. $params->get( 'page_title')); $document->setTitle( $category->title. ' - '. $params->get( 'page_title'));

View File

@ -46,7 +46,7 @@ class NewsfeedsViewNewsfeed extends JView
// Get the current menu item // Get the current menu item
$menus = &JSite::getMenu(); $menus = &JSite::getMenu();
$menu = $menus->getActive(); $menu = $menus->getActive();
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
//get the newsfeed //get the newsfeed
$newsfeed =& $this->get('data'); $newsfeed =& $this->get('data');
@ -84,13 +84,9 @@ class NewsfeedsViewNewsfeed extends JView
// feed elements // feed elements
$newsfeed->items = array_slice($newsfeed->items, 0, $newsfeed->numarticles); $newsfeed->items = array_slice($newsfeed->items, 0, $newsfeed->numarticles);
// Adds parameter handling
$params->def( 'page_title', $menu->name );
// Set page title per category // Set page title per category
$document->setTitle( $newsfeed->name . ' - '. $params->get( 'page_title')); $document->setTitle( $newsfeed->name . ' - '. $params->get( 'page_title'));
//set breadcrumbs //set breadcrumbs
if($menu->query['view'] != 'newsfeed') if($menu->query['view'] != 'newsfeed')
{ {

View File

@ -47,9 +47,7 @@ class PollViewPoll extends JView
} }
// Adds parameter handling // Adds parameter handling
$menu =& JSite::getMenu(); $params = $mainframe->getParams();
$item = $menu->getActive();
$params = $mainframe->getPageParameters();
//Set page title information //Set page title information
$document->setTitle($poll->title); $document->setTitle($poll->title);

View File

@ -34,7 +34,6 @@ class SearchViewSearch extends JView
require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'search.php' ); require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'search.php' );
// Initialize some variables // Initialize some variables
$document =& JFactory::getDocument();
$pathway =& $mainframe->getPathway(); $pathway =& $mainframe->getPathway();
$uri =& JFactory::getURI(); $uri =& JFactory::getURI();
@ -47,17 +46,8 @@ class SearchViewSearch extends JView
$state = &$this->get('state'); $state = &$this->get('state');
$searchword = $state->get('keyword'); $searchword = $state->get('keyword');
// Set page title information
$document->setTitle(JText::_('Search'));
// Get the parameters of the active menu item // Get the parameters of the active menu item
$menus = &JSite::getMenu(); $params = &$mainframe->getParams();
$menu = $menus->getActive();
$params = &$mainframe->getPageParameters();
if(isset($menu)) {
$params->def( 'page_title', $menu->name );
}
// built select lists // built select lists
$orders = array(); $orders = array();

View File

@ -55,17 +55,7 @@ class UserViewUser extends JView
global $mainframe; global $mainframe;
$user =& JFactory::getUser(); $user =& JFactory::getUser();
$document =& JFactory::getDocument();
// Get the parameters of the active menu item
$menu = &JSite::getMenu();
$item = $menu->getActive();
// Set page title
if ( isset($item->name) ) {
$document->setTitle( $item->name );
}
// check to see if Frontend User Params have been enabled // check to see if Frontend User Params have been enabled
$usersConfig = &JComponentHelper::getParams( 'com_users' ); $usersConfig = &JComponentHelper::getParams( 'com_users' );
$check = $usersConfig->get('frontend_userparams'); $check = $usersConfig->get('frontend_userparams');

View File

@ -33,23 +33,16 @@ class WeblinksViewCategories extends JView
$document =& JFactory::getDocument(); $document =& JFactory::getDocument();
$menu = &JSite::getMenu();
$item = $menu->getActive();
$categories =& $this->get('data'); $categories =& $this->get('data');
$total =& $this->get('total'); $total =& $this->get('total');
$state =& $this->get('state'); $state =& $this->get('state');
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
// Set some defaults if not set for params // Set some defaults if not set for params
$params->def('page_title', $item->name);
$params->def('comp_description', JText::_('WEBLINKS_DESC')); $params->def('comp_description', JText::_('WEBLINKS_DESC'));
// Set the page title
$document->setTitle($params->get('page_title'));
// Define image tag attributes // Define image tag attributes
if ($params->get('image') != -1) if ($params->get('image') != -1)
{ {

View File

@ -48,7 +48,7 @@ class WeblinksViewCategory extends JView
$state = &$this->get('state'); $state = &$this->get('state');
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
$category->total = $total; $category->total = $total;
@ -80,7 +80,6 @@ class WeblinksViewCategory extends JView
$lists['order'] = $state->get('filter_order'); $lists['order'] = $state->get('filter_order');
// Set some defaults if not set for params // Set some defaults if not set for params
$params->def('page_title', $menu->name);
$params->def('com_description', JText::_('WEBLINKS_DESC')); $params->def('com_description', JText::_('WEBLINKS_DESC'));
// Define image tag attributes // Define image tag attributes

View File

@ -25,12 +25,6 @@ class WrapperViewWrapper extends JView
{ {
function display( $tpl = null ) function display( $tpl = null )
{ {
// Get the parameters of the active menu item
$menus = &JSite::getMenu();
$menu = $menus->getActive();
$this->params->def( 'page_title', $menu->name );
// auto height control // auto height control
if ( $this->params->def( 'height_auto' ) ) { if ( $this->params->def( 'height_auto' ) ) {
$this->wrapper->load = 'onload="iFrameHeight()"'; $this->wrapper->load = 'onload="iFrameHeight()"';

View File

@ -48,7 +48,7 @@ class WrapperController
$menu = $menus->getActive(); $menu = $menus->getActive();
// Get the page/component configuration // Get the page/component configuration
$params = &$mainframe->getPageParameters(); $params = &$mainframe->getParams();
//set page title //set page title
$document->setTitle($menu->name); $document->setTitle($menu->name);

View File

@ -91,6 +91,7 @@ class JSite extends JApplication
$document =& JFactory::getDocument(); $document =& JFactory::getDocument();
$user =& JFactory::getUser(); $user =& JFactory::getUser();
$router =& $this->getRouter(); $router =& $this->getRouter();
$params =& $this->getParams();
switch($document->getType()) switch($document->getType())
{ {
@ -117,8 +118,8 @@ class JSite extends JApplication
} }
$document->setTitle( $this->getCfg('sitename' )); $document->setTitle( $params->get('page_title') );
$document->setDescription( $this->getCfg('MetaDesc') ); $document->setDescription( $params->get('page_description') );
$contents = JComponentHelper::renderComponent($component); $contents = JComponentHelper::renderComponent($component);
$document->setBuffer( $contents, 'component'); $document->setBuffer( $contents, 'component');
@ -201,16 +202,17 @@ class JSite extends JApplication
} }
/** /**
* Get Page Parameters * Get the appliaction parameters
* *
* @return object The page parameters object * @return object The parameters object
* @since 1.5 * @since 1.5
*/ */
function &getPageParameters($option=null) function &getParams($option = null)
{ {
static $params; static $params;
if (!is_object($params)) { if (!is_object($params))
{
// Get component parameters // Get component parameters
if (!$option) { if (!$option) {
$option = JRequest::getCmd('option'); $option = JRequest::getCmd('option');
@ -220,11 +222,20 @@ class JSite extends JApplication
// Get menu parameters // Get menu parameters
$menus = &JSite::getMenu(); $menus = &JSite::getMenu();
$menu = $menus->getActive(); $menu = $menus->getActive();
$title = $this->getCfg('sitename' );
$description = $this->getCfg('MetaDesc');
// Lets cascade the parameters if we have menu item parameters // Lets cascade the parameters if we have menu item parameters
if (is_object($menu)) { if (is_object($menu))
{
$params->merge(new JParameter($menu->params)); $params->merge(new JParameter($menu->params));
$title = $menu->name;
} }
$params->def( 'page_title' , $title );
$params->def( 'page_description', $description );
} }
return $params; return $params;