Файловый менеджер - Редактировать - /var/www/html/components/com_kunena/src/Controller/Announcement/Listing/AnnouncementListingDisplay.php
Ðазад
<?php /** * Kunena Component * * @package Kunena.Site * @subpackage Controller.Announcement * * @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\Announcement\Listing; \defined('_JEXEC') or die(); use Exception; use Joomla\CMS\Language\Text; use Kunena\Forum\Libraries\Controller\KunenaControllerDisplay; use Kunena\Forum\Libraries\Forum\Announcement\KunenaAnnouncementHelper; use Kunena\Forum\Libraries\Pagination\KunenaPagination; use Kunena\Forum\Libraries\Route\KunenaRoute; use Kunena\Forum\Libraries\User\KunenaUserHelper; use RuntimeException; /** * Class AnnouncementListingDisplay * * @since Kunena 4.0 */ class AnnouncementListingDisplay extends KunenaControllerDisplay { /** * @var string * @since Kunena 6.0 */ public $announcements; /** * @var boolean * @since Kunena 6.0 */ public $pagination; /** * @var string * @since Kunena 6.0 */ protected $name = 'Announcement/Listing'; /** * Prepare announcement list display. * * @return void * * @throws null * @throws Exception * @since Kunena 6.0 */ protected function before() { parent::before(); $limit = $this->input->getInt('limit', 0); $Itemid = $this->input->getInt('Itemid'); if (!$Itemid && $this->config->sefRedirect) { try { $itemid = KunenaRoute::fixMissingItemID(); $params = [ 'option' => 'com_kunena', 'view' => 'announcement', 'layout' => 'listing', '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()); } } if ($limit < 1 || $limit > 100) { $limit = 20; } $limitstart = $this->input->getInt('limitstart', 0); if ($limitstart < 0) { $limitstart = 0; } $moderator = KunenaUserHelper::getMyself()->isModerator(); $this->pagination = new KunenaPagination(KunenaAnnouncementHelper::getCount(!$moderator), $limitstart, $limit); $this->announcements = KunenaAnnouncementHelper::getAnnouncements( $this->pagination->limitstart, $this->pagination->limit, !$moderator ); } /** * Prepare document. * * @return void * * @throws Exception * @since Kunena 6.0 */ protected function prepareDocument() { $menu_item = $this->app->getMenu()->getActive(); if ($menu_item) { $params = $menu_item->getParams(); $params_title = $params->get('page_title'); $params_description = $params->get('menu-meta_description'); if (!empty($params_title)) { $title = $params->get('page_title'); $this->setTitle($title); } else { $this->setTitle(Text::_('COM_KUNENA_ANN_ANNOUNCEMENTS')); } if (!empty($params_description)) { $description = $params->get('menu-meta_description'); $this->setDescription($description); } else { $this->setDescription(Text::_('COM_KUNENA_ANN_ANNOUNCEMENTS')); } } } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка