| Server IP : 46.105.57.169 / Your IP : 216.73.216.84 Web Server : Apache System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : maitricfuz ( 93378) PHP Version : 8.4.10 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/m/a/i/maitricfuz/www/new-saint-martin/administrator/components/com_slideshowck/ |
Upload File : |
<?php
/**
* @name Slideshow CK
* @package com_slideshowck
* @copyright Copyright (C) 2015. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
*/
defined('_JEXEC') or die('Restricted access');
/*
preflight which is executed before install and update
install
update
uninstall
postflight which is executed after install and update
*/
class com_slideshowckInstallerScript {
function install($parent) {
}
function update($parent) {
}
/*
* get a variable from the manifest file (actually, from the manifest cache).
*/
function getParam( $name ) {
$db = \Joomla\CMS\Factory::getDbo();
$db->setQuery('SELECT manifest_cache FROM #__extensions WHERE element = "com_slideshowck"');
$manifest = json_decode( $db->loadResult(), true );
return $manifest[ $name ];
}
/*
* update the table
*/
function updateTable($version) {
$sqlsrc = dirname(__FILE__).'/administrator/sql/updates/' . $version . '.sql';
$execute = file_get_contents($sqlsrc);
$db = \Joomla\CMS\Factory::getDbo();
$db->setQuery($execute);
if (!$db->execute()) {
echo '<p class="alert alert-danger">Error during table update for version ' . $version . '</p>';
} else {
echo '<p class="alert alert-success">Table successfully updated for version ' . $version . '</p>';
}
}
function uninstall($parent) {
// jimport('joomla.installer.installer');
// Latest Module
// Check first that the module exist
/*$db->setQuery('SELECT `extension_id` FROM #__extensions WHERE `element` = "mod_test" AND `type` = "module"');
$id = $db->loadResult();
if($id)
{
$installer = new \Joomla\CMS\Installer\Installer;
$result = $installer->uninstall('module',$id,1);
}*/
// disable all plugins and modules
$db = \Joomla\CMS\Factory::getDbo();
$db->setQuery("UPDATE `#__modules` SET `published` = 0 WHERE `module` LIKE '%slideshowck%'");
$db->execute();
$db->setQuery("UPDATE `#__extensions` SET `enabled` = 0 WHERE `type` = 'plugin' AND `element` LIKE '%slideshowck%' AND `folder` NOT LIKE '%slideshowck%'");
$db->execute();
return true;
}
function preflight($type, $parent) {
// disable the install on Joomla 3 since 3.2.0
if (version_compare(JVERSION, '4') === -1) {
throw new RuntimeException('This version of Slideshow CK can not be installed on Joomla 3. Please use the version 2.4.3.');
}
return true;
}
// run on install and update
function postflight($type, $parent) {
// install modules and plugins
jimport('joomla.installer.installer');
$db = \Joomla\CMS\Factory::getDbo();
$status = array();
$src_ext = dirname(__FILE__).'/administrator/extensions';
$installer = new \Joomla\CMS\Installer\Installer;
// module
$result = $installer->install($src_ext.'/mod_slideshowck');
$status[] = array('name'=>'Slideshow CK - Module','type'=>'module', 'result'=>$result);
// system plugin
$result = $installer->install($src_ext.'/slideshowck');
$status[] = array('name'=>'System - Slideshow CK','type'=>'plugin', 'result'=>$result);
// system plugin must be enabled for user group limits and private areas
$db->setQuery("UPDATE #__extensions SET enabled = '1' WHERE `element` = 'slideshowck' AND `type` = 'plugin'");
$db->execute();
// slideshowck plugin
$plugins_src_ext = $src_ext . '/plugins';
$plugins = \Joomla\CMS\Filesystem\Folder::folders($plugins_src_ext);
$ordering = 1;
foreach ($plugins as $plugin) {
$result = $installer->install($plugins_src_ext . '/' . $plugin);
$status[] = array('name'=>'Slideshow CK - ' . $plugin,'type'=>'plugin', 'result'=>$result);
// auto enable the plugin
$db->setQuery("UPDATE #__extensions SET enabled = '1', ordering = '" . $ordering . "' WHERE `element` = '" . $plugin . "' AND `type` = 'plugin' AND `folder` = 'slideshowck'");
$db->execute();
$ordering++;
}
foreach ($status as $statu) {
if ($statu['result'] == true) {
$alert = 'success';
$icon = 'icon-ok';
$text = 'Successful';
} else {
$alert = 'warning';
$icon = 'icon-cancel';
$text = 'Failed';
}
echo '<div class="alert alert-' . $alert . '"><i class="icon ' . $icon . '"></i>Installation and activation of the <b>' . $statu['type'] . ' ' . $statu['name'] . '</b> : ' . $text . '</div>';
}
return true;
}
}