joomla_test/templates/as002036free/includes/includes.php

98 lines
2.3 KiB
PHP
Raw Permalink Normal View History

2020-01-02 22:20:31 +07:00
<?php
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$user = JFactory::getUser(); // Add current user information
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = $app->getCfg('sitename');
$template = $app->getTemplate();
$contentParams = $app->getParams('com_content');
$pageClass = $contentParams->get('pageclass_sfx');
// Logo file
if ($this->params->get('logo_img'))
{
$logo_img = JURI::root() . $this->params->get('logo_img');
}
else
{
$logo_img = $this->baseurl . "/templates/" . $this->template . "/images/logo.png";
}
if ($this->params->get('splash_logo_img'))
{
$splash_logo_img = JURI::root() . $this->params->get('splash_logo_img');
}
else
{
$splash_logo_img = $this->baseurl . "/templates/" . $this->template . "/images/logo.splash.png";
}
// Site title
$slogan_txt = htmlspecialchars($this->params->get('slogan_txt'));
// If Right-to-Left
if ($this->direction == 'rtl'){
$doc->addStyleSheet('media/jui/css/bootstrap-rtl.css');
}
//Hide module as-positions
//By View (article, login, registration, search, profile, reset, remind etc)
$hideByView = false;
switch($view){
case 'article':
case 'login':
case 'search':
case 'profile':
case 'registration':
case 'reset':
case 'remind':
case 'contact':
case 'form':
$hideByView = true;
break;
}
//By Component
$hideByOption = false;
switch($option){
case 'com_users':
case 'com_search':
case 'com_contact':
$hideByOption = true;
break;
}
//Get main content width
//Get Left column grid width
if(($this->countModules('as-position-10') || $this->countModules('as-position-11')) && $layout !== 'edit')
{
$aside_left_width = $this->params->get('aside_left_width');
}
else
{
$aside_left_width = "";
}
//Get Right column grid width
if(($this->countModules('as-position-15') || $this->countModules('as-position-16')) && $layout !== 'edit')
{
$aside_right_width = $this->params->get('aside_right_width');
}
else
{
$aside_right_width = "";
}
$mainContentWidth = 12 - ($aside_left_width + $aside_right_width);