uawdijnntqw1x1x1
IP : 216.73.216.237
Hostname : webd002.cluster106.gra.hosting.ovh.net
Kernel : Linux webd002.cluster106.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
OS : Linux
PATH:
/
home
/
photograt
/
www
/
plugins
/
system
/
slideshowck
/
slideshowck.php
/
/
<?php /** * @copyright Copyright (C) 2019 Cédric KEIFLIN alias ced1870 * https://www.joomlack.fr * @license GNU/GPL * */ defined('_JEXEC') or die('Restricted access'); jimport('joomla.event.plugin'); jimport('joomla.filesystem.folder'); use Joomla\CMS\Factory; use Joomla\CMS\Plugin\PluginHelper; class plgSystemSlideshowck extends \Joomla\CMS\Plugin\CMSPlugin { private $shallLoad = true; private $modulesList; public $increment = 1; function __construct(&$subject, $params) { parent::__construct($subject, $params); } private function shallLoad() { if (! $this->shallLoad) { return false; } $app = \Joomla\CMS\Factory::getApplication(); if (! $app->isClient('site') && ! $app->isClient('administrator')) { return false; } if ($app->isClient('cli')) { return false; } if ($app->isClient('api')) { return false; } $doc = \Joomla\CMS\Factory::getDocument(); $doctype = $doc->getType(); // $document = \Joomla\CMS\Factory::getApplication()->getDocument(); if ($doctype !== 'html') { return false; } return true; } /* * Initiate the lugin load * * Return mixed */ function registerListeners() { if ($this->shallLoad === true) { parent::registerListeners(); } else { return false; } } function onContentPrepareForm($form, $data) { if ($form->getName() != 'com_modules.module' && $form->getName() != 'com_advancedmodules.module' && $form->getName() != 'com_config.modules' // for frontend edition || ($form->getName() == 'com_modules.module' && $data && $data->module != 'mod_slideshowck') || ($form->getName() == 'com_advancedmodules.module' && $data && $data->module != 'mod_slideshowck') // for frontend edition || ($form->getName() == 'com_config.modules' && $data && $data->module != 'mod_slideshowck') ) return; // check that we are editing the slideshowck module $id = \Joomla\CMS\Factory::getApplication()->input->get('id',0, 'int'); if ($id) { $q = "SELECT module FROM #__modules WHERE id = " . $id; $db = \Joomla\CMS\Factory::getDbo(); $db->setQuery($q); $module = $db->loadResult(); if ($module != 'mod_slideshowck') return; } $this->loadLanguage(); // module options if ( $form->getName() == 'com_modules.module' || $form->getName() == 'com_advancedmodules.module' // for frontend edition || $form->getName() == 'com_config.modules' ) { // load the custom plugins require_once(JPATH_ADMINISTRATOR . '/components/com_slideshowck/helpers/ckfof.php'); Slideshowck\CKFof::importPlugin('slideshowck'); $sources = Slideshowck\CKFof::triggerEvent('onSlideshowckGetSourceName'); if (! empty($sources)) { foreach ($sources as $source) { $this->loadLanguage(); \Joomla\CMS\Form\Form::addFormPath(JPATH_SITE . '/plugins/slideshowck/' . strtolower($source) . '/params'); $form->loadFile(strtolower($source) . '_params', false); } } } } /** * Render the tag to a module, uses the syntax : {slideshowck 207}folder=images/test|height=300{/slideshowck} * */ function onContentPrepare($context, &$article, &$params, $page = 0) { $app = \Joomla\CMS\Factory::getApplication(); // si pas en frontend, on sort if ($app->isClient('administrator')) { return false; } $document = \Joomla\CMS\Factory::getDocument(); $doctype = $document->getType(); // si pas HTML, on sort if ($doctype !== 'html') { return; } $input = $app->input; if ($input->get('layout') == 'edit' || $input->get('task') == 'edit' || $input->get('func') == 'edit' || $input->get('controller') == 'config.display.modules') { return; } // get the page code // if (version_compare(JVERSION, '4') >= 0) { // $body = \Joomla\CMS\Factory::getApplication()->getBody(); // } else { // $body = JResponse::getBody(); // } $body = $article->text; // look for the tags and replace $regex = "#{slideshowck(.*?)}(.*?){/slideshowck}#s"; // masque de recherche pour le tag $body = preg_replace_callback($regex, array($this, 'createSlideshowFromTag'), $body); // if (version_compare(JVERSION, '4') >= 0) { // \Joomla\CMS\Factory::getApplication()->setBody($body); // } else { // JResponse::setBody($body); // } $article->text = $body; return; } private function createSlideshowFromTag($matches) { // découpe l'expression pour récupérer les textes $patterns = "#{slideshowck(.*)}(.*){/slideshowck}#Uis"; $result = preg_match($patterns, $matches[0], $results); // vérifie si des paramètres personnalisés existent $params = new stdClass(); $paramstmp = explode('|', $results[2]); for ($i = 0; $i < count($paramstmp); $i++) { $param = explode('=', $paramstmp[$i]); if (isset($param[0]) && isset($param[1])) { $key = $param[0]; // concat the other values, in case of the = sign is present unset($param[0]); $value = implode('=', $param); $params->{$key} = $value; } } // make the translation between the user param and the module param $this->associateParams($params); $module = $this->GenModuleById((int)$results[1], $params); return $module; } /** * Make the translation between the user param and the module param * * @return void */ private function associateParams(&$params) { $associations = array('folder' => 'autoloadfoldername'); foreach ($associations as $tag => $module) { if (isset($params->{$tag})) { $params->{$module} = $params->{$tag}; } } } /** * Create the list of all modules published as Object * * @return Array of Objects */ private function CreateModulesList() { if (empty($this->modulesList)) { $db = \Joomla\CMS\Factory::getDbo(); $query = " SELECT * FROM #__modules WHERE published=1 ORDER BY id "; $db->setQuery($query); $this->modulesList = $db->loadObjectList('id'); } return $this->modulesList; } /** * Render the module * * @param Int $moduleid The module ID to load * @param \Joomla\Registry\Registry $params * @param Array $modulesList The list of all module objects published * * @return string with HTML */ private function GenModuleById($moduleid, $params) { $attribs['style'] = 'html5'; $modulesList = $this->CreateModulesList(); if (! isset($modulesList[$moduleid])) { return 'SLIDESHOW CK MESSAGE : module ID ' . $moduleid . ' not found.'; } $module = clone $modulesList[$moduleid]; // set the module param to know the calling level $paramstmp = new \Joomla\Registry\Registry; $paramstmp->loadString($module->params); // implement the custom params in the module foreach ($params as $param => $value) { $paramstmp->set($param, $value); } $module->id = $module->id . '-tag' . $this->increment; $module->params = $paramstmp->toString(); $this->increment++; return \Joomla\CMS\Helper\ModuleHelper::renderModule($module, $attribs); } }
/home/photograt/www/plugins/system/slideshowck/slideshowck.php