- md5
- 59714712d70f346788daa6f220dd5d8a
- sha1
- 10f910101e9ce2e9ecb8730c23fe1671bb22f8f6
- sha256
- 7c0b57266f5c3445ac0c230552ca4324c957920bd479f604961895a75d11c6bd
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
<?php
/**
* @version $Id: view.html.php 20523 2011-02-03 01:26:20Z dextercowley $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
/**
* Content categories view.
*
* @package Joomla.Site
* @subpackage com_contact
* @since 1.6
*/
class ContactViewCategories extends JView
{
protected $state = null;
protected $item = null;
protected $items = null;
protected $pagination = null;
/**
* Display the view
*
* @return mixed False on error, null otherwise.
*/
function display($tpl = null)
{
// Initialise variables
$state = $this->get('State');
$items = $this->get('Items');
$parent = $this->get('Parent');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
if ($items === false) {
return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND'));
}
if ($parent == false) {
return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND'));
}
$params = &$state->params;
$items = array($parent->id => $items);
//Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
$this->assign('maxLevelcat', $params->get('maxLevelcat', -1));
$this->assignRef('params', $params);
$this->assignRef('parent', $parent);
$this->assignRef('items', $items);
$this->_prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if($menu)
{
$this->params->def('page_heading', $this->params->def('page_title', $menu->title));
} else {
$this->params->def('page_heading', JText::_('COM_CONTACT_DEFAULT_PAGE_TITLE'));
}
$title = $this->params->get('page_title', '');
if (empty($title)) {
$title = $app->getCfg('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0)) {
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
}
}
No other release has this exact content. See every version of this file.