Initial steps towards the J4 legacy edition.

This commit is contained in:
2021-10-19 03:30:46 +02:00
parent ab471e3ccb
commit 6beb6edf91
112 changed files with 165 additions and 777 deletions

View File

@ -19,7 +19,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal');
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
JHTML::_('bootstrap.renderModal');
/**
* Script File of ###Component### Component
@ -31,23 +32,23 @@ class com_###component###InstallerScript
*
* @param JAdapterInstance $parent The object responsible for running this script
*/
public function __construct(JAdapterInstance $parent) {}
public function __construct(ComponentAdapter $parent) {}
/**
* Called on installation
*
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function install(JAdapterInstance $parent) {}
public function install(ComponentAdapter $parent) {}
/**
* Called on uninstallation
*
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*/
public function uninstall(JAdapterInstance $parent)
public function uninstall(ComponentAdapter $parent)
{###UNINSTALLSCRIPT###
// little notice as after service, in case of bad experience with component.
echo '<h2>Did something go wrong? Are you disappointed?</h2>
@ -60,21 +61,21 @@ class com_###component###InstallerScript
/**
* Called on update
*
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function update(JAdapterInstance $parent){}
public function update(ComponentAdapter $parent){}
/**
* Called before any type of action
*
* @param string $type Which action is happening (install|uninstall|discover_install|update)
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function preflight($type, JAdapterInstance $parent)
public function preflight($type, ComponentAdapter $parent)
{
// get application
$app = JFactory::getApplication();
@ -113,11 +114,11 @@ class com_###component###InstallerScript
* Called after any type of action
*
* @param string $type Which action is happening (install|uninstall|discover_install|update)
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function postflight($type, JAdapterInstance $parent)
public function postflight($type, ComponentAdapter $parent)
{
// get application
$app = JFactory::getApplication();###MOVEFOLDERSSCRIPT###