Stable release of v3.1.19

We fixed #972 so that custom code (in the header) will be added after the power namespaces. We added a message to show when a server move failed. We fixed the BaseConfig to not use '_' as separator. We fixed the footable loading issue. We removed the need for passing placeholders by reference. We added the option to generate a CHANGELOG. We fixed the server class to load new client if server details changed. We fixed the readme placeholder issue #978. We fixed the empty server url issue #978. Fixed Package import to now use the phplibsec version 3.
This commit is contained in:
2023-02-27 14:27:41 +02:00
parent 339aec221e
commit 737bd03e46
55 changed files with 1900 additions and 1048 deletions

View File

@@ -813,50 +813,47 @@ class Data
$this->libraries->set($module->code_name, $module);
// add PHP in module install
$module->add_install_script = false;
$addScriptMethods = array('php_preflight',
$module->add_install_script = true;
$addScriptMethods = [
'php_script',
'php_preflight',
'php_postflight',
'php_method');
$addScriptTypes = array('install', 'update',
'uninstall');
'php_method'
];
$addScriptTypes = [
'install',
'update',
'uninstall'
];
// the next are php placeholders
$guiMapper['type'] = 'php';
foreach ($addScriptMethods as $scriptMethod)
{
foreach ($addScriptTypes as $scriptType)
{
if (isset(
$module->{'add_' . $scriptMethod . '_'
. $scriptType}
)
&& $module->{'add_' . $scriptMethod . '_'
. $scriptType} == 1
if (isset($module->{'add_' . $scriptMethod . '_' . $scriptType})
&& $module->{'add_' . $scriptMethod . '_' . $scriptType} == 1
&& StringHelper::check(
$module->{$scriptMethod . '_' . $scriptType}
))
{
// set GUI mapper field
$guiMapper['field'] = $scriptMethod . '_'
. $scriptType;
$guiMapper['field'] = $scriptMethod . '_' . $scriptType;
$module->{$scriptMethod . '_' . $scriptType} = $this->gui->set(
$this->placeholder->update_(
$this->customcode->update(
base64_decode(
(string) $module->{$scriptMethod . '_'
. $scriptType}
(string) $module->{$scriptMethod . '_' . $scriptType}
)
)
),
$guiMapper
);
$module->add_install_script = true;
}
else
{
unset($module->{$scriptMethod . '_' . $scriptType});
$module->{'add_' . $scriptMethod . '_'
. $scriptType}
= 0;
$module->{'add_' . $scriptMethod . '_' . $scriptType} = 0;
}
}
}

View File

@@ -307,19 +307,17 @@ class Structure
// set install script if needed
if ($module->add_install_script)
{
$fileDetails = array('path' => $module->folder_path
. '/script.php',
'name' => 'script.php',
'zip' => 'script.php');
$fileDetails = [
'path' => $module->folder_path . '/script.php',
'name' => 'script.php',
'zip' => 'script.php'
];
$this->file->write(
$fileDetails['path'],
'<?php' . PHP_EOL . '// Script template' .
PHP_EOL . Placefix::_h('BOM') . PHP_EOL
.
PHP_EOL . '// No direct access to this file'
. PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
PHP_EOL . Placefix::_h('BOM') . PHP_EOL .
PHP_EOL . '// No direct access to this file' . PHP_EOL .
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL .
Placefix::_h('INSTALLCLASS')
);
$this->files->appendArray($module->key, $fileDetails);
@@ -331,10 +329,11 @@ class Structure
// set readme if found
if ($module->addreadme)
{
$fileDetails = array('path' => $module->folder_path
. '/README.md',
'name' => 'README.md',
'zip' => 'README.md');
$fileDetails = [
'path' => $module->folder_path . '/README.md',
'name' => 'README.md',
'zip' => 'README.md'
];
$this->file->write($fileDetails['path'], $module->readme);
$this->files->appendArray($module->key, $fileDetails);
@@ -369,10 +368,11 @@ class Structure
$this->folder->create($module->folder_path . '/css');
// add the CSS file
$fileDetails = array('path' => $module->folder_path
. '/css/mod_admin.css',
'name' => 'mod_admin.css',
'zip' => 'mod_admin.css');
$fileDetails = [
'path' => $module->folder_path . '/css/mod_admin.css',
'name' => 'mod_admin.css',
'zip' => 'mod_admin.css'
];
$this->file->write(
$fileDetails['path'],
Placefix::_h('BOM') . PHP_EOL
@@ -409,10 +409,11 @@ class Structure
$this->folder->create($module->folder_path . '/js');
// add the CSS file
$fileDetails = array('path' => $module->folder_path
. '/js/mod_admin.js',
'name' => 'mod_admin.js',
'zip' => 'mod_admin.js');
$fileDetails = [
'path' => $module->folder_path . '/js/mod_admin.js',
'name' => 'mod_admin.js',
'zip' => 'mod_admin.js'
];
$this->file->write(
$fileDetails['path'],
Placefix::_h('BOM') . PHP_EOL
@@ -484,11 +485,11 @@ class Structure
foreach ($module->form_files as $file => $fields)
{
// set file details
$fileDetails = array('path' => $module->folder_path
. '/forms/' . $file . '.xml',
'name' => $file . '.xml',
'zip' => 'forms/' . $file
. '.xml');
$fileDetails = [
'path' => $module->folder_path . '/forms/' . $file . '.xml',
'name' => $file . '.xml',
'zip' => 'forms/' . $file . '.xml'
];
// build basic XML
$xml = '<?xml version="1.0" encoding="utf-8"?>';