File manager - Edit - /home/jardides/www/Jardi-design/j37/administrator/components/com_pagebuilderckparams/install.pagebuilderckparams.php
Back
<?php /** * @name Page Builder CK * @package com_pagebuilderck * @copyright Copyright (C) 2015. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr */ defined('_JEXEC') or die('Restricted access'); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); /* preflight which is executed before install and update install update uninstall postflight which is executed after install and update */ class com_pagebuilderckparamsInstallerScript { function install($parent) { } function update($parent) { } 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 JInstaller; $result = $installer->uninstall('module',$id,1); }*/ } function preflight($type, $parent) { return true; } // run on install and update function postflight($type, $parent) { // install modules and plugins jimport('joomla.installer.installer'); $db = JFactory::getDbo(); $status = array(); $src_ext = dirname(__FILE__).'/extensions'; $installer = new JInstaller; // extensions to install // system plugin $result = $installer->install(dirname(__FILE__).'/pagebuilderckparams'); $status[] = array('name'=>'System - Pagebuilder CK Params','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` = 'pagebuilderckparams' AND `type` = 'plugin'"); $db->query(); $adminPBCKpath = JPATH_SITE . '/administrator/components/com_pagebuilderckparams/extensions'; // list of extensions to install $extensions = JFolder::folders($adminPBCKpath); foreach ($extensions as $extension) { // pagebuilderck plugin $result = $installer->install($adminPBCKpath.'/' . $extension); $status[] = array('name'=>'Page Builder CK - ' . ucfirst($extension), 'type'=>'plugin', 'result'=>$result); // auto enable the plugin $db->setQuery("UPDATE #__extensions SET enabled = '1' WHERE `element` = '".$extension."' AND `type` = 'plugin' AND `folder` = 'pagebuilderck'"); $db->query(); } 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; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings