Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Отчет Клименок.docx
Скачиваний:
1
Добавлен:
01.03.2025
Размер:
5.73 Mб
Скачать

5. Листинг программы.

Основной код сайта написан в PHP.

Часть кода конфигураций :

<?php

class JConfig {

public $offline = '0';

public $offline_message = 'Сайт закрыт на техническое обслуживание.<br /> Пожалуйста, зайдите позже.';

public $display_offline_message = '1';

public $offline_image = '';

public $sitename = 'site';

public $editor = 'tinymce';

public $captcha = '0';

public $list_limit = '20';

public $access = '1';

public $debug = '0';

public $debug_lang = '0';

public $dbtype = 'mysqli';

public $host = 'localhost';

public $user = 'root';

public $password = '';

public $db = 'root';

public $dbprefix = 'p2uv7_';

public $live_site = '';

public $secret = 'DOSJvxOAPqxyCLJu';

public $gzip = '0';

public $error_reporting = 'default';

public $helpurl = 'http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:{keyref}';

public $ftp_host = '127.0.0.1';

public $ftp_port = '21';

public $ftp_user = '';

public $ftp_pass = '';

public $ftp_root = '';

public $ftp_enable = '0';

public $offset = 'UTC';

public $mailer = 'mail';

public $mailfrom = 'site@mail.ru';

public $fromname = 'site';

public $sendmail = '/usr/sbin/sendmail';

public $smtpauth = '0';

public $smtpuser = '';

public $smtppass = '';

public $smtphost = 'localhost';

public $smtpsecure = 'none';

public $smtpport = '25';

public $caching = '0';

public $cache_handler = 'file';

public $cachetime = '15';

public $MetaDesc = '';

public $MetaKeys = '';

public $MetaTitle = '1';

public $MetaAuthor = '1';

public $MetaVersion = '0';

public $robots = '';

public $sef = '1';

public $sef_rewrite = '0';

public $sef_suffix = '0';

public $unicodeslugs = '0';

public $feed_limit = '10';

public $log_path = 'Z:\\home\\localhost\\www\\site/logs';

public $tmp_path = 'Z:\\home\\localhost\\www\\site/tmp';

public $lifetime = '30';

public $session_handler = 'database';

public $MetaRights = '';

public $sitename_pagetitles = '0';

public $force_ssl = '0';

public $feed_email = 'author';

public $cookie_domain = '';

public $cookie_path = '';

}

Индексы:

<?php

/**

* @version $Id: index.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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.

*/

// Set flag that this is a parent file

define( '_JEXEC', 1 );

define('JPATH_BASE', dirname(__FILE__) );

define( 'DS', DIRECTORY_SEPARATOR );

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );

require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;

/**

* CREATE THE APPLICATION

*

* NOTE :

*/

$mainframe =& JFactory::getApplication('site');

/**

* INITIALISE THE APPLICATION

*

* NOTE :

*/

// set the language

$mainframe->initialise();

JPluginHelper::importPlugin('system');

// trigger the onAfterInitialise events

JDEBUG ? $_PROFILER->mark('afterInitialise') : null;

$mainframe->triggerEvent('onAfterInitialise');

/**

* ROUTE THE APPLICATION

*

* NOTE :

*/

$mainframe->route();

// authorization

$Itemid = JRequest::getInt( 'Itemid');

$mainframe->authorize($Itemid);

// trigger the onAfterRoute events

JDEBUG ? $_PROFILER->mark('afterRoute') : null;

$mainframe->triggerEvent('onAfterRoute');

/**

* DISPATCH THE APPLICATION

*

* NOTE :

*/

$option = JRequest::getCmd('option');

$mainframe->dispatch($option);

// trigger the onAfterDispatch events

JDEBUG ? $_PROFILER->mark('afterDispatch') : null;

$mainframe->triggerEvent('onAfterDispatch');

/**

* RENDER THE APPLICATION

*

* NOTE :

*/

$mainframe->render();

// trigger the onAfterRender events

JDEBUG ? $_PROFILER->mark('afterRender') : null;

$mainframe->triggerEvent('onAfterRender');

/**

* RETURN THE RESPONSE

*/

echo JResponse::toString($mainframe->getCfg('gzip'));

<?php

/**

* @version $Id: index2.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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.

*/

$_REQUEST['tmpl'] = 'component';

include('index.php');

Код индекса управления от лица администратора:

<?php

/**

* @version $Id: index.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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.

*/

// Set flag that this is a parent file

define( '_JEXEC', 1 );

define('JPATH_BASE', dirname(__FILE__) );

define('DS', DIRECTORY_SEPARATOR);

require_once( JPATH_BASE .DS.'includes'.DS.'defines.php' );

require_once( JPATH_BASE .DS.'includes'.DS.'framework.php' );

require_once( JPATH_BASE .DS.'includes'.DS.'helper.php' );

require_once( JPATH_BASE .DS.'includes'.DS.'toolbar.php' );

JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;

/**

* CREATE THE APPLICATION

*

* NOTE :

*/

$mainframe =& JFactory::getApplication('administrator');

/**

* INITIALISE THE APPLICATION

*

* NOTE :

*/

$mainframe->initialise(array(

'language' => $mainframe->getUserState( "application.lang", 'lang' )

));

JPluginHelper::importPlugin('system');

// trigger the onAfterInitialise events

JDEBUG ? $_PROFILER->mark('afterInitialise') : null;

$mainframe->triggerEvent('onAfterInitialise');

/**

* ROUTE THE APPLICATION

*

* NOTE :

*/

$mainframe->route();

// trigger the onAfterRoute events

JDEBUG ? $_PROFILER->mark('afterRoute') : null;

$mainframe->triggerEvent('onAfterRoute');

/**

* DISPATCH THE APPLICATION

*

* NOTE :

*/

$option = JAdministratorHelper::findOption();

$mainframe->dispatch($option);

// trigger the onAfterDispatch events

JDEBUG ? $_PROFILER->mark('afterDispatch') : null;

$mainframe->triggerEvent('onAfterDispatch');

/**

* RENDER THE APPLICATION

*

* NOTE :

*/

$mainframe->render();

// trigger the onAfterRender events

JDEBUG ? $_PROFILER->mark( 'afterRender' ) : null;

$mainframe->triggerEvent( 'onAfterRender' );

/**

* RETURN THE RESPONSE

*/

echo JResponse::toString($mainframe->getCfg('gzip'));

?>

<?php

/**

* @version $Id: index2.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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.

*/

include('index.php');

?>

<?php

/**

* @version $Id: index3.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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.

*/

$_REQUEST['tmpl'] = 'component';

include('index.php');

?>

Код модуля JoomShopping:

<?php

/**

* @version 3.11.4 20.08.2012

* @author MAXXmarketing GmbH

* @package Jshopping

* @copyright Copyright (C) 2010 webdesigner-profi.de. All rights reserved.

* @license GNU/GPL

*/

defined('_JEXEC') or die('Restricted access');

if (!JFactory::getUser()->authorise('core.manage', 'com_jshopping')) {

return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));

}

JTable::addIncludePath(JPATH_COMPONENT_SITE.'/tables');

require_once(JPATH_COMPONENT_SITE."/lib/factory.php");

require_once(JPATH_COMPONENT_SITE.'/lib/functions.php');

require_once(JPATH_COMPONENT_ADMINISTRATOR.'/functions.php');

$ajax = JRequest::getInt('ajax');

$adminlang = JFactory::getLanguage();

if (!JRequest::getVar("js_nolang")){

JSFactory::loadAdminLanguageFile();

}

$db = JFactory::getDBO();

$jshopConfig = JSFactory::getConfig();

$jshopConfig->cur_lang = $jshopConfig->frontend_lang;

if ($jshopConfig->adminLanguage!=$adminlang->getTag()){

$config = new jshopConfig($db);

$config->id = 1;

$config->adminLanguage = $adminlang->getTag();

if (!$config->store()) {

JError::raiseWarning("",_JSHOP_ERROR_SAVE_DATABASE);

return 0;

}

}

if (!$ajax){

installNewLanguages();

}else{

header('Content-Type: text/html;charset=UTF-8');

}

$document = JFactory::getDocument();

$document->addScript($jshopConfig->live_path.'js/jquery/jquery-'.$jshopConfig->load_jquery_version.'.min.js');

$document->addScript($jshopConfig->live_path.'js/jquery/jquery-noconflict.js');

$document->addScript($jshopConfig->live_path.'js/functions.js');

$document->addScript($jshopConfig->live_admin_path.'js/functions.js');

$document->addStyleSheet($jshopConfig->live_admin_path.'css/style.css');

$controller = JRequest::getCmd('controller');

if (!$controller) $controller = "panel";

if (file_exists(JPATH_COMPONENT.'/controllers/'.$controller.'.php'))

require_once( JPATH_COMPONENT.'/controllers/'.$controller.'.php' );

else

JError::raiseError( 403, JText::_('Access Forbidden') );

$classname = 'JshoppingController'.$controller;

$controller = new $classname();

$controller->execute(JRequest::getCmd('task'));

$controller->redirect();

?>

Также был использован текстовый формат, предназначенный для хранения структурированных данных (взамен существующих файлов баз данных), для обмена информацией между программами, а также для создания на его основе более специализированных языков разметки:

<metadata>

<menu>

<options var="controller">

<option name="Shop" value="category" msg="Main page of shop (list of root categories) or single category"/>

<option name="Basket" value="cart" msg="Shop basket"/>

<option name="Search" value="search" msg="Extended product search"/>

<option name="User" value="user" msg="Registration, Login, Logout, My account, Edit account, Orders"/>

<option name="Wishlist" value="wishlist" msg="Shop wishlist"/>

<option name="Products" value="products" msg="List products"/>

<option name="Manufacturers" value="manufacturer" msg="List or manufacturer"/>

<option name="Vendors" value="vendor" msg="List or vendor"/>

<option name="StaticPage" value="content" msg="Static text"/>

</options>

</menu>

<state switch="controller">

<category>

<url>

<param name="task" type="list" default="" label="Show" description="Page to show">

<option value="">Main page of shop</option>

<option value="view">Category</option>

</param>

<param name="category_id" type="text" default="" label="Category ID" description="Category ID"/>

</url>

</category>

<user>

<url>

<param name="task" type="list" default="" label="Show" description="Page to show">

<option value="register">Registration</option>

<option value="login">Login</option>

<option value="logout">Logout</option>

<option value="">My account</option>

<option value="editaccount">Edit account</option>

<option value="orders">Orders</option>

</param>

</url>

</user>

<manufacturer>

<url>

<param name="task" type="list" default="" label="Show" description="Page to show">

<option value="">Manufacturers list</option>

<option value="view">Manufacturer</option>

</param>

<param name="manufacturer_id" type="text" default="" label="Manufacturer ID" description="Manufacturer ID"/>

</url>

</manufacturer>

<products>

<url>

<param name="task" type="list" default="" label="Show" description="Page to show">

<option value="">All Products</option>

<option value="tophits">Top Hits</option>

<option value="toprating">Top Rating</option>

<option value="label">Label Products</option>

<option value="bestseller">Bestseller</option>

<option value="random">Random</option>

<option value="last">Last Products</option>

</param>

<param name="label_id" type="text" default="" label="Label ID" description="Label ID"/>

</url>

</products>

<vendor>

<url>

<param name="task" type="list" default="" label="Show" description="Page to show">

<option value="">Vendors list</option>

<option value="info">Vendor info</option>

</param>

<param name="vendor_id" type="text" default="" label="Vendor ID" description="Vendor ID"/>

</url>

</vendor>

<content>

<url>

<param name="task" type="hidden" default="view" label="task" description="task"/>

<param name="page" type="list" default="" label="Page" description="Page">

<option value="agb">Terms of Service</option>

<option value="return_policy">Return policy</option>

<option value="shipping">Shipping</option>

</param>

</url>

</content>

</state>

</metadata>

Код использования потребительской корзины:

<?php

/**

* @version 2.11.4 20.08.2012

* @author MAXXmarketing GmbH

* @package Jshopping

* @copyright Copyright (C) 2010 webdesigner-profi.de. All rights reserved.

* @license GNU/GPL

*/

defined('_JEXEC') or die('Restricted access');

error_reporting(E_ALL & ~E_NOTICE);

include_once(JPATH_ROOT . "/components/com_jshopping/lib/factory.php");

include_once(JPATH_ROOT . "/components/com_jshopping/lib/functions.php");

function jshoppingBuildRoute(&$query){

$segments = array();

JSFactory::loadLanguageFile();

$jshopConfig = &JSFactory::getConfig();

if (isset($query['controller'])){

$controller = $query['controller'];

}else{

$controller = "";

}

if ($jshopConfig->use_simple_sef==0 && $controller=="category" && isset($query['task']) && $query['task']=="view" && $query['category_id']){

$catalias = &JSFactory::getAliasCategory();

if (isset($catalias[$query['category_id']])){

$segments[] = $catalias[$query['category_id']];

unset( $query['controller'] );

unset( $query['task'] );

unset( $query['category_id'] );

}

}

if ($jshopConfig->use_simple_sef==0 && $controller=="manufacturer" && isset($query['task']) && $query['task']=="view" && $query['manufacturer_id']){

$manalias = &JSFactory::getAliasManufacturer();

if (isset($manalias[$query['manufacturer_id']])){

$segments[] = $manalias[$query['manufacturer_id']];

unset( $query['controller'] );

unset( $query['task'] );

unset( $query['manufacturer_id'] );

}

}

if ($jshopConfig->use_simple_sef==0 && $controller=="product" && isset($query['task']) && $query['task']=="view" && $query['category_id'] && $query['product_id']){

$catalias = &JSFactory::getAliasCategory();

$prodalias = &JSFactory::getAliasProduct();

if (isset($catalias[$query['category_id']]) && isset($prodalias[$query['product_id']])){

$segments[] = $catalias[$query['category_id']];

$segments[] = $prodalias[$query['product_id']];

unset( $query['controller'] );

unset( $query['task'] );

unset( $query['category_id'] );

unset( $query['product_id'] );

}

}

if(isset($query['controller'])) {

$segments[] = $query['controller'];

unset( $query['controller'] );

}

if(isset($query['task'])) {

$segments[] = $query['task'];

unset( $query['task'] );

}

if ($controller=="category" || $controller=="product"){

if(isset($query['category_id'])) {

$segments[] = $query['category_id'];

unset( $query['category_id'] );

}

if(isset($query['product_id'])) {

$segments[] = $query['product_id'];

unset( $query['product_id'] );

}

}

if ($controller=="manufacturer"){

if(isset($query['manufacturer_id'])) {

$segments[] = $query['manufacturer_id'];

unset( $query['manufacturer_id'] );

}

}

if ($controller=="content"){

if(isset($query['page'])) {

$segments[] = $query['page'];

unset( $query['page'] );

}

}

return $segments;

}

function jshoppingParseRoute($segments){

$vars = array();

JSFactory::loadLanguageFile();

$jshopConfig = &JSFactory::getConfig();

$db = &JFactory::getDBO();

$lang = &JSFactory::getLang();

$reservedFirstAlias = &JSFactory::getReservedFirstAlias();

$prev_lang = getPrevSelLang();

$current_lang = $jshopConfig->cur_lang;

if ($segments[0] && !in_array($segments[0], $reservedFirstAlias)){

$segments[0] = getSeoSegment($segments[0]);

if (isset($segments[1])){

$segments[1] = getSeoSegment($segments[1]);

}else{

$segments[1] = "";

}

$manufacturer_id = 0;

$product_id = 0;

$catalias = &JSFactory::getAliasCategory();

$category_id = array_search($segments[0], $catalias);

if (!$category_id && $prev_lang && $prev_lang!=$current_lang){

$dbquery = "select category_id from #__jshopping_categories where `alias_".$prev_lang."` = '".$db->getEscaped($segments[0])."'";

$db->setQuery($dbquery);

$category_id = $db->loadResult();

if ($category_id){

$GLOBALS["joomshoppinglangredirect"] = 1;

}

}

if ($category_id && $segments[1]!=""){

$prodalias = &JSFactory::getAliasProduct();

$product_id = array_search($segments[1], $prodalias);

if (!$product_id && $prev_lang && $prev_lang!=$current_lang){

$dbquery = "select product_id from #__jshopping_products where `alias_".$prev_lang."` = '".$db->getEscaped($segments[1])."'";

$db->setQuery($dbquery);

$product_id = $db->loadResult();

if ($product_id){

$GLOBALS["joomshoppinglangredirect"] = 1;

}

}

}

if (!$category_id && $segments[1]==""){

$manalias = &JSFactory::getAliasManufacturer();

$manufacturer_id = array_search($segments[0], $manalias);

if (!$manufacturer_id && $prev_lang && $prev_lang!=$current_lang){

$dbquery = "select manufacturer_id from #__jshopping_manufacturers where `alias_".$prev_lang."` = '".$db->getEscaped($segments[0])."'";

$db->setQuery($dbquery);

$manufacturer_id = $db->loadResult();

if ($manufacturer_id){

$GLOBALS["joomshoppinglangredirect"] = 1;

}

}

}

if ($category_id && $product_id){

$vars['controller'] = "product";

$vars['task'] = "view";

$vars['category_id'] = $category_id;

$vars['product_id'] = $product_id;

}elseif ($category_id){

$vars['controller'] = "category";

$vars['task'] = "view";

$vars['category_id'] = $category_id;

}

if ($manufacturer_id){

$vars['controller'] = "manufacturer";

$vars['task'] = "view";

$vars['manufacturer_id'] = $manufacturer_id;

}

if (!$category_id && !$manufacturer_id){

$vars['controller'] = "category";

}

}else{

$vars['controller'] = $segments[0];

$vars['task'] = $segments[1];

if ($vars['controller']=="category" && $vars['task']=="view"){

$vars['category_id'] = $segments[2];

}

if ($vars['controller']=="product" && $vars['task']=="view"){

$vars['category_id'] = $segments[2];

$vars['product_id'] = $segments[3];

}

if ($vars['controller']=="product" && $vars['task']=="ajax_attrib_select_and_price"){

$vars['product_id'] = $segments[2];

}

if ($vars['controller']=="manufacturer"){

$vars['manufacturer_id'] = $segments[2];

}

if ($vars['controller']=="content"){

$vars['page'] = $segments[2];

}

}

return $vars;

}

?>

Код компонентов портала:

<?php

/**

* @version $Id: application.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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.helper');

/**

* Joomla! Application class

*

* Provide many supporting API functions

*

* @package Joomla

* @final

*/

class JSite extends JApplication

{

/**

* Class constructor

*

* @access protected

* @param array An optional associative array of configuration settings.

* Recognized key values include 'clientId' (this list is not meant to be comprehensive).

*/

function __construct($config = array())

{

$config['clientId'] = 0;

parent::__construct($config);

}

/**

* Initialise the application.

*

* @access public

*/

function initialise( $options = array())

{

// if a language was specified it has priority

// otherwise use user or default language settings

if (empty($options['language']))

{

$user = & JFactory::getUser();

$lang = $user->getParam( 'language' );

// Make sure that the user's language exists

if ( $lang && JLanguage::exists($lang) ) {

$options['language'] = $lang;

} else {

$params = JComponentHelper::getParams('com_languages');

$client =& JApplicationHelper::getClientInfo($this->getClientId());

$options['language'] = $params->get($client->name, 'en-GB');

}

}

// One last check to make sure we have something

if ( ! JLanguage::exists($options['language']) ) {

$options['language'] = 'en-GB';

}

parent::initialise($options);

}

/**

* Route the application

*

* @access public

*/

function route() {

parent::route();

}

/**

* Dispatch the application

*

* @access public

*/

function dispatch($component)

{

$document =& JFactory::getDocument();

$user =& JFactory::getUser();

$router =& $this->getRouter();

$params =& $this->getParams();

switch($document->getType())

{

case 'html':

{

//set metadata

$document->setMetaData( 'keywords', $this->getCfg('MetaKeys') );

if ( $user->get('id') ) {

$document->addScript( JURI::root(true).'/includes/js/joomla.javascript.js');

}

if($router->getMode() == JROUTER_MODE_SEF) {

$document->setBase(JURI::current());

}

} break;

case 'feed':

{

$document->setBase(JURI::current());

} break;

default: break;

}

$document->setTitle( $params->get('page_title') );

$document->setDescription( $params->get('page_description') );

$contents = JComponentHelper::renderComponent($component);

$document->setBuffer( $contents, 'component');

}

/**

* Display the application.

*

* @access public

*/

function render()

{

$document =& JFactory::getDocument();

$user =& JFactory::getUser();

// get the format to render

$format = $document->getType();

switch($format)

{

case 'feed' :

{

$params = array();

} break;

case 'html' :

default :

{

$template = $this->getTemplate();

$file = JRequest::getCmd('tmpl', 'index');

if ($this->getCfg('offline') && $user->get('gid') < '23' ) {

$file = 'offline';

}

if (!is_dir( JPATH_THEMES.DS.$template ) && !$this->getCfg('offline')) {

$file = 'component';

}

$params = array(

'template' => $template,

'file' => $file.'.php',

'directory' => JPATH_THEMES

);

} break;

}

$data = $document->render( $this->getCfg('caching'), $params);

JResponse::setBody($data);

}

/**

* Login authentication function

*

* @param array Array( 'username' => string, 'password' => string )

* @param array Array( 'remember' => boolean )

* @access public

* @see JApplication::login

*/

function login($credentials, $options = array())

{

//Set the application login entry point

if(!array_key_exists('entry_url', $options)) {

$options['entry_url'] = JURI::base().'index.php?option=com_user&task=login';

}

return parent::login($credentials, $options);

}

/**

* Check if the user can access the application

*

* @access public

*/

function authorize($itemid)

{

$menus =& JSite::getMenu();

$user =& JFactory::getUser();

$aid = $user->get('aid');

if(!$menus->authorize($itemid, $aid))

{

if ( ! $aid )

{

// Redirect to login

$uri = JFactory::getURI();

$return = $uri->toString();

$url = 'index.php?option=com_user&view=login';

$url .= '&return='.base64_encode($return);;

//$url = JRoute::_($url, false);

$this->redirect($url, JText::_('You must login first') );

}

else

{

JError::raiseError( 403, JText::_('ALERTNOTAUTH') );

}

}

}

/**

* Get the appliaction parameters

*

* @param string The component option

* @return object The parameters object

* @since 1.5

*/

function &getParams($option = null)

{

static $params = array();

$hash = '__default';

if(!empty($option)) $hash = $option;

if (!isset($params[$hash]))

{

// Get component parameters

if (!$option) {

$option = JRequest::getCmd('option');

}

$params[$hash] =& JComponentHelper::getParams($option);

// Get menu parameters

$menus =& JSite::getMenu();

$menu = $menus->getActive();

$title = htmlspecialchars_decode($this->getCfg('sitename' ));

$description = $this->getCfg('MetaDesc');

// Lets cascade the parameters if we have menu item parameters

if (is_object($menu))

{

$params[$hash]->merge(new JParameter($menu->params));

$title = $menu->name;

}

$params[$hash]->def( 'page_title' , $title );

$params[$hash]->def( 'page_description', $description );

}

return $params[$hash];

}

/**

* Get the appliaction parameters

*

* @param string The component option

* @return object The parameters object

* @since 1.5

*/

function &getPageParameters( $option = null )

{

return $this->getParams( $option );

}

/**

* Get the template

*

* @return string The template name

* @since 1.0

*/

function getTemplate()

{

// Allows for overriding the active template from a component, and caches the result of this function

// e.g. $mainframe->setTemplate('solar-flare-ii');

if ($template = $this->get('setTemplate')) {

return $template;

}

// Get the id of the active menu item

$menu =& JSite::getMenu();

$item = $menu->getActive();

$id = 0;

if(is_object($item)) { // valid item retrieved

$id = $item->id;

}

// Load template entries for the active menuid and the default template

$db =& JFactory::getDBO();

$query = 'SELECT template'

. ' FROM #__templates_menu'

. ' WHERE client_id = 0 AND (menuid = 0 OR menuid = '.(int) $id.')'

. ' ORDER BY menuid DESC'

;

$db->setQuery($query, 0, 1);

$template = $db->loadResult();

// Allows for overriding the active template from the request

$template = JRequest::getCmd('template', $template);

$template = JFilterInput::clean($template, 'cmd'); // need to filter the default value as well

// Fallback template

if (!file_exists(JPATH_THEMES.DS.$template.DS.'index.php')) {

$template = 'rhuk_milkyway';

}

// Cache the result

$this->set('setTemplate', $template);

return $template;

}

/**

* Overrides the default template that would be used

*

* @param string The template name

*/

function setTemplate( $template )

{

if (is_dir(JPATH_THEMES.DS.$template)) {

$this->set('setTemplate', $template);

}

}

/**

* Return a reference to the JPathway object.

*

* @access public

* @return object JPathway.

* @since 1.5

*/

function &getMenu()

{

$options = array();

$menu =& parent::getMenu('site', $options);

return $menu;

}

/**

* Return a reference to the JPathway object.

*

* @access public

* @return object JPathway.

* @since 1.5

*/

function &getPathWay()

{

$options = array();

$pathway =& parent::getPathway('site', $options);

return $pathway;

}

/**

* Return a reference to the JRouter object.

*

* @access public

* @return JRouter.

* @since 1.5

*/

function &getRouter()

{

$config =& JFactory::getConfig();

$options['mode'] = $config->getValue('config.sef');

$router =& parent::getRouter('site', $options);

return $router;

}

}

<?php

/**

* Legacy Mode compatibility

* @version $Id: database.mysqli.php 10381 2008-06-01 03:35:53Z pasamio $

* @package Joomla.Legacy

* @deprecated As of version 1.5

*/

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.database.database' );

jimport( 'joomla.database.database.mysqli' );

/**

* @package Joomla

* @deprecated As of version 1.5

*/

class database extends JDatabase {

function __construct ($host='localhost', $user, $pass, $db='', $table_prefix='', $offline = true) {

parent::__construct( 'mysqli', $host, $user, $pass, $db, $table_prefix );

}

}

?>

<?php

/**

* Legacy Mode compatibility

* @version $Id: database.php 10381 2008-06-01 03:35:53Z pasamio $

* @package Joomla.Legacy

* @deprecated As of version 1.5

*/

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

require_once( dirname(__FILE__) .'/../libraries/loader.php' );

jimport( 'joomla.database.database' );

jimport( 'joomla.database.database.mysql' );

/**

* Legacy class, derive from JDatabase instead.

*

* @package Joomla

* @deprecated As of version 1.5

*/

class database extends JDatabase {

function __construct ($host='localhost', $user, $pass, $db='', $table_prefix='', $offline = true) {

parent::__construct( 'mysql', $host, $user, $pass, $db, $table_prefix );

}

}

<?php

/**

* @version $Id: defines.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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' );

/**

* Joomla! Application define

*/

//Global definitions

//Joomla framework path definitions

$parts = explode( DS, JPATH_BASE );

//Defines

define( 'JPATH_ROOT', implode( DS, $parts ) );

define( 'JPATH_SITE', JPATH_ROOT );

define( 'JPATH_CONFIGURATION', JPATH_ROOT );

define( 'JPATH_ADMINISTRATOR', JPATH_ROOT.DS.'administrator' );

define( 'JPATH_XMLRPC', JPATH_ROOT.DS.'xmlrpc' );

define( 'JPATH_LIBRARIES', JPATH_ROOT.DS.'libraries' );

define( 'JPATH_PLUGINS', JPATH_ROOT.DS.'plugins' );

define( 'JPATH_INSTALLATION', JPATH_ROOT.DS.'installation' );

define( 'JPATH_THEMES' , JPATH_BASE.DS.'templates' );

define( 'JPATH_CACHE', JPATH_BASE.DS.'cache');

<?php

/**

* @version $Id: footer.php 14401 2010-01-26 14:10:00Z louis $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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' );

$version = new JVersion();

// NOTE - You may change this file to suit your site needs

?>

<div align="center">

© <?php echo JHTML::_('date', 'now', '%Y' ) . ' ' . $mainframe->getCfg('sitename'); ?>

</div>

<div align="center">

<?php echo $version->URL; ?>

</div>

<?php

/**

* @version $Id: framework.php 19058 2010-10-08 04:15:39Z dextercowley $

* @package Joomla

* @copyright Copyright (C) 2005 - 2010 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' );

/*

* Joomla! system checks

*/

@set_magic_quotes_runtime( 0 );

@ini_set('zend.ze1_compatibility_mode', '0');

/*

* Installation check, and check on removal of the install directory.

*/

if (!file_exists( JPATH_CONFIGURATION . DS . 'configuration.php' ) || (filesize( JPATH_CONFIGURATION . DS . 'configuration.php' ) < 10) || file_exists( JPATH_INSTALLATION . DS . 'index.php' )) {

if( file_exists( JPATH_INSTALLATION . DS . 'index.php' ) ) {

header( 'Location: installation/index.php' );

exit();

} else {

echo 'No configuration file found and no installation code available. Exiting...';

exit();

}

}

/*

* Joomla! system startup

*/

// System includes

require_once( JPATH_LIBRARIES .DS.'joomla'.DS.'import.php');

// Pre-Load configuration

require_once( JPATH_CONFIGURATION .DS.'configuration.php' );

// System configuration

$CONFIG = new JConfig();

if (@$CONFIG->error_reporting === 0) {

error_reporting( 0 );

} else if (@$CONFIG->error_reporting > 0) {

error_reporting( $CONFIG->error_reporting );

ini_set( 'display_errors', 1 );

}

define( 'JDEBUG', $CONFIG->debug );

unset( $CONFIG );

/*

* Joomla! framework loading

*/

// Include object abstract class

require_once(JPATH_SITE.DS.'libraries'.DS.'joomla'.DS.'utilities'.DS.'compat'.DS.'compat.php');

// System profiler

if (JDEBUG) {

jimport( 'joomla.error.profiler' );

$_PROFILER =& JProfiler::getInstance( 'Application' );

}

// Joomla! library imports;

jimport( 'joomla.application.menu' );

jimport( 'joomla.user.user');

jimport( 'joomla.environment.uri' );

jimport( 'joomla.html.html' );

jimport( 'joomla.utilities.utility' );

jimport( 'joomla.event.event');

jimport( 'joomla.event.dispatcher');

jimport( 'joomla.language.language');

jimport( 'joomla.utilities.string' );

?>

Код структуры меню:

<?php

/**

* @version $Id: menu.php 8682 2007-08-31 18:36:45Z jinx $

* @package Joomla.Framework

* @subpackage Application

* @copyright Copyright (C) 2005 - 2010 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.

*/

// Check to ensure this file is within the rest of the framework

defined('JPATH_BASE') or die();

/**

* JMenu class

*

* @package Joomla.Framework

* @subpackage Application

* @since 1.5

*/

class JMenuSite extends JMenu

{

/**

* Loads the entire menu table into memory

*

* @access public

* @return array

*/

function load()

{

$cache = &JFactory::getCache('_system', 'output');

if (!$data = $cache->get('menu_items')) {

// Initialize some variables

$db = & JFactory::getDBO();

$sql = 'SELECT m.*, c.`option` as component' .

' FROM #__menu AS m' .

' LEFT JOIN #__components AS c ON m.componentid = c.id'.

' WHERE m.published = 1'.

' ORDER BY m.sublevel, m.parent, m.ordering';

$db->setQuery($sql);

if (!($menus = $db->loadObjectList('id'))) {

JError::raiseWarning('SOME_ERROR_CODE', "Error loading Menus: ".$db->getErrorMsg());

return false;

}

foreach($menus as $key => $menu)

{

//Get parent information

$parent_route = '';

$parent_tree = array();

if(($parent = $menus[$key]->parent) && (isset($menus[$parent])) &&

(is_object($menus[$parent])) && (isset($menus[$parent]->route)) && isset($menus[$parent]->tree)) {

$parent_route = $menus[$parent]->route.'/';

$parent_tree = $menus[$parent]->tree;

}

//Create tree

array_push($parent_tree, $menus[$key]->id);

$menus[$key]->tree = $parent_tree;

//Create route

$route = $parent_route.$menus[$key]->alias;

$menus[$key]->route = $route;

//Create the query array

$url = str_replace('index.php?', '', $menus[$key]->link);

if(strpos($url, '&') !== false)

{

$url = str_replace('&','&',$url);

}

parse_str($url, $menus[$key]->query);

}

$cache->store(serialize($menus), 'menu_items');

$this->_items = $menus;

} else {

$this->_items = unserialize($data);

}

}

}

Код шаблона :

<?php /**  * @package    Joomla.Site  * @subpackage  Templates.beez5  * @copyright  Copyright (C) 2005 - 2012 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; // check modules $showRightColumn  = ($this->countModules('position-3') or $this->countModules('position-6') or $this->countModules('position-8')); $showbottom      = ($this->countModules('position-9') or $this->countModules('position-10') or $this->countModules('position-11')); $showleft      = ($this->countModules('position-4') or $this->countModules('position-7') or $this->countModules('position-5')); if ($showRightColumn==0 and $showleft==0) {   $showno = 0; } JHtml::_('behavior.framework', true); // get params $color      = $this->params->get('templatecolor'); $logo      = $this->params->get('logo'); $navposition  = $this->params->get('navposition'); $app      = JFactory::getApplication(); $doc      = JFactory::getDocument(); $templateparams  = $app->getTemplate(true)->params; $doc->addScript($this->baseurl.'/templates/'.$this->template.'/javascript/md_stylechanger.js', 'text/javascript', true); ?> <?php if(!$templateparams->get('html5', 0)): ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php else: ?>   <?php echo '<!DOCTYPE html>'; ?> <?php endif; ?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >   <head>     <jdoc:include type="head" />     <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />     <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/position.css" type="text/css"media="screen,projection" />     <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/layout.css" type="text/css"media="screen,projection" />     <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/print.css" type="text/css" media="Print" />     <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/beez5.css" type="text/css" /> <?php   $files = JHtml::_('stylesheet', 'templates/'.$this->template.'/css/general.css', null, false, true);   if ($files):     if (!is_array($files)):       $files = array($files);     endif;     foreach($files as $file): ?>     <link rel="stylesheet" href="<?php echo $file;?>" type="text/css" /> <?php      endforeach;   endif; ?>     <?php if ($this->direction == 'rtl') : ?>     <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template_rtl.css" type="text/css" />     <?php endif; ?>     <!--[if lte IE 6]>       <link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/ieonly.css" rel="stylesheet" type="text/css" />     <![endif]-->     <!--[if IE 7]>       <link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/ie7only.css" rel="stylesheet" type="text/css" />     <![endif]--> <?php if($templateparams->get('html5', 0)) { ?>     <!--[if lt IE 9]>       <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/javascript/html5.js"></script>     <![endif]--> <?php } ?>     <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/javascript/hide.js"></script>     <script type="text/javascript">       var big ='<?php echo (int)$this->params->get('wrapperLarge');?>%';       var small='<?php echo (int)$this->params->get('wrapperSmall'); ?>%';       var altopen='<?php echo JText::_('TPL_BEEZ5_ALTOPEN', true); ?>';       var altclose='<?php echo JText::_('TPL_BEEZ5_ALTCLOSE', true); ?>';       var bildauf='<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/images/plus.png';       var bildzu='<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/images/minus.png';       var rightopen='<?php echo JText::_('TPL_BEEZ5_TEXTRIGHTOPEN', true); ?>';       var rightclose='<?php echo JText::_('TPL_BEEZ5_TEXTRIGHTCLOSE', true); ?>';       var fontSizeTitle='<?php echo JText::_('TPL_BEEZ5_FONTSIZE', true); ?>';             var bigger='<?php echo JText::_('TPL_BEEZ5_BIGGER', true); ?>';             var reset='<?php echo JText::_('TPL_BEEZ5_RESET', true); ?>';             var smaller='<?php echo JText::_('TPL_BEEZ5_SMALLER', true); ?>';             var biggerTitle='<?php echo JText::_('TPL_BEEZ5_INCREASE_SIZE', true); ?>';             var resetTitle='<?php echo JText::_('TPL_BEEZ5_REVERT_STYLES_TO_DEFAULT', true); ?>';             var smallerTitle='<?php echo JText::_('TPL_BEEZ5_DECREASE_SIZE', true); ?>';     </script>   </head>   <body> <div id="all">   <div id="back">   <?php if(!$templateparams->get('html5', 0)): ?>     <div id="header">       <?php else: ?>     <header id="header">       <?php endif; ?>         <div class="logoheader">           <h1 id="logo">           <?php if ($logo != null ): ?>           <img src="<?php echo $this->baseurl ?>/<?php echo htmlspecialchars($logo); ?>" alt="<?php echo htmlspecialchars($templateparams->get('sitetitle'));?>" />           <?php else: ?>           <?php echo htmlspecialchars($templateparams->get('sitetitle'));?>           <?php endif; ?>                    </div><!-- end logoheader -->           <ul class="skiplinks">             <li><a href="#main" class="u2"><?php echo JText::_('TPL_BEEZ5_SKIP_TO_CONTENT'); ?></a></li>             <li><a href="#nav" class="u2"><?php echo JText::_('TPL_BEEZ5_JUMP_TO_NAV'); ?></a></li>             <?php if($showRightColumn ):?>             <li><a href="#additional" class="u2"><?php echo JText::_('TPL_BEEZ5_JUMP_TO_INFO'); ?></a></li>             <?php endif; ?>           </ul>           <h2 class="unseen"><?php echo JText::_('TPL_BEEZ5_NAV_VIEW_SEARCH'); ?></h2>           <h3 class="unseen"><?php echo JText::_('TPL_BEEZ5_NAVIGATION'); ?></h3>           <jdoc:include type="modules" name="position-1" />           <div id="line">           <div id="fontsize"></div>           <h3 class="unseen"><?php echo JText::_('TPL_BEEZ5_SEARCH'); ?></h3>           <jdoc:include type="modules" name="position-0" />           </div> <!-- end line -->     <div id="header-image">       <jdoc:include type="modules" name="position-15" />       <?php if ($this->countModules('position-15')==0): ?>         <img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/images/fruits.jpg"  alt="<?php echo JText::_('TPL_BEEZ5_LOGO'); ?>" />       <?php endif; ?>     </div>     <?php if (!$templateparams->get('html5', 0)): ?>       </div><!-- end header -->     <?php else: ?>       </header><!-- end header -->     <?php endif; ?>     <div id="<?php echo $showRightColumn ? 'contentarea2' : 'contentarea'; ?>">           <div id="breadcrumbs">               <jdoc:include type="modules" name="position-2" />           </div>           <?php if ($navposition=='left' and $showleft) : ?>             <?php if(!$this->params->get('html5', 0)): ?>               <div class="left1 <?php if ($showRightColumn==NULL){ echo 'leftbigger';} ?>" id="nav">             <?php else: ?>               <nav class="left1 <?php if ($showRightColumn==NULL){ echo 'leftbigger';} ?>" id="nav">             <?php endif; ?>                 <jdoc:include type="modules" name="position-7" style="beezDivision" headerLevel="3" />                 <jdoc:include type="modules" name="position-4" style="beezHide" headerLevel="3" state="0 " />                 <jdoc:include type="modules" name="position-5" style="beezTabs" headerLevel="2"  id="3" />             <?php if(!$this->params->get('html5', 0)): ?>               </div><!-- end navi -->             <?php else: ?>               </nav>             <?php endif; ?>           <?php endif; ?>           <div id="<?php echo $showRightColumn ? 'wrapper' : 'wrapper2'; ?>" <?php if (isset($showno)){echo 'class="shownocolumns"';}?>>             <div id="main">             <?php if ($this->countModules('position-12')): ?>               <div id="top"><jdoc:include type="modules" name="position-12"   />               </div>             <?php endif; ?>               <jdoc:include type="message" />               <jdoc:include type="component" />             </div><!-- end main -->           </div><!-- end wrapper -->         <?php if ($showRightColumn) : ?>           <h2 class="unseen">             <?php echo JText::_('TPL_BEEZ5_ADDITIONAL_INFORMATION'); ?>           </h2>           <div id="close">             <a href="#" onclick="auf('right')">               <span id="bild">                 <?php echo JText::_('TPL_BEEZ5_TEXTRIGHTCLOSE'); ?></span></a>           </div>         <?php if (!$templateparams->get('html5', 0)): ?>           <div id="right">         <?php else: ?>           <aside id="right">         <?php endif; ?>             <a id="additional"></a>             <jdoc:include type="modules" name="position-6" style="beezDivision" headerLevel="3"/>             <jdoc:include type="modules" name="position-8" style="beezDivision" headerLevel="3"  />             <jdoc:include type="modules" name="position-3" style="beezDivision" headerLevel="3"  />         <?php if(!$templateparams->get('html5', 0)): ?>           </div><!-- end right -->         <?php else: ?>           </aside>         <?php endif; ?>       <?php endif; ?>       <?php if ($navposition=='center' and $showleft) : ?>         <?php if (!$this->params->get('html5', 0)): ?>           <div class="left <?php if ($showRightColumn==NULL){ echo 'leftbigger';} ?>" id="nav" >         <?php else: ?>           <nav class="left <?php if ($showRightColumn==NULL){ echo 'leftbigger';} ?>" id="nav">         <?php endif; ?>             <jdoc:include type="modules" name="position-7"  style="beezDivision" headerLevel="3" />             <jdoc:include type="modules" name="position-4" style="beezHide" headerLevel="3" state="0 " />             <jdoc:include type="modules" name="position-5" style="beezTabs" headerLevel="2"  id="3" />         <?php if (!$templateparams->get('html5', 0)): ?>           </div><!-- end navi -->         <?php else: ?>           </nav>         <?php endif; ?>       <?php endif; ?>           <div class="wrap"></div>         </div> <!-- end contentarea -->       </div><!-- back -->     </div><!-- all -->     <div id="footer-outer">     <?php if ($showbottom) : ?>       <div id="footer-inner">         <div id="bottom">           <?php if ($this->countModules('position-9')): ?>           <div class="box box1"> <jdoc:include type="modules" name="position-9" style="beezDivision" headerlevel="3" /></div>           <?php endif; ?>              <?php if ($this->countModules('position-10')): ?>           <div class="box box2"> <jdoc:include type="modules" name="position-10" style="beezDivision" headerlevel="3" /></div>           <?php endif; ?>           <?php if ($this->countModules('position-11')): ?>           <div class="box box3"> <jdoc:include type="modules" name="position-11" style="beezDivision" headerlevel="3" /></div>           <?php endif ; ?>         </div>       </div>     <?php endif ; ?>       <div id="footer-sub">       <?php if (!$templateparams->get('html5', 0)): ?>         <div id="footer">       <?php else: ?>         <footer id="footer">       <?php endif; ?>           <jdoc:include type="modules" name="position-14" />           <p>             <?php echo JText::_('TPL_BEEZ5_POWERED_BY');?> <a href="http://www.joomla.org/">Joomla!®</a>           </p>       <?php if (!$templateparams->get('html5', 0)): ?>         </div><!-- end footer -->       <?php else: ?>         </footer>       <?php endif; ?>       </div>     </div>     <jdoc:include type="modules" name="debug" />   </body> </html>