Файловый менеджер - Редактировать - /var/www/html/components/com_kunena/src/Controller/Application/Misc/Initial/MiscDisplay.php
Ðазад
<?php /** * Kunena Component * * @package Kunena.Site * @subpackage Controller.Application * * @copyright Copyright (C) 2008 - 2026 Kunena Team. All rights reserved. * @license https://www.gnu.org/copyleft/gpl.html GNU/GPL * @link https://www.kunena.org **/ namespace Kunena\Forum\Site\Controller\Application\Misc\Initial; \defined('_JEXEC') or die(); use Exception; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Kunena\Forum\Libraries\Controller\Application\Display; use Kunena\Forum\Libraries\Layout\KunenaLayout; use Kunena\Forum\Libraries\Layout\KunenaPage; use Kunena\Forum\Libraries\Route\KunenaRoute; use Kunena\Forum\Libraries\Controller\KunenaController; use RuntimeException; /** * Class ComponentKunenaControllerApplicationMiscDisplay * * @since Kunena 4.0 */ class MiscDisplay extends Display { /** * @var string * @since Kunena 6.0 */ public $header = ''; /** * @var string * @since Kunena 6.0 */ public $body; /** * Return custom display layout. * * @return KunenaLayout * * @since Kunena 6.0 * * @throws Exception */ protected function display() { $menu_item = $this->app->getMenu()->getActive(); $componentParams = ComponentHelper::getParams('com_config'); $robots = $componentParams->get('robots'); if ($robots == 'noindex, follow') { $this->setMetaData('robots', 'noindex, follow'); } elseif ($robots == 'index, nofollow') { $this->setMetaData('robots', 'index, nofollow'); } elseif ($robots == 'noindex, nofollow') { $this->setMetaData('robots', 'noindex, nofollow'); } else { $this->setMetaData('robots', 'index, follow'); } if ($menu_item) { $params = $menu_item->getParams(); $params_title = $params->get('page_title'); $params_description = $params->get('menu-meta_description'); $params_robots = $params->get('robots'); if (!empty($params_title)) { $title = $params->get('page_title'); $this->setTitle($title); } else { $title = $this->config->boardTitle; $this->setTitle($title); } if (!empty($params_description)) { $description = $params->get('menu-meta_description'); $this->setDescription($description); } else { $description = $this->config->boardTitle; $this->setDescription($description); } if (!empty($params_robots)) { $robots = $params->get('robots'); $this->setMetaData('robots', $robots); } } // Display layout with given parameters. return KunenaPage::factory('Misc/Default') ->set('header', $this->header) ->set('body', $this->body); } /** * Prepare custom text output. * * @return void * * @since Kunena 6.0 * * @throws Exception * @throws null */ protected function before() { parent::before(); $params = $this->app->getParams('com_kunena'); $this->header = $params->get('page_title'); $Itemid = $this->input->getInt('Itemid'); if (!$Itemid) { try { if ($this->config->customId) { $itemid = $this->config->customId; } else { $menu = $this->app->getMenu(); $getid = $menu->getItem(KunenaRoute::getItemID("index.php?option=com_kunena&view=misc")); $itemid = $getid->id; } if (!$itemid) { $itemid = KunenaRoute::fixMissingItemID(); } $params = [ 'option' => 'com_kunena', 'view' => 'misc', 'Itemid' => $itemid ]; return $this->app->redirect(KunenaRoute::_('index.php?' . http_build_query($params), false)); } catch (Exception $e) { throw new RuntimeException('Failed to create controller: ' . $e->getMessage()); } } $body = $params->get('body'); $format = $params->get('body_format'); if ($this->header === null) { $this->header = ''; } $this->header = htmlspecialchars($this->header, ENT_COMPAT, 'UTF-8'); if ($format == 'html') { $this->body = trim($body); } elseif ($format == 'text') { $this->body = htmlspecialchars($body, ENT_COMPAT, 'UTF-8'); } else { $options = ['defaultgroup' => 'com_kunena']; $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController('callback', $options); $cache->setLifeTime(180); $this->body = $cache->get(['Kunena\Forum\Libraries\Html\KunenaParser', 'parseBBCode'], [$body]); } } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка