__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @package Gantry5
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2022 RocketTheme, LLC
* @license GNU/GPLv2 and later
*
* http://www.gnu.org/licenses/gpl-2.0.html
*/
namespace Gantry\Framework;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
/**
* Class Page
* @package Gantry\Framework
*/
class Page extends Base\Page
{
/** @var bool */
public $home;
/** @var string */
public $outline;
/** @var string */
public $language;
/** @var string */
public $direction;
// Joomla specific properties.
/** @var string */
public $tmpl;
/** @var string */
public $option;
/** @var string */
public $view;
/** @var string */
public $layout;
/** @var string */
public $task;
/** @var string */
public $theme;
/** @var string */
public $baseUrl;
/** @var string */
public $sitename;
/** @var string */
public $title;
/** @var string */
public $description;
/** @var string */
public $class;
/** @var string */
public $printing;
/** @var int */
public $itemid;
/**
* Page constructor.
* @param Gantry $container
* @throws \Exception
*/
public function __construct($container)
{
parent::__construct($container);
/** @var CMSApplication $application */
$application = Factory::getApplication();
$input = $application->input;
$this->tmpl = $input->getCmd('tmpl', '');
$this->option = $input->getCmd('option', '');
$this->view = $input->getCmd('view', '');
$this->layout = $input->getCmd('layout', '');
$this->task = $input->getCmd('task', '');
$this->itemid = $input->getInt('Itemid', 0);
$this->printing = $input->getCmd('print', '');
$this->class = '';
if ($this->itemid) {
$menu = $application->getMenu();
$menuItem = $menu ? $menu->getActive() : null;
if ($menuItem && $menuItem->id) {
$this->home = (bool) $menuItem->home;
$this->class = $menuItem->getParams()->get('pageclass_sfx', '');
}
}
$templateParams = $application->getTemplate(true);
$this->outline = Gantry::instance()['configuration'];
$this->sitename = $application->get('sitename');
$this->theme = $templateParams->template;
$this->baseUrl = Uri::base(true);
// Document doesn't exist in error page if modern routing is being used.
$document = isset($container['platform']->document) ? $container['platform']->document : $application->getDocument();
if ($document) {
$this->title = $document->title;
$this->description = $document->description;
// Document has lower case language code, which causes issues with some JS scripts (Snipcart). Use tag instead.
$code = explode('-', $document->getLanguage(), 2);
$language = array_shift($code);
$country = strtoupper(array_shift($code));
$this->language = $language . ($country ? '-' . $country : '');
$this->direction = $document->direction;
}
}
/**
* @param array $args
* @return string
*/
public function url(array $args = [])
{
$url = Uri::getInstance();
foreach ($args as $key => $val) {
$url->setVar($key, $val);
}
return $url->toString();
}
/**
* @return string
*/
public function htmlAttributes()
{
$attributes = [
'lang' => $this->language,
'dir' => $this->direction
]
+ (array) $this->config->get('page.html', []);
return $this->getAttributes($attributes);
}
/**
* @param array $attributes
* @return string
*/
public function bodyAttributes($attributes = [])
{
if ($this->tmpl === 'component') {
if (version_compare(JVERSION, '4.0', '<')) {
$classes = ['contentpane', 'modal'];
}
} else {
$classes = ['site', $this->option, "view-{$this->view}"];
$classes[] = $this->layout ? 'layout-' . $this->layout : 'no-layout';
$classes[] = $this->task ? 'task-' . $this->task : 'no-task';
}
$classes[] = 'dir-' . $this->direction;
if ($this->class) $classes[] = $this->class;
if ($this->printing) $classes[] = 'print-mode';
if ($this->itemid) $classes[] = 'itemid-' . $this->itemid;
if ($this->outline) $classes[] = 'outline-' . $this->outline;
$baseAttributes = (array) $this->config->get('page.body.attribs', []);
if (!empty($baseAttributes['class'])) {
$baseAttributes['class'] = array_merge((array) $baseAttributes['class'], $classes);
} else {
$baseAttributes['class'] = $classes;
}
return $this->getAttributes($baseAttributes, $attributes);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Base | Folder | 0775 |
|
|
| Markdown | Folder | 0775 |
|
|
| Services | Folder | 0775 |
|
|
| Assignments.php | File | 6.5 KB | 0664 |
|
| Atoms.php | File | 9.32 KB | 0664 |
|
| Configurations.php | File | 472 B | 0664 |
|
| Document.php | File | 12.24 KB | 0664 |
|
| Exception.php | File | 1.16 KB | 0664 |
|
| Exporter.php | File | 18.62 KB | 0664 |
|
| Gantry.php | File | 1.69 KB | 0664 |
|
| Menu.php | File | 27.34 KB | 0664 |
|
| Outlines.php | File | 9.06 KB | 0664 |
|
| Page.php | File | 5.02 KB | 0664 |
|
| Platform.php | File | 22.04 KB | 0664 |
|
| Positions.php | File | 558 B | 0664 |
|
| Request.php | File | 547 B | 0664 |
|
| Site.php | File | 1.03 KB | 0664 |
|
| Theme.php | File | 6.56 KB | 0664 |
|
| ThemeInstaller.php | File | 19.48 KB | 0664 |
|
| Translator.php | File | 731 B | 0664 |
|