|
Server : Apache System : Linux vps.urbanovitalino.adv.br 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 User : urbanovitalinoad ( 1001) PHP Version : 7.3.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/urbanovitalinoad/public_html/next/components/com_speasyimagegallery/views/album/ |
Upload File : |
<?php
/**
* @package com_speasyimagegallery
* @author JoomShaper http://www.joomshaper.com
* @copyright Copyright (c) 2010 - 2021 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView;
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
jimport('joomla.application.component.helper');
class SpeasyimagegalleryViewAlbum extends HtmlView
{
protected $item;
protected $params;
function display($tpl = null)
{
// Assign data to the view
$this->item = $this->get('Item');
$app = Factory::getApplication();
$this->params = $app->getParams();
$menus = Factory::getApplication()->getMenu();
$menu = $menus->getActive();
if($menu) {
$this->params->merge($menu->getParams());
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new \Exception(implode("\n", $errors), 500);
return false;
}
$model = $this->getModel();
$model->hit();
$this->_prepareDocument($this->item);
parent::display($tpl);
}
protected function _prepareDocument($item)
{
$app = Factory::getApplication();
$title = null;
// Because the application sets a default page title,
$this->params->def('page_heading', $item->title);
$title = $item->title;
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = Text::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = Text::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if (isset($this->item->metadesc) && $this->item->metadesc)
{
$this->document->setDescription($this->item->metadesc);
}
if (isset($this->item->metakey) && $this->item->metakey)
{
$this->document->setMetadata('keywords', $this->item->metakey);
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}
}
}