File manager - Edit - /home/ferretapmx/public_html/Helper.zip
Back
PK ��\O!Ap�. �. MenuHelper.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Module\Menu\Site\Helper; use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\CMS\Cache\Controller\OutputController; use Joomla\CMS\Factory; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Router\Route; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_menu * * @since 1.5 */ class MenuHelper { /** * Get a list of the menu items. * * @param Registry &$params The module options. * @param CMSApplicationInterface $app The application * * @return array * * @since 5.4.0 */ public function getItems(Registry &$params, CMSApplicationInterface $app): array { $menu = $app->getMenu(); // Get active menu item $base = $this->getBaseItem($params, $app); $levels = $app->getIdentity()->getAuthorisedViewLevels(); asort($levels); // Compose cache key $cacheKey = 'menu_items' . $params . implode(',', $levels) . '.' . $base->id; /** @var OutputController $cache */ $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class) ->createCacheController('output', ['defaultgroup' => 'mod_menu']); if ($cache->contains($cacheKey)) { $items = $cache->get($cacheKey); } else { $path = $base->tree; $start = (int) $params->get('startLevel', 1); $end = (int) $params->get('endLevel', 0); $showAll = $params->get('showAllChildren', 1); $items = $menu->getItems('menutype', $params->get('menutype')); $hidden_parents = []; $lastitem = 0; if ($items) { $inputVars = $app->getInput()->getArray(); foreach ($items as $i => $item) { $item->parent = false; $itemParams = $item->getParams(); if (isset($items[$lastitem]) && $items[$lastitem]->id == $item->parent_id && $itemParams->get('menu_show', 1) == 1) { $items[$lastitem]->parent = true; } if ( ($start && $start > $item->level) || ($end && $item->level > $end) || (!$showAll && $item->level > 1 && !\in_array($item->parent_id, $path)) || ($start > 1 && !\in_array($item->tree[$start - 2], $path)) ) { unset($items[$i]); continue; } // Exclude item with menu item option set to exclude from menu modules if (($itemParams->get('menu_show', 1) == 0) || \in_array($item->parent_id, $hidden_parents)) { $hidden_parents[] = $item->id; unset($items[$i]); continue; } $item->current = true; foreach ($item->query as $key => $value) { if (!isset($inputVars[$key]) || $inputVars[$key] !== $value) { $item->current = false; break; } } $item->deeper = false; $item->shallower = false; $item->level_diff = 0; if (isset($items[$lastitem])) { $items[$lastitem]->deeper = ($item->level > $items[$lastitem]->level); $items[$lastitem]->shallower = ($item->level < $items[$lastitem]->level); $items[$lastitem]->level_diff = ($items[$lastitem]->level - $item->level); } $lastitem = $i; $item->active = false; $item->flink = $item->link; // Reverted back for CMS version 2.5.6 switch ($item->type) { case 'separator': break; case 'heading': // No further action needed. break; case 'url': if ((str_starts_with($item->link, 'index.php?')) && (!str_contains($item->link, 'Itemid='))) { // If this is an internal Joomla link, ensure the Itemid is set. $item->flink = $item->link . '&Itemid=' . $item->id; } break; case 'alias': $item->flink = 'index.php?Itemid=' . $itemParams->get('aliasoptions'); // Get the language of the target menu item when site is multilingual if (Multilanguage::isEnabled()) { $newItem = $app->getMenu()->getItem((int) $itemParams->get('aliasoptions')); // Use language code if not set to ALL if ($newItem != null && $newItem->language && $newItem->language !== '*') { $item->flink .= '&lang=' . $newItem->language; } } break; default: $item->flink = 'index.php?Itemid=' . $item->id; break; } if ((str_contains($item->flink, 'index.php?')) && strcasecmp(substr($item->flink, 0, 4), 'http')) { $item->flink = Route::_($item->flink, true, $itemParams->get('secure')); } else { $item->flink = Route::_($item->flink); } // We prevent the double encoding because for some reason the $item is shared for menu modules and we get double encoding // when the cause of that is found the argument should be removed $item->title = htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8', false); $item->menu_icon = htmlspecialchars($itemParams->get('menu_icon_css', ''), ENT_COMPAT, 'UTF-8', false); $item->anchor_css = htmlspecialchars($itemParams->get('menu-anchor_css', ''), ENT_COMPAT, 'UTF-8', false); $item->anchor_title = htmlspecialchars($itemParams->get('menu-anchor_title', ''), ENT_COMPAT, 'UTF-8', false); $item->anchor_rel = htmlspecialchars($itemParams->get('menu-anchor_rel', ''), ENT_COMPAT, 'UTF-8', false); $item->menu_image = htmlspecialchars($itemParams->get('menu_image', ''), ENT_COMPAT, 'UTF-8', false); $item->menu_image_css = htmlspecialchars($itemParams->get('menu_image_css', ''), ENT_COMPAT, 'UTF-8', false); } if (isset($items[$lastitem])) { $items[$lastitem]->deeper = (($start ?: 1) > $items[$lastitem]->level); $items[$lastitem]->shallower = (($start ?: 1) < $items[$lastitem]->level); $items[$lastitem]->level_diff = ($items[$lastitem]->level - ($start ?: 1)); } } $cache->store($items, $cacheKey); } return $items; } /** * Get base menu item. * * @param Registry &$params The module options. * @param CMSApplicationInterface $app The application * * @return object * * @since 5.4.0 */ public function getBaseItem(Registry &$params, CMSApplicationInterface $app): object { // Get base menu item from parameters if ($params->get('base')) { $base = $app->getMenu()->getItem($params->get('base')); } else { $base = false; } // Use active menu item if no base found if (!$base) { $base = $this->getActiveItem($app); } return $base; } /** * Get active menu item. * * @param CMSApplicationInterface $app The application * * @return object * * @since 5.4.0 */ public function getActiveItem(CMSApplicationInterface $app): object { $menu = $app->getMenu(); return $menu->getActive() ?: $this->getDefaultItem($app); } /** * Get default menu item (home page) for current language. * * @param CMSApplicationInterface $app The application * * @return object * * @since 5.4.0 */ public function getDefaultItem(CMSApplicationInterface $app): object { $menu = $app->getMenu(); // Look for the home menu if (Multilanguage::isEnabled()) { return $menu->getDefault($app->getLanguage()->getTag()); } return $menu->getDefault(); } /** * Get a list of the menu items. * * @param Registry &$params The module options. * * @return array * * @since 1.5 * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getItems * Example: Factory::getApplication()->bootModule('mod_menu', 'site') * ->getHelper('MenuHelper') * ->getItems($params, $app) */ public static function getList(&$params) { return (new self())->getItems($params, Factory::getApplication()); } /** * Get base menu item. * * @param Registry &$params The module options. * * @return object * * @since 3.0.2 * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getBaseItem * Example: Factory::getApplication()->bootModule('mod_menu', 'site') * ->getHelper('MenuHelper') * ->getBaseItem($params, $app) */ public static function getBase(&$params) { return (new self())->getBaseItem($params, Factory::getApplication()); } /** * Get active menu item. * * @param Registry &$params The module options. * * @return object * * @since 3.0.2 * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getActiveItem * Example: Factory::getApplication()->bootModule('mod_menu', 'site') * ->getHelper('MenuHelper') * ->getActiveItem($app) */ public static function getActive(&$params) { return (new self())->getActiveItem(Factory::getApplication()); } /** * Get default menu item (home page) for current language. * * @return object * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getDefaultItem * Example: Factory::getApplication()->bootModule('mod_menu', 'site') * ->getHelper('MenuHelper') * ->getDefaultItem($app) */ public static function getDefault() { return (new self())->getDefaultItem(Factory::getApplication()); } } PK ��\�Sʉ� � .htaccessnu �7��m <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>PK ��\=^�� � ArticlesArchiveHelper.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage mod_articles_archive * * @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\Module\ArticlesArchive\Site\Helper; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Administrator\Extension\ContentComponent; use Joomla\Database\DatabaseAwareInterface; use Joomla\Database\DatabaseAwareTrait; use Joomla\Database\ParameterType; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_articles_archive * * @since 1.5 */ class ArticlesArchiveHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Retrieve a list of months with archived articles * * @param Registry $moduleParams The module parameters. * @param SiteApplication $app The current application. * * @return \stdClass[] * * @since 4.4.0 */ public function getArticlesByMonths(Registry $moduleParams, SiteApplication $app): array { $db = $this->getDatabase(); $query = $db->getQuery(true); $query->select($query->month($db->quoteName('created')) . ' AS created_month') ->select('MIN(' . $db->quoteName('created') . ') AS created') ->select($query->year($db->quoteName('created')) . ' AS created_year') ->from($db->quoteName('#__content', 'c')) ->where($db->quoteName('c.state') . ' = ' . ContentComponent::CONDITION_ARCHIVED) ->group($query->year($db->quoteName('c.created')) . ', ' . $query->month($db->quoteName('c.created'))) ->order($query->year($db->quoteName('c.created')) . ' DESC, ' . $query->month($db->quoteName('c.created')) . ' DESC'); // Filter by language if ($app->getLanguageFilter()) { $query->whereIn($db->quoteName('language'), [$app->getLanguage()->getTag(), '*'], ParameterType::STRING); } $query->setLimit((int) $moduleParams->get('count')); $db->setQuery($query); try { $rows = (array) $db->loadObjectList(); } catch (\RuntimeException) { $app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return []; } $menu = $app->getMenu(); $item = $menu->getItems('link', 'index.php?option=com_content&view=archive', true); $itemid = (isset($item) && !empty($item->id)) ? '&Itemid=' . $item->id : ''; $i = 0; $lists = []; foreach ($rows as $row) { $date = Factory::getDate($row->created); $createdMonth = $date->format('n'); $createdYear = $date->format('Y'); $createdYearCal = HTMLHelper::_('date', $row->created, 'Y'); $monthNameCal = HTMLHelper::_('date', $row->created, 'F'); $lists[$i] = new \stdClass(); $lists[$i]->link = Route::_('index.php?option=com_content&view=archive&year=' . $createdYear . '&month=' . $createdMonth . $itemid); $lists[$i]->text = Text::sprintf('MOD_ARTICLES_ARCHIVE_DATE', $monthNameCal, $createdYearCal); $i++; } return $lists; } /** * Retrieve list of archived articles * * @param Registry &$params module parameters * * @return \stdClass[] * * @since 1.5 * * @deprecated 4.4.0 will be removed in 6.0 * Use the non-static method getArticlesByMonths * Example: Factory::getApplication()->bootModule('mod_articles_archive', 'site') * ->getHelper('ArticlesArchiveHelper') * ->getArticlesByMonths($params, Factory::getApplication()) */ public static function getList(&$params) { /** @var SiteApplication $app */ $app = Factory::getApplication(); return (new self())->getArticlesByMonths($params, $app); } } PK ��\7zEX X ArticlesHelper.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage mod_articles * * @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Module\Articles\Site\Helper; use Joomla\CMS\Access\Access; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Date\Date; use Joomla\CMS\Event\Content; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Administrator\Extension\ContentComponent; use Joomla\Component\Content\Site\Helper\RouteHelper; use Joomla\Database\DatabaseAwareInterface; use Joomla\Database\DatabaseAwareTrait; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_articles * * @since 5.2.0 */ class ArticlesHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Retrieve a list of articles * * @param Registry $params The module parameters. * @param SiteApplication $app The current application. * * @return object[] * * @since 5.2.0 */ public function getArticles(Registry $params, SiteApplication $app) { $factory = $app->bootComponent('com_content')->getMVCFactory(); // Get an instance of the generic articles model $articles = $factory->createModel('Articles', 'Site', ['ignore_request' => true]); // Set application parameters in model $input = $app->getInput(); $appParams = $app->getParams(); $articles->setState('params', $appParams); $articles->setState('list.start', 0); $articles->setState('filter.published', ContentComponent::CONDITION_PUBLISHED); // Set the filters based on the module params $articles->setState('list.limit', (int) $params->get('count', 0)); $articles->setState('load_tags', $params->get('show_tags', 0) || $params->get('article_grouping', 'none') === 'tags'); // Get the user object $user = $app->getIdentity(); // Access filter $access = !ComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = Access::getAuthorisedViewLevels($user->id); $articles->setState('filter.access', $access); // Prep for Normal or Dynamic Modes $mode = $params->get('mode', 'normal'); switch ($mode) { case 'dynamic': $option = $input->get('option'); $view = $input->get('view'); if ($option === 'com_content') { switch ($view) { case 'category': case 'categories': $catids = [$input->getInt('id')]; break; case 'article': if ($params->get('show_on_article_page', 1)) { $article_id = $input->getInt('id'); $catid = $input->getInt('catid'); if (!$catid) { // Get an instance of the generic article model $article = $factory->createModel('Article', 'Site', ['ignore_request' => true]); $article->setState('params', $appParams); $article->setState('filter.published', 1); $article->setState('article.id', (int) $article_id); $item = $article->getItem(); $catids = [$item->catid]; } else { $catids = [$catid]; } } else { // Return right away if show_on_article_page option is off return; } break; default: // Return right away if not on the category or article views return; } } else { // Return right away if not on a com_content page return; } break; default: $catids = $params->get('catid'); $articles->setState('filter.category_id.include', (bool) $params->get('category_filtering_type', 1)); break; } // Category filter if ($catids) { if ($params->get('show_child_category_articles', 0) && (int) $params->get('levels', 0) > 0) { // Get an instance of the generic categories model $categories = $factory->createModel('Categories', 'Site', ['ignore_request' => true]); $categories->setState('params', $appParams); $levels = $params->get('levels', 1) ?: 9999; $categories->setState('filter.get_children', $levels); $categories->setState('filter.published', 1); $categories->setState('filter.access', $access); $additional_catids = []; foreach ($catids as $catid) { $categories->setState('filter.parentId', $catid); $recursive = true; $items = $categories->getItems($recursive); if ($items) { foreach ($items as $category) { $condition = (($category->level - $categories->getParent()->level) <= $levels); if ($condition) { $additional_catids[] = $category->id; } } } } $catids = array_unique(array_merge($catids, $additional_catids)); } $articles->setState('filter.category_id', $catids); } // Ordering $ordering = $params->get('article_ordering', 'a.ordering'); switch ($ordering) { case 'random': $articles->setState('list.ordering', $this->getDatabase()->getQuery(true)->rand()); break; case 'rating_count': case 'rating': $articles->setState('list.ordering', $ordering); $articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC')); if (!PluginHelper::isEnabled('content', 'vote')) { $articles->setState('list.ordering', 'a.ordering'); } break; default: $articles->setState('list.ordering', $ordering); $articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC')); break; } // Filter by multiple tags $articles->setState('filter.tag', $params->get('filter_tag', [])); // Filter by featured $articles->setState('filter.featured', $params->get('show_featured', 'show')); // Filter by author if ($params->get('author_filtering_type', 1) === 2) { $articles->setState('filter.author_id', [$user->id]); } else { $articles->setState('filter.author_id', $params->get('created_by', [])); $articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1)); } $articles->setState('filter.author_alias', $params->get('created_by_alias', [])); $articles->setState('filter.author_alias.include', $params->get('author_alias_filtering_type', 1)); // Filter archived articles if ($params->get('show_archived', 'hide') === 'show') { $articles->setState('filter.published', ContentComponent::CONDITION_ARCHIVED); } // Check if we include or exclude articles and process data $ex_or_include_articles = $params->get('ex_or_include_articles', 0); $filterInclude = true; $articlesList = []; $currentArticleId = $input->get('id', 0, 'UINT'); $isArticleAndShouldExcluded = $params->get('exclude_current', 1) === 1 && $input->get('option') === 'com_content' && $input->get('view') === 'article'; $articlesListToProcess = $params->get('included_articles', ''); if ($ex_or_include_articles === 0) { $filterInclude = false; if ($isArticleAndShouldExcluded) { $articlesList[] = $currentArticleId; } $articlesListToProcess = $params->get('excluded_articles', ''); } foreach (ArrayHelper::fromObject($articlesListToProcess) as $article) { if ( $ex_or_include_articles === 1 && $isArticleAndShouldExcluded && (int) $article['id'] === $currentArticleId ) { continue; } $articlesList[] = (int) $article['id']; } // Edge case when the user select include mode but didn't add an article, // we might have to exclude the current article if ( $ex_or_include_articles === 1 && $isArticleAndShouldExcluded && empty($articlesList) ) { $filterInclude = false; $articlesList[] = $currentArticleId; } if (!empty($articlesList)) { $articles->setState('filter.article_id', $articlesList); $articles->setState('filter.article_id.include', $filterInclude); } $date_filtering = $params->get('date_filtering', 'off'); if ($date_filtering !== 'off') { $articles->setState('filter.date_filtering', $date_filtering); $articles->setState('filter.date_field', $params->get('date_field', 'a.created')); $articles->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00')); $articles->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59')); $articles->setState('filter.relative_date', $params->get('relative_date', 30)); } // Filter by language $articles->setState('filter.language', $app->getLanguageFilter()); $items = $articles->getItems(); // Display options $show_date = $params->get('show_date', 0); $show_date_field = $params->get('show_date_field', 'created'); $show_date_format = $params->get('show_date_format', 'Y-m-d H:i:s'); $show_category = $params->get('show_category', 0); $show_category_link = $params->get('show_category_link', 0); $show_hits = $params->get('show_hits', 0); $show_author = $params->get('show_author', 0); $show_introtext = $params->get('show_introtext', 0); $introtext_limit = $params->get('introtext_limit', 100); // Find current Article ID if on an article page $option = $input->get('option'); $view = $input->get('view'); if ($option === 'com_content' && $view === 'article') { $active_article_id = $input->getInt('id'); } else { $active_article_id = 0; } // Prepare data for display using display options foreach ($items as &$item) { $item->slug = $item->id . ':' . $item->alias; $articleLink = Route::_(RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language)); if ($access || \in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = $articleLink; } else { $menu = $app->getMenu(); $menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login'); if (isset($menuitems[0])) { $Itemid = $menuitems[0]->id; } elseif ($input->getInt('Itemid') > 0) { // Use Itemid from requesting page only if there is no existing menu $Itemid = $input->getInt('Itemid'); } $return = base64_encode($articleLink); $item->link = Route::_('index.php?option=com_users&view=login&Itemid=' . $Itemid . '&return=' . $return); } $item->event = new \stdClass(); // Check if we should trigger additional plugin events if ($params->get('trigger_events', 0)) { $dispatcher = Factory::getApplication()->getDispatcher(); // Process the content plugins. PluginHelper::importPlugin('content', null, true, $dispatcher); $contentEventArguments = [ 'context' => 'com_content.article', 'subject' => $item, 'params' => $item->params, 'page' => 0, ]; // onContentPrepare plugins work on $item->text if (!isset($item->text)) { $item->text = $item->introtext . ' ' . $item->fulltext; } $contentEvents = [ 'onContentPrepare' => new Content\ContentPrepareEvent('onContentPrepare', $contentEventArguments), 'afterDisplayTitle' => new Content\AfterTitleEvent('onContentAfterTitle', $contentEventArguments), 'beforeDisplayContent' => new Content\BeforeDisplayEvent('onContentBeforeDisplay', $contentEventArguments), 'afterDisplayContent' => new Content\AfterDisplayEvent('onContentAfterDisplay', $contentEventArguments), ]; foreach ($contentEvents as $resultKey => $event) { $results = $dispatcher->dispatch($event->getName(), $event)->getArgument('result', []); $item->event->{$resultKey} = $results ? trim(implode("\n", $results)) : ''; } } else { $item->event->onContentPrepare = ''; $item->event->afterDisplayTitle = ''; $item->event->beforeDisplayContent = ''; $item->event->afterDisplayContent = ''; } // Used for styling the active article $item->active = $item->id == $active_article_id ? 'active' : ''; if ($show_date) { $item->displayDate = HTMLHelper::_('date', $item->$show_date_field, $show_date_format); } if ($show_category) { $item->displayCategoryTitle = $item->category_title; } if ($show_category_link) { $item->displayCategoryLink = Route::_(RouteHelper::getCategoryRoute($item->catid, $item->category_language)); } $item->displayAuthorName = $show_author ? $item->author : ''; $item->displayCategoryTitle = $show_category ? $item->category_title : ''; $item->displayCategoryLink = $show_category_link ? $item->displayCategoryLink : ''; $item->displayDate = $show_date ? $item->displayDate : ''; $item->displayHits = $show_hits ? $item->hits : ''; if ($show_introtext) { $item->displayIntrotext = HTMLHelper::_('content.prepare', $item->introtext, '', 'mod_articles.content'); // Remove any images belongs to the text if (!$params->get('image')) { // Remove any images and empty links from the intro text $item->displayIntrotext = preg_replace(['/\\<img[^>]*>/', '/<a[^>]*><\\/a>/'], '', $item->displayIntrotext); } if ($introtext_limit != 0) { $item->displayIntrotext = HTMLHelper::_('string.truncateComplex', $item->displayIntrotext, $introtext_limit); } } // Show the Intro/Full image field of the article if ($params->get('img_intro_full') !== 'none') { $images = (new Registry($item->images))->toObject(); $item->imageSrc = ''; if ($params->get('img_intro_full') === 'intro' && !empty($images->image_intro)) { $item->imageSrc = htmlspecialchars($images->image_intro, ENT_COMPAT, 'UTF-8'); $images->float_intro .= ' mod-articles-image'; } elseif ($params->get('img_intro_full') === 'full' && !empty($images->image_fulltext)) { $item->imageSrc = htmlspecialchars($images->image_fulltext, ENT_COMPAT, 'UTF-8'); $images->float_fulltext .= ' mod-articles-image'; } $item->images = json_encode($images); } $item->displayReadmore = $item->alternative_readmore; } // Check if items need be grouped $article_grouping = $params->get('article_grouping', 'none'); $article_grouping_direction = $params->get('article_grouping_direction', 'ksort'); $grouped = $article_grouping !== 'none'; if ($items && $grouped) { switch ($article_grouping) { case 'year': case 'month_year': $items = ArticlesHelper::groupByDate( $items, $article_grouping_direction, $article_grouping, $params->get('month_year_format', 'F Y'), $params->get('date_grouping_field', 'created') ); break; case 'author': case 'category_title': $items = ArticlesHelper::groupBy($items, $article_grouping, $article_grouping_direction); break; case 'tags': $items = ArticlesHelper::groupByTags($items, $article_grouping_direction); break; } } return $items; } /** * Groups items by field * * @param array $list list of items * @param string $fieldName name of field that is used for grouping * @param string $direction ordering direction * @param null $fieldNameToKeep field name to keep * * @return array * * @since 5.2.0 */ public static function groupBy($list, $fieldName, $direction, $fieldNameToKeep = null) { $grouped = []; if (!\is_array($list)) { if ($list === '') { return $grouped; } $list = [$list]; } foreach ($list as $key => $item) { if (!isset($grouped[$item->$fieldName])) { $grouped[$item->$fieldName] = []; } if ($fieldNameToKeep === null) { $grouped[$item->$fieldName][$key] = $item; } else { $grouped[$item->$fieldName][$key] = $item->$fieldNameToKeep; } unset($list[$key]); } $direction($grouped); return $grouped; } /** * Groups items by date * * @param array $list list of items * @param string $direction ordering direction * @param string $type type of grouping * @param string $monthYearFormat date format to use * @param string $field date field to group by * * @return array * * @since 5.2.0 */ public static function groupByDate($list, $direction = 'ksort', $type = 'year', $monthYearFormat = 'F Y', $field = 'created') { $grouped = []; if (!\is_array($list)) { if ($list === '') { return $grouped; } $list = [$list]; } foreach ($list as $key => $item) { switch ($type) { case 'month_year': $month_year = StringHelper::substr($item->$field, 0, 7); if (!isset($grouped[$month_year])) { $grouped[$month_year] = []; } $grouped[$month_year][$key] = $item; break; default: $year = StringHelper::substr($item->$field, 0, 4); if (!isset($grouped[$year])) { $grouped[$year] = []; } $grouped[$year][$key] = $item; break; } unset($list[$key]); } $direction($grouped); if ($type === 'month_year') { foreach ($grouped as $group => $items) { $date = new Date($group); $formatted_group = $date->format($monthYearFormat); $grouped[$formatted_group] = $items; unset($grouped[$group]); } } return $grouped; } /** * Groups items by tags * * @param array $list list of items * @param string $direction ordering direction * * @return array * * @since 5.2.0 */ public static function groupByTags($list, $direction = 'ksort') { $grouped = []; $untagged = []; if (!$list) { return $grouped; } foreach ($list as $item) { if ($item->tags->itemTags) { foreach ($item->tags->itemTags as $tag) { $grouped[$tag->title][] = $item; } } else { $untagged[] = $item; } } $direction($grouped); if ($untagged) { $grouped['MOD_ARTICLES_UNTAGGED'] = $untagged; } return $grouped; } } PK � �\S*' ArticlesLatestHelper.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage mod_articles_latest * * @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\Module\ArticlesLatest\Site\Helper; use Joomla\CMS\Access\Access; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Site\Helper\RouteHelper; use Joomla\Component\Content\Site\Model\ArticlesModel; use Joomla\Database\DatabaseAwareInterface; use Joomla\Database\DatabaseAwareTrait; use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_articles_latest * * @since 1.6 */ class ArticlesLatestHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Retrieve a list of article * * @param Registry $params The module parameters. * @param ArticlesModel $model The model. * * @return mixed * * @since 4.2.0 */ public function getArticles(Registry $params, SiteApplication $app) { // Get the Dbo and User object $db = $this->getDatabase(); $user = $app->getIdentity(); /** @var ArticlesModel $model */ $model = $app->bootComponent('com_content')->getMVCFactory()->createModel('Articles', 'Site', ['ignore_request' => true]); // Set application parameters in model $model->setState('params', $app->getParams()); $model->setState('list.start', 0); $model->setState('filter.published', 1); // Set the filters based on the module params $model->setState('list.limit', (int) $params->get('count', 5)); // This module does not use tags data $model->setState('load_tags', false); // Access filter $access = !ComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = Access::getAuthorisedViewLevels($user->id); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', [])); // State filter $model->setState('filter.condition', 1); // User filter $userId = $user->id; switch ($params->get('user_id')) { case 'by_me': $model->setState('filter.author_id', (int) $userId); break; case 'not_me': $model->setState('filter.author_id', $userId); $model->setState('filter.author_id.include', false); break; case 'created_by': $model->setState('filter.author_id', $params->get('author', [])); break; case '0': break; default: $model->setState('filter.author_id', (int) $params->get('user_id')); break; } // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Featured switch $featured = $params->get('show_featured', ''); if ($featured === '') { $model->setState('filter.featured', 'show'); } elseif ($featured) { $model->setState('filter.featured', 'only'); } else { $model->setState('filter.featured', 'hide'); } // Set ordering $order_map = [ 'm_dsc' => 'a.modified DESC, a.created', 'mc_dsc' => 'a.modified', 'c_dsc' => 'a.created', 'p_dsc' => 'a.publish_up', 'random' => $db->getQuery(true)->rand(), ]; $ordering = ArrayHelper::getValue($order_map, $params->get('ordering', 'p_dsc'), 'a.publish_up'); $dir = 'DESC'; $model->setState('list.ordering', $ordering); $model->setState('list.direction', $dir); $items = $model->getItems(); foreach ($items as &$item) { $item->slug = $item->id . ':' . $item->alias; if ($access || \in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = Route::_(RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language)); } else { $item->link = Route::_('index.php?option=com_users&view=login'); } } return $items; } /** * Retrieve a list of articles * * @param Registry $params The module parameters. * @param ArticlesModel $model The model. * * @return mixed * * @since 1.6 * * @deprecated 4.3 will be removed in 6.0 * Use the non-static method getArticles * Example: Factory::getApplication()->bootModule('mod_articles_latest', 'site') * ->getHelper('ArticlesLatestHelper') * ->getArticles($params, Factory::getApplication()) */ public static function getList(Registry $params, ArticlesModel $model) { return (new self())->getArticles($params, Factory::getApplication()); } } PK !�\�Õ7[ [ ContentHelper.phpnu �[��� <?php /** * @package Joomla.Api * @subpackage com_content * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Content\Api\Helper; use Joomla\CMS\Uri\Uri; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Content api helper. * * @since 4.0.0 */ class ContentHelper { /** * Fully Qualified Domain name for the image url * * @param string $uri The uri to resolve * * @return string */ public static function resolve(string $uri): string { // Check if external URL. if (stripos($uri, 'http') !== 0) { return Uri::root() . $uri; } return $uri; } } PK �!�\�Ȑ,� � RandomImageHelper.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage mod_random_image * * @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\Module\RandomImage\Site\Helper; use Joomla\CMS\Uri\Uri; use Joomla\Registry\Registry; use Joomla\String\StringHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_random_image * * @since 1.5 */ class RandomImageHelper { /** * Retrieves a random image * * @param Registry &$params module parameters object * @param array $images list of images * * @return mixed * * @since 5.4.0 */ public function getImage(Registry &$params, array $images): mixed { $width = $params->get('width', 100); $height = $params->get('height', null); $i = \count($images); if ($i === 0) { return null; } $random = mt_rand(0, $i - 1); $image = $images[$random]; $size = getimagesize(JPATH_BASE . '/' . $image->folder . '/' . $image->name); if ($size[0] < $width) { $width = $size[0]; } $coeff = $size[0] / $size[1]; if ($height === null) { $height = (int) ($width / $coeff); } else { $newheight = min($height, (int) ($width / $coeff)); if ($newheight < $height) { $height = $newheight; } else { $width = $height * $coeff; } } $image->width = $width; $image->height = $height; $image->folder = str_replace('\\', '/', $image->folder); return $image; } /** * Retrieves images from a specific folder * * @param Registry &$params module params * @param string $folder folder to get the images from * * @return array * * @since 5.4.0 */ public function getImagesFromFolder(Registry &$params, string $folder): array { $type = $params->get('type', 'jpg'); $files = []; $images = []; $dir = JPATH_BASE . '/' . $folder; // Check if directory exists if (is_dir($dir)) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file !== '.' && $file !== '..' && $file !== 'CVS' && $file !== 'index.html') { $files[] = $file; } } } closedir($handle); $i = 0; foreach ($files as $img) { if (!is_dir($dir . '/' . $img) && preg_match('/' . $type . '/', $img)) { $images[$i] = new \stdClass(); $images[$i]->name = $img; $images[$i]->folder = $folder; $i++; } } } return $images; } /** * Get sanitized folder * * @param Registry &$params module params objects * * @return mixed * * @since 5.4.0 */ public function getSanitizedFolder(Registry &$params): mixed { $folder = $params->get('folder'); $liveSite = Uri::base(); // If folder includes livesite info, remove if (StringHelper::strpos($folder, $liveSite) === 0) { $folder = str_replace($liveSite, '', $folder); } // If folder includes absolute path, remove if (StringHelper::strpos($folder, JPATH_SITE) === 0) { $folder = str_replace(JPATH_BASE, '', $folder); } return str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $folder); } /** * Retrieves a random image * * @param Registry &$params module parameters object * @param array $images list of images * * @return mixed * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getImage * Example: Factory::getApplication()->bootModule('mod_random_image', 'site') * ->getHelper('RandomImageHelper') * ->getImage($params, $images) */ public static function getRandomImage(&$params, $images) { return (new self())->getImage($params, $images); } /** * Retrieves images from a specific folder * * @param Registry &$params module params * @param string $folder folder to get the images from * * @return array * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getImagesFromFolder * Example: Factory::getApplication()->bootModule('mod_random_image', 'site') * ->getHelper('RandomImageHelper') * ->getImagesFromFolder($params, $folder) */ public static function getImages(&$params, $folder) { return (new self())->getImagesFromFolder($params, $folder); } /** * Get sanitized folder * * @param Registry &$params module params objects * * @return mixed * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getSanitizedFolder * Example: Factory::getApplication()->bootModule('mod_random_image', 'site') * ->getHelper('RandomImageHelper') * ->getSanitizedFolder($params) */ public static function getFolder(&$params) { return (new self())->getSanitizedFolder($params); } } PK T"�\�3�_w w FeedHelper.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage mod_feed * * @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\Module\Feed\Site\Helper; use Joomla\CMS\Feed\FeedFactory; use Joomla\CMS\Language\Text; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_feed * * @since 1.5 */ class FeedHelper { /** * Retrieve feed information * * @param \Joomla\Registry\Registry $params module parameters * * @return \Joomla\CMS\Feed\Feed|string * * @since 5.1.0 */ public function getFeedInformation($params) { // Module params $rssurl = $params->get('rssurl', ''); // Get RSS parsed object try { $feed = new FeedFactory(); $rssDoc = $feed->getFeed($rssurl); } catch (\Exception) { return Text::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } if (empty($rssDoc)) { return Text::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } if ($rssDoc) { return $rssDoc; } } /** * Retrieve feed information * * @param \Joomla\Registry\Registry $params module parameters * * @return \Joomla\CMS\Feed\Feed|string * * @deprecated 5.1.0 will be removed in 7.0 * Use the non-static method getFeedInformation * Example: Factory::getApplication()->bootModule('mod_feed', 'site') * ->getHelper('FeedHelper') * ->getFeedInformation($params, Factory::getApplication()) * */ public static function getFeed($params) { return (new self())->getFeedInformation($params); } } PK *1�\�*\+ LatestHelper.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage mod_latest * * @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\Module\Latest\Administrator\Helper; use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Administrator\Model\ArticlesModel; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_latest * * @since 1.5 */ class LatestHelper { /** * Get a list of articles. * * @param Registry $params The module parameters. * @param ArticlesModel $model The model. * @param CMSApplicationInterface $app The application instance. * * @return mixed An array of articles, or false on error. * * @since 5.4.0 */ public function getArticles(Registry $params, ArticlesModel $model, CMSApplicationInterface $app): mixed { $user = $app->getIdentity(); // Set List SELECT $model->setState('list.select', 'a.id, a.title, a.checked_out, a.checked_out_time, a.modified,' . ' a.access, a.created, a.created_by, a.created_by_alias, a.featured, a.state, a.publish_up, a.publish_down'); // Set Ordering filter switch ($params->get('ordering', 'c_dsc')) { case 'm_dsc': $model->setState('list.ordering', 'a.modified DESC, a.created'); $model->setState('list.direction', 'DESC'); break; case 'c_dsc': default: $model->setState('list.ordering', 'a.created'); $model->setState('list.direction', 'DESC'); break; } // Set Category Filter $categoryId = $params->get('catid', null); if (is_numeric($categoryId)) { $model->setState('filter.category_id', $categoryId); } // Set User Filter. $userId = $user->id; switch ($params->get('user_id', '0')) { case 'by_me': $model->setState('filter.author_id', $userId); break; case 'not_me': $model->setState('filter.author_id', $userId); $model->setState('filter.author_id.include', false); break; } // Set the Start and Limit $model->setState('list.start', 0); $model->setState('list.limit', $params->get('count', 5)); $items = $model->getItems(); if ($error = $model->getError()) { throw new \Exception($error, 500); } // Set the links foreach ($items as &$item) { $item->link = ''; if ( $user->authorise('core.edit', 'com_content.article.' . $item->id) || ($user->authorise('core.edit.own', 'com_content.article.' . $item->id) && ($userId === $item->created_by)) ) { $item->link = Route::_('index.php?option=com_content&task=article.edit&id=' . $item->id); } } return $items; } /** * Get the alternate title for the module. * * @param Registry $params The module parameters. * @param CMSApplicationInterface $app The application instance. * * @return string The alternate title for the module. * * @since 5.4.0 */ public function getModuleTitle(Registry $params, CMSApplicationInterface $app): string { $who = $params->get('user_id', 0); $catid = (int) $params->get('catid', null); $type = $params->get('ordering') === 'c_dsc' ? '_CREATED' : '_MODIFIED'; $title = ''; if ($catid) { $category = $app->bootComponent('com_content')->getCategory()->get($catid); $title = Text::_('MOD_POPULAR_UNEXISTING'); if ($category) { $title = $category->title; } } return Text::plural( 'MOD_LATEST_TITLE' . $type . ($catid ? '_CATEGORY' : '') . ($who != '0' ? "_$who" : ''), (int) $params->get('count', 5), $title ); } /** * Get a list of articles. * * @param Registry $params The module parameters. * @param ArticlesModel $model The model. * * @return mixed An array of articles, or false on error. * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getArticles * Example: Factory::getApplication()->bootModule('mod_latest', 'administrator') * ->getHelper('LatestHelper') * ->getArticles($params, $model, Factory::getApplication()) */ public static function getList(Registry $params, ArticlesModel $model) { return (new self())->getArticles($params, $model, Factory::getApplication()); } /** * Get the alternate title for the module. * * @param Registry $params The module parameters. * * @return string The alternate title for the module. * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getModuleTitle * Example: Factory::getApplication()->bootModule('mod_latest', 'administrator') * ->getHelper('LatestHelper') * ->getModuleTitle($params, Factory::getApplication()) */ public static function getTitle($params) { return (new self())->getModuleTitle($params, Factory::getApplication()); } } PK /1�\��V0 0 LoggedHelper.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage mod_logged * * @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\Module\Logged\Administrator\Helper; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; use Joomla\Database\DatabaseInterface; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_logged * * @since 1.5 */ class LoggedHelper { /** * Get a list of logged users. * * @param Registry $params The module parameters * @param CMSApplication $app The application * @param DatabaseInterface $db The database * * @return mixed An array of users, or false on error. * * @since 5.4.0 * * @throws \RuntimeException */ public function getUsers(Registry $params, CMSApplication $app, DatabaseInterface $db): mixed { $user = $app->getIdentity(); $query = $db->getQuery(true) ->select('s.time, s.client_id, u.id, u.name, u.username') ->from('#__session AS s') ->join('RIGHT', '#__users AS u ON s.userid = u.id') ->where('s.guest = 0') ->setLimit($params->get('count', 5), 0); $db->setQuery($query); try { $results = $db->loadObjectList(); } catch (\RuntimeException $e) { throw $e; } foreach ($results as $result) { $result->logoutLink = ''; if ($user->authorise('core.manage', 'com_users')) { $result->editLink = Route::_('index.php?option=com_users&task=user.edit&id=' . $result->id); $result->logoutLink = Route::_( 'index.php?option=com_login&task=logout&uid=' . $result->id . '&' . Session::getFormToken() . '=1' ); } if ($params->get('name', 1) == 0) { $result->name = $result->username; } } return $results; } /** * Get the alternate title for the module * * @param Registry $params The module parameters. * * @since 5.4.0 * * @return string The alternate title for the module. */ public function getModuleTitle($params): string { return Text::plural('MOD_LOGGED_TITLE', $params->get('count', 5)); } /** * Get a list of logged users. * * @param Registry $params The module parameters * @param CMSApplication $app The application * @param DatabaseInterface $db The database * * @return mixed An array of users, or false on error. * * @throws \RuntimeException * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getUsers * Example: Factory::getApplication()->bootModule('mod_logged', 'administrator') * ->getHelper('LoggedHelper') * ->getUsers($params, Factory::getApplication(), $db) */ public static function getList(Registry $params, CMSApplication $app, DatabaseInterface $db) { return (new self())->getUsers($params, $app, $db); } /** * Get the alternate title for the module * * @param Registry $params The module parameters. * * @return string The alternate title for the module. * * @deprecated 5.4.0 will be removed in 7.0 * Use the non-static method getModuleTitle * Example: Factory::getApplication()->bootModule('mod_logged', 'administrator') * ->getHelper('LoggedHelper') * ->getModuleTitle($params) */ public static function getTitle($params) { return (new self())->getModuleTitle($params); } } PK ��\O!Ap�. �. MenuHelper.phpnu �[��� PK ��\�Sʉ� � �. .htaccessnu �7��m PK ��\=^�� � �/ ArticlesArchiveHelper.phpnu �[��� PK ��\7zEX X �@ ArticlesHelper.phpnu �[��� PK � �\S*' :� ArticlesLatestHelper.phpnu �[��� PK !�\�Õ7[ [ �� ContentHelper.phpnu �[��� PK �!�\�Ȑ,� � )� RandomImageHelper.phpnu �[��� PK T"�\�3�_w w +� FeedHelper.phpnu �[��� PK *1�\�*\+ �� LatestHelper.phpnu �[��� PK /1�\��V0 0 '� LoggedHelper.phpnu �[��� PK . ��
| ver. 1.4 |
Github
|
.
| PHP 8.2.32 | Generation time: 0.07 |
proxy
|
phpinfo
|
Settings