File manager - Edit - /home/ferretapmx/public_html/Featured.tar
Back
HtmlView.php 0000644 00000011163 15231114055 0007013 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Contact\Site\View\Featured; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Mail\MailHelper; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\Component\Contact\Site\Model\FeaturedModel; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Featured View class * * @since 1.6 */ class HtmlView extends BaseHtmlView { /** * The item model state * * @var \Joomla\Registry\Registry * * @since 1.6.0 */ protected $state; /** * The item details * * @var array * * @since 1.6.0 */ protected $items; /** * The pagination object * * @var \Joomla\CMS\Pagination\Pagination * * @since 1.6.0 */ protected $pagination; /** * The page parameters * * @var \Joomla\Registry\Registry|null * * @since 4.0.0 */ protected $params = null; /** * The page class suffix * * @var string * * @since 4.0.0 */ protected $pageclass_sfx = ''; /** * Method to display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void * * @since 1.6 */ public function display($tpl = null) { $app = Factory::getApplication(); $params = $app->getParams(); /** @var FeaturedModel $model */ $model = $this->getModel(); $state = $model->getState(); $items = $model->getItems(); $category = $this->get('Category'); $children = $this->get('Children'); $parent = $this->get('Parent'); $pagination = $model->getPagination(); // Flag indicates to not add limitstart=0 to URL $pagination->hideEmptyLimitstart = true; // Check for errors. if (\count($errors = $model->getErrors())) { throw new GenericDataException(implode("\n", $errors), 500); } // Prepare the data. // Compute the contact slug. foreach ($items as $item) { $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; $temp = $item->params; $item->params = clone $params; $item->params->merge($temp); if ($item->params->get('show_email', 0) == 1) { $item->email_to = trim($item->email_to); if (!empty($item->email_to) && MailHelper::isEmailAddress($item->email_to)) { $item->email_to = HTMLHelper::_('email.cloak', $item->email_to); } else { $item->email_to = ''; } } } // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx', ''), ENT_COMPAT, 'UTF-8'); $maxLevel = $params->get('maxLevel', -1); $this->maxLevel = &$maxLevel; $this->state = &$state; $this->items = &$items; $this->category = &$category; $this->children = &$children; $this->params = &$params; $this->parent = &$parent; $this->pagination = &$pagination; $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document * * @return void * * @since 1.6 */ protected function _prepareDocument() { // Because the application sets a default page title, // we need to get it from the menu item itself $menu = Factory::getApplication()->getMenu()->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', Text::_('COM_CONTACT_DEFAULT_PAGE_TITLE')); } $this->setDocumentTitle($this->params->get('page_title', '')); if ($this->params->get('menu-meta_description')) { $this->getDocument()->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('robots')) { $this->getDocument()->setMetaData('robots', $this->params->get('robots')); } } } FeedView.php 0000644 00000010725 15231114055 0006755 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_content * * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Content\Site\View\Featured; use Joomla\CMS\Categories\Categories; use Joomla\CMS\Document\Feed\FeedItem; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\AbstractView; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Site\Helper\RouteHelper; use Joomla\Component\Content\Site\Model\FeaturedModel; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Frontpage View class * * @since 1.5 */ class FeedView extends AbstractView { /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { // Parameters $app = Factory::getApplication(); $params = $app->getParams(); $feedEmail = $app->get('feed_email', 'none'); $siteEmail = $app->get('mailfrom'); // If the feed has been disabled, we want to bail out here if ($params->get('show_feed_link', 1) == 0) { throw new \Exception(Text::_('JGLOBAL_RESOURCE_NOT_FOUND'), 404); } $this->getDocument()->link = Route::_('index.php?option=com_content&view=featured'); // Get some data from the model $app->getInput()->set('limit', $app->get('feed_limit')); $categories = Categories::getInstance('Content'); /** @var FeaturedModel $model */ $model = $this->getModel(); $rows = $model->getItems(); foreach ($rows as $row) { // Strip html from feed item title $title = htmlspecialchars($row->title, ENT_QUOTES, 'UTF-8'); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Compute the article slug $row->slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id; // URL link to article $link = RouteHelper::getArticleRoute($row->slug, $row->catid, $row->language); $description = ''; $obj = json_decode($row->images); if (!empty($obj->image_intro)) { $description = '<p>' . HTMLHelper::_('image', $obj->image_intro, $obj->image_intro_alt) . '</p>'; } $description .= ($params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext); $author = $row->created_by_alias ?: $row->author; // Load individual item creator class $item = new FeedItem(); $item->title = $title; $item->link = Route::_($link); $item->date = $row->publish_up; $item->category = []; // All featured articles are categorized as "Featured" $item->category[] = Text::_('JFEATURED'); for ($item_category = $categories->get($row->catid); $item_category !== null; $item_category = $item_category->getParent()) { // Only add non-root categories if ($item_category->id > 1) { $item->category[] = $item_category->title; } } $item->author = $author; if ($feedEmail === 'site') { $item->authorEmail = $siteEmail; } elseif ($feedEmail === 'author') { $item->authorEmail = $row->author_email; } // Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext) { $link = Route::_($link, true, $app->get('force_ssl') == 2 ? Route::TLS_FORCE : Route::TLS_IGNORE, true); $description .= '<p class="feed-readmore"><a target="_blank" href="' . $link . '" rel="noopener">' . Text::_('COM_CONTENT_FEED_READMORE') . '</a></p>'; } // Load item description and add div $item->description = '<div class="feed-description">' . $description . '</div>'; // Loads item info into rss array $this->getDocument()->addItem($item); } } } .htaccess 0000555 00000000355 15231114055 0006343 0 ustar 00 <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>