From 5e980f5f95c475010d7f8b8493c114af84337fd6 Mon Sep 17 00:00:00 2001 From: aB0t Date: Mon, 22 Apr 2024 00:59:42 +0200 Subject: [PATCH] Release of v3.2.1-beta1 Add fallback option to ensure that all JCB tables and fields exist. Move the powers autoloader to its own file. --- CHANGELOG.md | 5 + README.md | 14 +- admin/README.txt | 14 +- admin/compiler/joomla_3/Helper.php | 9 +- admin/compiler/joomla_3/Helper_site.php | 9 +- admin/compiler/joomla_3/autoloader.php | 18 + admin/compiler/joomla_3/autoloader_site.php | 18 + admin/compiler/joomla_3/component_admin.php | 9 +- admin/compiler/joomla_3/component_site.php | 9 +- admin/compiler/joomla_3/script.php | 2 +- admin/compiler/joomla_3/settings.json | 14 + .../joomla_4/ADMIN_AUTOLOADER_CLASS.php | 18 + .../compiler/joomla_4/ADMIN_HELPER_CLASS.php | 7 +- admin/compiler/joomla_4/ADMIN_PROVIDER.php | 7 +- admin/compiler/joomla_4/INSTALLER_SCRIPT.php | 2 +- .../joomla_4/SITE_AUTOLOADER_CLASS.php | 18 + admin/compiler/joomla_4/SITE_HELPER_CLASS.php | 7 +- admin/compiler/joomla_4/settings.json | 14 + admin/componentbuilder.php | 109 +- admin/helpers/componentbuilder.php | 109 +- admin/helpers/powerloader.php | 67 + .../en-GB/en-GB.com_componentbuilder.ini | 99 +- admin/layouts/fieldtype/fields_fullwidth.php | 2 +- .../dash_install_fullwidth.php | 4 +- .../server/linked_components_fullwidth.php | 2 +- admin/models/ajax.php | 2 +- admin/models/fieldtype.php | 12 +- admin/models/forms/admin_view.xml | 2 +- admin/models/forms/joomla_component.xml | 1046 +-- admin/models/forms/joomla_module.xml | 18 +- admin/models/forms/joomla_plugin.xml | 18 +- admin/models/joomla_component.php | 234 +- admin/models/joomla_components.php | 46 +- admin/models/joomla_module.php | 36 - admin/models/joomla_plugin.php | 36 - admin/models/server.php | 2 +- admin/sql/install.mysql.utf8.sql | 121 +- admin/sql/updates/mysql/3.2.1-alpha4.sql | 2 + admin/views/admin_view/tmpl/edit.php | 356 +- admin/views/class_method/tmpl/edit.php | 10 +- admin/views/class_property/tmpl/edit.php | 10 +- admin/views/custom_admin_view/tmpl/edit.php | 100 +- admin/views/custom_code/tmpl/edit.php | 76 +- admin/views/dynamic_get/tmpl/edit.php | 364 +- admin/views/field/tmpl/edit.php | 118 +- admin/views/fieldtype/tmpl/edit.php | 340 +- admin/views/fieldtype/view.html.php | 2 +- admin/views/help_document/tmpl/edit.php | 60 +- admin/views/joomla_component/tmpl/edit.php | 462 +- admin/views/joomla_module/tmpl/edit.php | 345 +- admin/views/joomla_plugin/tmpl/edit.php | 373 +- admin/views/layout/tmpl/edit.php | 10 +- admin/views/library/tmpl/edit.php | 328 +- admin/views/power/tmpl/edit.php | 10 +- admin/views/server/tmpl/edit.php | 132 +- admin/views/server/view.html.php | 2 +- admin/views/site_view/tmpl/edit.php | 110 +- admin/views/template/tmpl/edit.php | 10 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 18 + .../VDM.Joomla/src/Abstraction/BaseTable.php | 252 +- .../VDM.Joomla/src/Abstraction/Registry.php | 24 +- .../VDM.Joomla/src/Abstraction/Schema.php | 419 ++ .../Compiler/Builder/ContentOne.php | 8 + .../Compiler/Creator/Builders.php | 57 +- .../Compiler/Helper/Infusion.php | 19 +- .../Compiler/Helper/Interpretation.php | 62 +- .../Componentbuilder/Compiler/JoomlaPower.php | 8 +- .../Compiler/Power/Autoloader.php | 3 +- .../src/Componentbuilder/Power/Super.php | 3 +- .../VDM.Joomla/src/Componentbuilder/Table.php | 5956 +++++++++++++++-- .../src/Componentbuilder/Table/Schema.php | 52 + .../src/Componentbuilder/Table/index.html | 1 + .../src/Interfaces/Registryinterface.php | 16 +- .../src/Interfaces/SchemaInterface.php | 53 + .../src/Interfaces/Tableinterface.php | 8 +- media/js/admin_view.js | 423 +- media/js/class_method.js | 38 +- media/js/class_property.js | 38 +- media/js/custom_admin_view.js | 100 +- media/js/custom_code.js | 84 +- media/js/dynamic_get.js | 904 +-- media/js/field.js | 290 +- media/js/fieldtype.js | 606 +- media/js/help_document.js | 164 +- media/js/joomla_component.js | 550 +- media/js/joomla_module.js | 448 +- media/js/joomla_plugin.js | 498 +- media/js/layout.js | 10 +- media/js/library.js | 562 +- media/js/power.js | 10 +- media/js/server.js | 346 +- media/js/site_view.js | 128 +- media/js/template.js | 10 +- script.php | 283 +- site/componentbuilder.php | 109 +- site/helpers/componentbuilder.php | 109 +- site/helpers/powerloader.php | 67 + 98 files changed, 11195 insertions(+), 6926 deletions(-) create mode 100644 admin/compiler/joomla_3/autoloader.php create mode 100644 admin/compiler/joomla_3/autoloader_site.php create mode 100644 admin/compiler/joomla_4/ADMIN_AUTOLOADER_CLASS.php create mode 100644 admin/compiler/joomla_4/SITE_AUTOLOADER_CLASS.php create mode 100644 admin/helpers/powerloader.php create mode 100644 admin/sql/updates/mysql/3.2.1-alpha4.sql create mode 100644 libraries/vendor_jcb/VDM.Joomla/src/Abstraction/Schema.php create mode 100644 libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Table/Schema.php create mode 100644 libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Table/index.html create mode 100644 libraries/vendor_jcb/VDM.Joomla/src/Interfaces/SchemaInterface.php create mode 100644 site/helpers/powerloader.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e8e01048..ff104021c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v3.2.1-beta1 + +- Add fallback option to ensure that all JCB tables and fields exist. +- Move the powers autoloader to its own file. + # v3.2.1-alpha4 - Add Joomla powers for namespace dynamic management. diff --git a/README.md b/README.md index d0603dd26..95be89a27 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.1-alpha4) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.1-beta1) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 16th April, 2024 -+ *Version*: 3.2.1-alpha4 ++ *Last Build*: 21st April, 2024 ++ *Version*: 3.2.1-beta1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **752849** -+ *Field count*: **2095** -+ *File count*: **5361** -+ *Folder count*: **470** ++ *Line count*: **763877** ++ *Field count*: **2097** ++ *File count*: **5380** ++ *Folder count*: **471** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/README.txt b/admin/README.txt index d0603dd26..95be89a27 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.1-alpha4) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.1-beta1) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 16th April, 2024 -+ *Version*: 3.2.1-alpha4 ++ *Last Build*: 21st April, 2024 ++ *Version*: 3.2.1-beta1 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **752849** -+ *Field count*: **2095** -+ *File count*: **5361** -+ *Folder count*: **470** ++ *Line count*: **763877** ++ *Field count*: **2097** ++ *File count*: **5380** ++ *Folder count*: **471** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index 6caa65c0a..5df959fc1 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -15,7 +15,14 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### +defined('_JEXEC') or die('Restricted access'); + +// The power autoloader for this project admin area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/powerloader.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} ###ADMIN_HELPER_CLASS_HEADER### diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index c831a708b..d773a70df 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -15,7 +15,14 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###SITE_POWER_HELPER### +defined('_JEXEC') or die('Restricted access'); + +// The power autoloader for this project site area. +$power_autoloader = JPATH_SITE . '/components/com_###component###/helpers/powerloader.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} ###SITE_HELPER_CLASS_HEADER### diff --git a/admin/compiler/joomla_3/autoloader.php b/admin/compiler/joomla_3/autoloader.php new file mode 100644 index 000000000..f28ef98fb --- /dev/null +++ b/admin/compiler/joomla_3/autoloader.php @@ -0,0 +1,18 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###ADMIN_POWER_HELPER### diff --git a/admin/compiler/joomla_3/autoloader_site.php b/admin/compiler/joomla_3/autoloader_site.php new file mode 100644 index 000000000..d182b4669 --- /dev/null +++ b/admin/compiler/joomla_3/autoloader_site.php @@ -0,0 +1,18 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###SITE_POWER_HELPER### diff --git a/admin/compiler/joomla_3/component_admin.php b/admin/compiler/joomla_3/component_admin.php index cc77f250d..f4f64bed3 100644 --- a/admin/compiler/joomla_3/component_admin.php +++ b/admin/compiler/joomla_3/component_admin.php @@ -15,7 +15,14 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### +defined('_JEXEC') or die('Restricted access'); + +// The power autoloader for this project admin area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/powerloader.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} ###ADMIN_COMPONENT_HEADER### diff --git a/admin/compiler/joomla_3/component_site.php b/admin/compiler/joomla_3/component_site.php index cd21c9a13..99dd26f53 100644 --- a/admin/compiler/joomla_3/component_site.php +++ b/admin/compiler/joomla_3/component_site.php @@ -15,7 +15,14 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### +defined('_JEXEC') or die('Restricted access'); + +// The power autoloader for this project site area. +$power_autoloader = JPATH_SITE . '/components/com_###component###/helpers/powerloader.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} ###SITE_COMPONENT_HEADER### diff --git a/admin/compiler/joomla_3/script.php b/admin/compiler/joomla_3/script.php index 2b16ff45d..910c5e563 100644 --- a/admin/compiler/joomla_3/script.php +++ b/admin/compiler/joomla_3/script.php @@ -236,5 +236,5 @@ class Com_###Component###InstallerScript return $nr; } return false; - }###MOVEFOLDERSMETHOD### + }###INSTALLERMETHODS### } diff --git a/admin/compiler/joomla_3/settings.json b/admin/compiler/joomla_3/settings.json index 0b412ee2a..ff301f6a6 100644 --- a/admin/compiler/joomla_3/settings.json +++ b/admin/compiler/joomla_3/settings.json @@ -164,6 +164,20 @@ "newName": "category.php", "type": "file" }, + "autoloader.php": { + "naam": "autoloader.php", + "path": "c0mp0n3nt/admin/helpers", + "rename": "new", + "newName": "powerloader.php", + "type": "file" + }, + "autoloader_site.php": { + "naam": "autoloader_site.php", + "path": "c0mp0n3nt/site/helpers", + "rename": "new", + "newName": "powerloader.php", + "type": "file" + }, "script.php": { "naam": "script.php", "path": "c0mp0n3nt/", diff --git a/admin/compiler/joomla_4/ADMIN_AUTOLOADER_CLASS.php b/admin/compiler/joomla_4/ADMIN_AUTOLOADER_CLASS.php new file mode 100644 index 000000000..5f0142dd3 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_AUTOLOADER_CLASS.php @@ -0,0 +1,18 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###ADMIN_POWER_HELPER### diff --git a/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php b/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php index ddd00b885..3318da99a 100644 --- a/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php +++ b/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php @@ -15,7 +15,12 @@ defined('_JCB_TEMPLATE') or die; ###BOM### namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper; -###ADMIN_POWER_HELPER### +// The power autoloader for this project admin area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_###component###/src/Helper/PowerloaderHelper.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} ###ADMIN_HELPER_CLASS_HEADER### diff --git a/admin/compiler/joomla_4/ADMIN_PROVIDER.php b/admin/compiler/joomla_4/ADMIN_PROVIDER.php index 274892e72..4bd2aa763 100644 --- a/admin/compiler/joomla_4/ADMIN_PROVIDER.php +++ b/admin/compiler/joomla_4/ADMIN_PROVIDER.php @@ -14,7 +14,12 @@ defined('_JCB_TEMPLATE') or die; ?> ###BOM### -###ADMIN_POWER_HELPER### +// The power autoloader for this project admin area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_###component###/src/Helper/PowerloaderHelper.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} // (soon) use Joomla\CMS\Association\AssociationExtensionInterface; use Joomla\CMS\Categories\CategoryFactoryInterface; diff --git a/admin/compiler/joomla_4/INSTALLER_SCRIPT.php b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php index c147a8e72..133ee1132 100644 --- a/admin/compiler/joomla_4/INSTALLER_SCRIPT.php +++ b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php @@ -1095,5 +1095,5 @@ class Com_###Component###InstallerScript implements InstallerScriptInterface ); } } - }###MOVEFOLDERSMETHOD### + }###INSTALLERMETHODS### } diff --git a/admin/compiler/joomla_4/SITE_AUTOLOADER_CLASS.php b/admin/compiler/joomla_4/SITE_AUTOLOADER_CLASS.php new file mode 100644 index 000000000..d3af848bd --- /dev/null +++ b/admin/compiler/joomla_4/SITE_AUTOLOADER_CLASS.php @@ -0,0 +1,18 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###SITE_POWER_HELPER### diff --git a/admin/compiler/joomla_4/SITE_HELPER_CLASS.php b/admin/compiler/joomla_4/SITE_HELPER_CLASS.php index 12b92f571..7dad6f100 100644 --- a/admin/compiler/joomla_4/SITE_HELPER_CLASS.php +++ b/admin/compiler/joomla_4/SITE_HELPER_CLASS.php @@ -15,7 +15,12 @@ defined('_JCB_TEMPLATE') or die; ###BOM### namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper; -###SITE_POWER_HELPER### +// The power autoloader for this project site area. +$power_autoloader = JPATH_SITE . '/components/com_###component###/src/Helper/PowerloaderHelper.php'; +if (file_exists($power_autoloader)) +{ + require_once $power_autoloader; +} ###SITE_HELPER_CLASS_HEADER### diff --git a/admin/compiler/joomla_4/settings.json b/admin/compiler/joomla_4/settings.json index 4cc56d0f4..a9e17839f 100644 --- a/admin/compiler/joomla_4/settings.json +++ b/admin/compiler/joomla_4/settings.json @@ -161,6 +161,20 @@ "newName": "[[[Component]]]Helper.php", "type": "file" }, + "ADMIN_AUTOLOADER_CLASS.php": { + "naam": "ADMIN_AUTOLOADER_CLASS.php", + "path": "c0mp0n3nt/admin/src/Helper", + "rename": "new", + "newName": "PowerloaderHelper.php", + "type": "file" + }, + "SITE_AUTOLOADER_CLASS.php": { + "naam": "SITE_AUTOLOADER_CLASS.php", + "path": "c0mp0n3nt/site/src/Helper", + "rename": "new", + "newName": "PowerloaderHelper.php", + "type": "file" + }, "INSTALLER_SCRIPT.php": { "naam": "INSTALLER_SCRIPT.php", "path": "c0mp0n3nt/", diff --git a/admin/componentbuilder.php b/admin/componentbuilder.php index ea9d27d39..73a661884 100644 --- a/admin/componentbuilder.php +++ b/admin/componentbuilder.php @@ -12,114 +12,13 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// add the autoloader for the composer classes -$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php'; -if (file_exists($composer_autoloader)) +// The power autoloader for this project admin area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/powerloader.php'; +if (file_exists($power_autoloader)) { - require_once $composer_autoloader; + require_once $power_autoloader; } -// register additional namespace -\spl_autoload_register(function ($class) { - // project-specific base directories and namespace prefix - $search = [ - 'libraries/vendor_jcb/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea', - 'libraries/vendor_jcb/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', - 'libraries/vendor_jcb/VDM.Joomla' => 'VDM\\Joomla', - 'libraries/vendor_jcb/VDM.Minify' => 'VDM\\Minify', - 'libraries/vendor_jcb/VDM.Psr' => 'VDM\\Psr' - ]; - // Start the search and load if found - $found = false; - $found_base_dir = ""; - $found_len = 0; - foreach ($search as $base_dir => $prefix) - { - // does the class use the namespace prefix? - $len = strlen($prefix); - if (strncmp($prefix, $class, $len) === 0) - { - // we have a match so load the values - $found = true; - $found_base_dir = $base_dir; - $found_len = $len; - // done here - break; - } - } - // check if we found a match - if (!$found) - { - // not found so move to the next registered autoloader - return; - } - // get the relative class name - $relative_class = substr($class, $found_len); - // replace the namespace prefix with the base directory, replace namespace - // separators with directory separators in the relative class name, append - // with .php - $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; - // if the file exists, require it - if (file_exists($file)) - { - require $file; - } -}); - -// add the autoloader for the composer classes -$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php'; -if (file_exists($composer_autoloader)) -{ - require_once $composer_autoloader; -} - -// register additional namespace -\spl_autoload_register(function ($class) { - // project-specific base directories and namespace prefix - $search = [ - 'libraries/vendor_jcb/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea', - 'libraries/vendor_jcb/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', - 'libraries/vendor_jcb/VDM.Joomla' => 'VDM\\Joomla', - 'libraries/vendor_jcb/VDM.Minify' => 'VDM\\Minify', - 'libraries/vendor_jcb/VDM.Psr' => 'VDM\\Psr' - ]; - // Start the search and load if found - $found = false; - $found_base_dir = ""; - $found_len = 0; - foreach ($search as $base_dir => $prefix) - { - // does the class use the namespace prefix? - $len = strlen($prefix); - if (strncmp($prefix, $class, $len) === 0) - { - // we have a match so load the values - $found = true; - $found_base_dir = $base_dir; - $found_len = $len; - // done here - break; - } - } - // check if we found a match - if (!$found) - { - // not found so move to the next registered autoloader - return; - } - // get the relative class name - $relative_class = substr($class, $found_len); - // replace the namespace prefix with the base directory, replace namespace - // separators with directory separators in the relative class name, append - // with .php - $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; - // if the file exists, require it - if (file_exists($file)) - { - require $file; - } -}); - use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Access\Exception\NotAllowed; diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 5cbe418bc..b1a970aff 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -12,114 +12,13 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// add the autoloader for the composer classes -$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php'; -if (file_exists($composer_autoloader)) +// The power autoloader for this project admin area. +$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/powerloader.php'; +if (file_exists($power_autoloader)) { - require_once $composer_autoloader; + require_once $power_autoloader; } -// register additional namespace -\spl_autoload_register(function ($class) { - // project-specific base directories and namespace prefix - $search = [ - 'libraries/vendor_jcb/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea', - 'libraries/vendor_jcb/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', - 'libraries/vendor_jcb/VDM.Joomla' => 'VDM\\Joomla', - 'libraries/vendor_jcb/VDM.Minify' => 'VDM\\Minify', - 'libraries/vendor_jcb/VDM.Psr' => 'VDM\\Psr' - ]; - // Start the search and load if found - $found = false; - $found_base_dir = ""; - $found_len = 0; - foreach ($search as $base_dir => $prefix) - { - // does the class use the namespace prefix? - $len = strlen($prefix); - if (strncmp($prefix, $class, $len) === 0) - { - // we have a match so load the values - $found = true; - $found_base_dir = $base_dir; - $found_len = $len; - // done here - break; - } - } - // check if we found a match - if (!$found) - { - // not found so move to the next registered autoloader - return; - } - // get the relative class name - $relative_class = substr($class, $found_len); - // replace the namespace prefix with the base directory, replace namespace - // separators with directory separators in the relative class name, append - // with .php - $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; - // if the file exists, require it - if (file_exists($file)) - { - require $file; - } -}); - -// add the autoloader for the composer classes -$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php'; -if (file_exists($composer_autoloader)) -{ - require_once $composer_autoloader; -} - -// register additional namespace -\spl_autoload_register(function ($class) { - // project-specific base directories and namespace prefix - $search = [ - 'libraries/vendor_jcb/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea', - 'libraries/vendor_jcb/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', - 'libraries/vendor_jcb/VDM.Joomla' => 'VDM\\Joomla', - 'libraries/vendor_jcb/VDM.Minify' => 'VDM\\Minify', - 'libraries/vendor_jcb/VDM.Psr' => 'VDM\\Psr' - ]; - // Start the search and load if found - $found = false; - $found_base_dir = ""; - $found_len = 0; - foreach ($search as $base_dir => $prefix) - { - // does the class use the namespace prefix? - $len = strlen($prefix); - if (strncmp($prefix, $class, $len) === 0) - { - // we have a match so load the values - $found = true; - $found_base_dir = $base_dir; - $found_len = $len; - // done here - break; - } - } - // check if we found a match - if (!$found) - { - // not found so move to the next registered autoloader - return; - } - // get the relative class name - $relative_class = substr($class, $found_len); - // replace the namespace prefix with the base directory, replace namespace - // separators with directory separators in the relative class name, append - // with .php - $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; - // if the file exists, require it - if (file_exists($file)) - { - require $file; - } -}); - use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Access\Access; diff --git a/admin/helpers/powerloader.php b/admin/helpers/powerloader.php new file mode 100644 index 000000000..f95d8a694 --- /dev/null +++ b/admin/helpers/powerloader.php @@ -0,0 +1,67 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die; + +// add the autoloader for the composer classes +$composer_autoloader = JPATH_LIBRARIES . '/phpseclib3/vendor/autoload.php'; +if (file_exists($composer_autoloader)) +{ + require_once $composer_autoloader; +} + +// register additional namespace +\spl_autoload_register(function ($class) { + // project-specific base directories and namespace prefix + $search = [ + 'libraries/vendor_jcb/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea', + 'libraries/vendor_jcb/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF', + 'libraries/vendor_jcb/VDM.Joomla' => 'VDM\\Joomla', + 'libraries/vendor_jcb/VDM.Minify' => 'VDM\\Minify', + 'libraries/vendor_jcb/VDM.Psr' => 'VDM\\Psr' + ]; + // Start the search and load if found + $found = false; + $found_base_dir = ""; + $found_len = 0; + foreach ($search as $base_dir => $prefix) + { + // does the class use the namespace prefix? + $len = strlen($prefix); + if (strncmp($prefix, $class, $len) === 0) + { + // we have a match so load the values + $found = true; + $found_base_dir = $base_dir; + $found_len = $len; + // done here + break; + } + } + // check if we found a match + if (!$found) + { + // not found so move to the next registered autoloader + return; + } + // get the relative class name + $relative_class = substr($class, $found_len); + // replace the namespace prefix with the base directory, replace namespace + // separators with directory separators in the relative class name, append + // with .php + $file = JPATH_ROOT . '/' . $found_base_dir . '/src' . str_replace('\\', '/', $relative_class) . '.php'; + // if the file exists, require it + if (file_exists($file)) + { + require $file; + } +}); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 4292a60b1..cf6d61664 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -5654,11 +5654,12 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_NAMESPACE_PREFIX_LABEL="Add Namespace COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_ADMIN_LABEL="Add PHP (helper_admin Class)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL="Add PHP (helper Classes - Both admin & site)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_SITE_LABEL="Add PHP (helper_site Class)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP Method (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_INSTALL_LABEL="Add PHP Postflight (install)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_UPDATE_LABEL="Add PHP Postflight (update)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_INSTALL_LABEL="Add PHP Preflight (install)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_UPDATE_LABEL="Add PHP Preflight (update)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_METHOD_INSTALL_LABEL="Add PHP Methods to Class (in install/update class)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP to the uninstall method" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_INSTALL_LABEL="Add PHP in the postflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_UPDATE_LABEL="Add PHP in the postflight update (event)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_INSTALL_LABEL="Add PHP in the preflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_UPDATE_LABEL="Add PHP in the preflight update (event)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_DESCRIPTION="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL="Custom Code Placeholders" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_POWERS_DESCRIPTION="Should JCB add any powers that are connected to this component? This may be helpful if you are loading powers via another component, and would like to avoid adding it to both, just remember that in this case you need to load the powers via a plugin." @@ -5893,16 +5894,18 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_DESCRIPTION="Add The PHP a COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL="PHP (for both admin & site)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_DESCRIPTION="Add the PHP abstract Methods to add to the component helper class. Only Methods! as it will directly be add as methods to the helper class! Do not add the php tags." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL="PHP (site helper)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_INSTALL_DESCRIPTION="PHP methods that should be added to the install/update class of the component." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_INSTALL_LABEL="PHP Class Methods (in install/update class)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_DESCRIPTION="PHP script that should run during uninstall." -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL="PHP Method (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_DESCRIPTION="PHP script that should run postflight during install." -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL="PHP Postflight (install)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_DESCRIPTION="PHP script that should run postflight during update." -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL="PHP Postflight (update)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_DESCRIPTION="PHP script that should run preflight during install." -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL="PHP Preflight (install)" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP script that should run preflight during update." -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL="PHP Preflight (update)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL="PHP in the uninstall method" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_DESCRIPTION="PHP code that should run postflight during install." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL="PHP in the postflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_DESCRIPTION="PHP code that should run postflight during update." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL="PHP in the postflight update (event)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_DESCRIPTION="PHP code that should run preflight during install." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL="PHP in the preflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP code that should run preflight during update." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL="PHP in the preflight update (event)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_DESCRIPTION="PHP script for the global helper site event method." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL="Global Helper Site Event (method)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREFERRED_JOOMLA_VERSION_LABEL="Preferred Joomla Version" @@ -6133,12 +6136,12 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_DESCRIPTION="You can add a h COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_HEADER_DESCRIPTION="You can add your own custom helper header script." COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_HEADER_LABEL="Add Class Helper Header" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_LABEL="Add Class Helper" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP Method (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_POSTFLIGHT_INSTALL_LABEL="Add PHP Postflight (install)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_POSTFLIGHT_UPDATE_LABEL="Add PHP Postflight (update)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_PREFLIGHT_INSTALL_LABEL="Add PHP Preflight (install)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_PREFLIGHT_UNINSTALL_LABEL="Add PHP Preflight (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_PREFLIGHT_UPDATE_LABEL="Add PHP Preflight (update)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP to the uninstall method" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_POSTFLIGHT_INSTALL_LABEL="Add PHP in the postflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_POSTFLIGHT_UPDATE_LABEL="Add PHP in the postflight update (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_PREFLIGHT_INSTALL_LABEL="Add PHP in the preflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_PREFLIGHT_UNINSTALL_LABEL="Add PHP in the preflight uninstall (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_PREFLIGHT_UPDATE_LABEL="Add PHP in the preflight update (event)" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_PHP_SCRIPT_CONSTRUCT_LABEL="Add PHP Script Construct" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_SALES_SERVER_LABEL="Add Sales Server" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_SQL_LABEL="Add MySQL - (Install)" @@ -6320,17 +6323,17 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_PATH_LABEL="Path" COM_COMPONENTBUILDER_JOOMLA_MODULE_PATH_MESSAGE="Error! Please add extra field path here." COM_COMPONENTBUILDER_JOOMLA_MODULE_PERMISSION="Permissions" COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_METHOD_UNINSTALL_DESCRIPTION="PHP script that should run during uninstall." -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_METHOD_UNINSTALL_LABEL="PHP Method (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_INSTALL_DESCRIPTION="PHP script that should run postflight during install." -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_INSTALL_LABEL="PHP Postflight (install)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_UPDATE_DESCRIPTION="PHP script that should run postflight during update." -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_UPDATE_LABEL="PHP Postflight (update)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_INSTALL_DESCRIPTION="PHP script that should run preflight during install." -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_INSTALL_LABEL="PHP Preflight (install)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UNINSTALL_DESCRIPTION="PHP script that should run preflight during uninstall." -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UNINSTALL_LABEL="PHP Preflight (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP script that should run preflight during update." -COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UPDATE_LABEL="PHP Preflight (update)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_METHOD_UNINSTALL_LABEL="PHP in the uninstall method" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_INSTALL_DESCRIPTION="PHP code that should run postflight during install." +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_INSTALL_LABEL="PHP in the postflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_UPDATE_DESCRIPTION="PHP code that should run postflight during update." +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_POSTFLIGHT_UPDATE_LABEL="PHP in the postflight update (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_INSTALL_DESCRIPTION="PHP code that should run preflight during install." +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_INSTALL_LABEL="PHP in the preflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UNINSTALL_DESCRIPTION="PHP code that should run preflight during uninstall." +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UNINSTALL_LABEL="PHP in the preflight uninstall (event)" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP code that should run preflight during update." +COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_PREFLIGHT_UPDATE_LABEL="PHP in the preflight update (event)" COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_SCRIPT_CONSTRUCT_DESCRIPTION="PHP script that should run in __construct of script." COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_SCRIPT_CONSTRUCT_LABEL="PHP Script Construct" COM_COMPONENTBUILDER_JOOMLA_MODULE_PUBLISHING="Publishing" @@ -6544,12 +6547,12 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_DESCRIPTION="Set other rule path" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_LABEL="Other Rule Path" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_DESCRIPTION="You can add your own custom header script, combined with the default header script that make the extended class work." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_LABEL="Add Custom Class Header" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP Method (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_POSTFLIGHT_INSTALL_LABEL="Add PHP Postflight (install)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_POSTFLIGHT_UPDATE_LABEL="Add PHP Postflight (update)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_PREFLIGHT_INSTALL_LABEL="Add PHP Preflight (install)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_PREFLIGHT_UNINSTALL_LABEL="Add PHP Preflight (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_PREFLIGHT_UPDATE_LABEL="Add PHP Preflight (update)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP to the uninstall method" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_POSTFLIGHT_INSTALL_LABEL="Add PHP in the postflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_POSTFLIGHT_UPDATE_LABEL="Add PHP in the postflight update (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_PREFLIGHT_INSTALL_LABEL="Add PHP in the preflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_PREFLIGHT_UNINSTALL_LABEL="Add PHP in the preflight uninstall (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_PREFLIGHT_UPDATE_LABEL="Add PHP in the preflight update (event)" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_SCRIPT_CONSTRUCT_LABEL="Add PHP Script Construct" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_SALES_SERVER_LABEL="Add Sales Server" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_SQL_LABEL="Add MySQL - (Install)" @@ -6768,17 +6771,17 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PATH_LABEL="Path" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PATH_MESSAGE="Error! Please add extra field path here." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PERMISSION="Permissions" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_METHOD_UNINSTALL_DESCRIPTION="PHP script that should run during uninstall." -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_METHOD_UNINSTALL_LABEL="PHP Method (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_INSTALL_DESCRIPTION="PHP script that should run postflight during install." -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_INSTALL_LABEL="PHP Postflight (install)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_UPDATE_DESCRIPTION="PHP script that should run postflight during update." -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_UPDATE_LABEL="PHP Postflight (update)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_INSTALL_DESCRIPTION="PHP script that should run preflight during install." -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_INSTALL_LABEL="PHP Preflight (install)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UNINSTALL_DESCRIPTION="PHP script that should run preflight during uninstall." -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UNINSTALL_LABEL="PHP Preflight (uninstall)" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP script that should run preflight during update." -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UPDATE_LABEL="PHP Preflight (update)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_METHOD_UNINSTALL_LABEL="PHP in the uninstall method" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_INSTALL_DESCRIPTION="PHP code that should run postflight during install." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_INSTALL_LABEL="PHP in the postflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_UPDATE_DESCRIPTION="PHP code that should run postflight during update." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_POSTFLIGHT_UPDATE_LABEL="PHP in the postflight update (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_INSTALL_DESCRIPTION="PHP code that should run preflight during install." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_INSTALL_LABEL="PHP in the preflight install (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UNINSTALL_DESCRIPTION="PHP code that should run preflight during uninstall." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UNINSTALL_LABEL="PHP in the preflight uninstall (event)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP code that should run preflight during update." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_PREFLIGHT_UPDATE_LABEL="PHP in the preflight update (event)" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_SCRIPT_CONSTRUCT_DESCRIPTION="PHP script that should run in __construct of script." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_SCRIPT_CONSTRUCT_LABEL="PHP Script Construct" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PLUGIN="Plugin" diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index af8e274a3..12843da04 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -19,7 +19,7 @@ use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; // set the defaults -$items = $displayData->vycfields; +$items = $displayData->vxtfields; $user = Factory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/layouts/joomla_component/dash_install_fullwidth.php b/admin/layouts/joomla_component/dash_install_fullwidth.php index 76916652b..73a740bb6 100644 --- a/admin/layouts/joomla_component/dash_install_fullwidth.php +++ b/admin/layouts/joomla_component/dash_install_fullwidth.php @@ -35,7 +35,9 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_php_postflight_update', 'php_postflight_update', 'add_php_method_uninstall', - 'php_method_uninstall' + 'php_method_uninstall', + 'add_php_method_install', + 'php_method_install' ); $hiddenFields = $displayData->get('hidden_fields') ?: []; diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 1672fb03e..a63f14529 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -20,7 +20,7 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\GetHelper; // set the defaults -$items = $displayData->vymlinked_components; +$items = $displayData->vydlinked_components; $user = Factory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 245fde123..ea8e4c8d5 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -2814,7 +2814,7 @@ class ComponentbuilderModelAjax extends ListModel // #__componentbuilder_joomla_component (a) 'joomla_component' => array( 'search' => array('id', 'system_name', 'php_preflight_install', 'php_postflight_install', - 'php_preflight_update', 'php_postflight_update', 'php_method_uninstall', + 'php_preflight_update', 'php_postflight_update', 'php_method_uninstall', 'php_method_install', 'php_helper_admin', 'php_admin_event', 'php_helper_both', 'php_helper_site', 'php_site_event', 'javascript', 'readme', 'sql', 'sql_uninstall'), 'views' => 'joomla_components', diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index c00a17e70..07df37b8b 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -257,7 +257,7 @@ class ComponentbuilderModelFieldtype extends AdminModel * * @return mixed An array of data items on success, false on failure. */ - public function getVycfields() + public function getVxtfields() { // Get the user object. $user = Factory::getUser(); @@ -399,13 +399,13 @@ class ComponentbuilderModelFieldtype extends AdminModel foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationVycfields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationVxtfields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationVycfields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationVxtfields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationVycfields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationVxtfields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationVycfields($item->store, 'store'); + $item->store = $this->selectionTranslationVxtfields($item->store, 'store'); } } @@ -419,7 +419,7 @@ class ComponentbuilderModelFieldtype extends AdminModel * * @return string The translatable string. */ - public function selectionTranslationVycfields($value,$name) + public function selectionTranslationVxtfields($value,$name) { // Array of datatype language strings if ($name === 'datatype') diff --git a/admin/models/forms/admin_view.xml b/admin/models/forms/admin_view.xml index 4cf4a253d..2bf33d335 100644 --- a/admin/models/forms/admin_view.xml +++ b/admin/models/forms/admin_view.xml @@ -886,7 +886,7 @@ class="text_area span12" filter="raw" hint="COM_COMPONENTBUILDER_ADMIN_VIEW_SQL_HINT" - required="true" + showon="add_sql:1" /> diff --git a/admin/models/forms/joomla_component.xml b/admin/models/forms/joomla_component.xml index c73ea45f5..51eecaf69 100644 --- a/admin/models/forms/joomla_component.xml +++ b/admin/models/forms/joomla_component.xml @@ -157,67 +157,6 @@ message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_MESSAGE" hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_HINT" /> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -261,80 +325,6 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - + + type="radio" + name="add_backup_folder_path" + label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_BACKUP_FOLDER_PATH_LABEL" + description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_BACKUP_FOLDER_PATH_DESCRIPTION" + class="btn-group btn-group-yesno" + default=""> + + + + - + + type="list" + name="translation_tool" + label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION_TOOL_LABEL" + class="list_class" + multiple="false" + default="0"> - + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NONE + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO - + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CUSTOM_USED_IN_CUSTOM_CODE - - - - - - - - + + + + + + + + - + - - + + - - - - - - - - - + - - - + + + + + + + - - - - - - - - - - - - - - + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO - + + + + + + + + + + + + + + + + + @@ -817,65 +856,39 @@ - - - - - - - - - - - - - - - + + + - - - - + + + + @@ -1179,11 +1192,11 @@ message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_MESSAGE" hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_HINT" /> - + @@ -1209,11 +1222,11 @@ message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JOOMLA_SOURCE_LINK_MESSAGE" hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JOOMLA_SOURCE_LINK_HINT" /> - + @@ -1239,6 +1252,22 @@ message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_MESSAGE" hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_HINT" /> + + + + + + + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_INTELLIGENT_ADDREMOVEIF - - + + - - - - - - - - + + + + + + + + + + + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_OTHER - - - - - - - - + + + + - - + + - - - - + + + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_OVERRIDE - - + + - - + + - - - - COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO - - + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_UIKIT_V3 - + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_FOOTABLE_V2 + + + + + + + + COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO - + @@ -1650,20 +1693,23 @@ validate="guid" hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID_HINT" /> - + - - - - + type="editor" + name="php_helper_both" + label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL" + description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_DESCRIPTION" + width="100%" + height="550px" + cols="15" + rows="80" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + showon="add_php_helper_both:1" + /> + default="0" + required="true"> @@ -357,6 +358,7 @@ class="list_class" multiple="false" default="0" + showon="add_sales_server:1" button="true" /> @@ -383,6 +385,7 @@ editor="codemirror|none" filter="raw" validate="code" + showon="add_php_preflight_update:1" /> @@ -401,6 +404,7 @@ editor="codemirror|none" filter="raw" validate="code" + showon="add_php_preflight_uninstall:1" /> @@ -840,6 +849,7 @@ editor="codemirror|none" filter="raw" validate="code" + showon="add_php_preflight_install:1" /> @@ -301,7 +302,8 @@ name="addreadme" label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDREADME_LABEL" class="btn-group btn-group-yesno" - default="0"> + default="0" + required="true"> @@ -404,6 +406,7 @@ editor="codemirror|none" filter="raw" validate="code" + showon="add_php_postflight_install:1" /> @@ -834,6 +843,7 @@ editor="codemirror|none" filter="raw" validate="code" + showon="add_php_preflight_uninstall:1" /> array( + 'libs_helpers' => array( 'fullwidth' => array( - 'note_buildcomp_dynamic_mysql', - 'buildcomp', - 'buildcompsql' + 'creatuserhelper', + 'adduikit', + 'addfootable', + 'add_email_helper', + 'add_php_helper_both', + 'php_helper_both', + 'add_php_helper_admin', + 'php_helper_admin', + 'add_admin_event', + 'php_admin_event', + 'add_php_helper_site', + 'php_helper_site', + 'add_site_event', + 'php_site_event', + 'add_javascript', + 'javascript', + 'add_css_admin', + 'css_admin', + 'add_css_site', + 'css_site' ) ), 'dynamic_integration' => array( @@ -120,15 +137,6 @@ class ComponentbuilderModelJoomla_component extends AdminModel 'crowdin_account_api_key' ) ), - 'mysql' => array( - 'fullwidth' => array( - 'add_sql', - 'sql', - 'add_sql_uninstall', - 'sql_uninstall', - 'assets_table_fix' - ) - ), 'dash_install' => array( 'left' => array( 'dashboard_type' @@ -148,31 +156,9 @@ class ComponentbuilderModelJoomla_component extends AdminModel 'add_php_postflight_update', 'php_postflight_update', 'add_php_method_uninstall', - 'php_method_uninstall' - ) - ), - 'libs_helpers' => array( - 'fullwidth' => array( - 'creatuserhelper', - 'adduikit', - 'addfootable', - 'add_email_helper', - 'add_php_helper_both', - 'php_helper_both', - 'add_php_helper_admin', - 'php_helper_admin', - 'add_admin_event', - 'php_admin_event', - 'add_php_helper_site', - 'php_helper_site', - 'add_site_event', - 'php_site_event', - 'add_javascript', - 'javascript', - 'add_css_admin', - 'css_admin', - 'add_css_site', - 'css_site' + 'php_method_uninstall', + 'add_php_method_install', + 'php_method_install' ) ), 'readme' => array( @@ -184,6 +170,22 @@ class ComponentbuilderModelJoomla_component extends AdminModel 'note_readme' ) ), + 'mysql' => array( + 'fullwidth' => array( + 'add_sql', + 'sql', + 'add_sql_uninstall', + 'sql_uninstall', + 'assets_table_fix' + ) + ), + 'dynamic_build' => array( + 'fullwidth' => array( + 'note_buildcomp_dynamic_mysql', + 'buildcomp', + 'buildcompsql' + ) + ), 'settings' => array( 'left' => array( 'note_moved_views', @@ -369,42 +371,18 @@ class ComponentbuilderModelJoomla_component extends AdminModel $item->metadata = $registry->toArray(); } - if (!empty($item->sql_uninstall)) - { - // base64 Decode sql_uninstall. - $item->sql_uninstall = base64_decode($item->sql_uninstall); - } - - if (!empty($item->php_postflight_install)) - { - // base64 Decode php_postflight_install. - $item->php_postflight_install = base64_decode($item->php_postflight_install); - } - if (!empty($item->php_site_event)) { // base64 Decode php_site_event. $item->php_site_event = base64_decode($item->php_site_event); } - if (!empty($item->php_helper_both)) - { - // base64 Decode php_helper_both. - $item->php_helper_both = base64_decode($item->php_helper_both); - } - if (!empty($item->php_admin_event)) { // base64 Decode php_admin_event. $item->php_admin_event = base64_decode($item->php_admin_event); } - if (!empty($item->css_admin)) - { - // base64 Decode css_admin. - $item->css_admin = base64_decode($item->css_admin); - } - if (!empty($item->php_preflight_install)) { // base64 Decode php_preflight_install. @@ -417,6 +395,30 @@ class ComponentbuilderModelJoomla_component extends AdminModel $item->php_method_uninstall = base64_decode($item->php_method_uninstall); } + if (!empty($item->css_admin)) + { + // base64 Decode css_admin. + $item->css_admin = base64_decode($item->css_admin); + } + + if (!empty($item->php_postflight_install)) + { + // base64 Decode php_postflight_install. + $item->php_postflight_install = base64_decode($item->php_postflight_install); + } + + if (!empty($item->sql)) + { + // base64 Decode sql. + $item->sql = base64_decode($item->sql); + } + + if (!empty($item->buildcompsql)) + { + // base64 Decode buildcompsql. + $item->buildcompsql = base64_decode($item->buildcompsql); + } + if (!empty($item->php_helper_admin)) { // base64 Decode php_helper_admin. @@ -453,16 +455,16 @@ class ComponentbuilderModelJoomla_component extends AdminModel $item->php_postflight_update = base64_decode($item->php_postflight_update); } - if (!empty($item->sql)) + if (!empty($item->php_method_install)) { - // base64 Decode sql. - $item->sql = base64_decode($item->sql); + // base64 Decode php_method_install. + $item->php_method_install = base64_decode($item->php_method_install); } - if (!empty($item->buildcompsql)) + if (!empty($item->sql_uninstall)) { - // base64 Decode buildcompsql. - $item->buildcompsql = base64_decode($item->buildcompsql); + // base64 Decode sql_uninstall. + $item->sql_uninstall = base64_decode($item->sql_uninstall); } if (!empty($item->readme)) @@ -471,23 +473,29 @@ class ComponentbuilderModelJoomla_component extends AdminModel $item->readme = base64_decode($item->readme); } + if (!empty($item->php_helper_both)) + { + // base64 Decode php_helper_both. + $item->php_helper_both = base64_decode($item->php_helper_both); + } + // Get the basic encryption. $basickey = ComponentbuilderHelper::getCryptKey('basic'); // Get the encryption object. $basic = new AES($basickey); - if (!empty($item->whmcs_key) && $basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true))) - { - // basic decrypt data whmcs_key. - $item->whmcs_key = rtrim($basic->decryptString($item->whmcs_key), "\0"); - } - if (!empty($item->crowdin_username) && $basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true))) { // basic decrypt data crowdin_username. $item->crowdin_username = rtrim($basic->decryptString($item->crowdin_username), "\0"); } + if (!empty($item->whmcs_key) && $basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true))) + { + // basic decrypt data whmcs_key. + $item->whmcs_key = rtrim($basic->decryptString($item->whmcs_key), "\0"); + } + if (!empty($item->export_key) && $basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true))) { // basic decrypt data export_key. @@ -1441,42 +1449,18 @@ class ComponentbuilderModelJoomla_component extends AdminModel $data['addcontributors'] = ''; } - // Set the sql_uninstall string to base64 string. - if (isset($data['sql_uninstall'])) - { - $data['sql_uninstall'] = base64_encode($data['sql_uninstall']); - } - - // Set the php_postflight_install string to base64 string. - if (isset($data['php_postflight_install'])) - { - $data['php_postflight_install'] = base64_encode($data['php_postflight_install']); - } - // Set the php_site_event string to base64 string. if (isset($data['php_site_event'])) { $data['php_site_event'] = base64_encode($data['php_site_event']); } - // Set the php_helper_both string to base64 string. - if (isset($data['php_helper_both'])) - { - $data['php_helper_both'] = base64_encode($data['php_helper_both']); - } - // Set the php_admin_event string to base64 string. if (isset($data['php_admin_event'])) { $data['php_admin_event'] = base64_encode($data['php_admin_event']); } - // Set the css_admin string to base64 string. - if (isset($data['css_admin'])) - { - $data['css_admin'] = base64_encode($data['css_admin']); - } - // Set the php_preflight_install string to base64 string. if (isset($data['php_preflight_install'])) { @@ -1489,6 +1473,30 @@ class ComponentbuilderModelJoomla_component extends AdminModel $data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']); } + // Set the css_admin string to base64 string. + if (isset($data['css_admin'])) + { + $data['css_admin'] = base64_encode($data['css_admin']); + } + + // Set the php_postflight_install string to base64 string. + if (isset($data['php_postflight_install'])) + { + $data['php_postflight_install'] = base64_encode($data['php_postflight_install']); + } + + // Set the sql string to base64 string. + if (isset($data['sql'])) + { + $data['sql'] = base64_encode($data['sql']); + } + + // Set the buildcompsql string to base64 string. + if (isset($data['buildcompsql'])) + { + $data['buildcompsql'] = base64_encode($data['buildcompsql']); + } + // Set the php_helper_admin string to base64 string. if (isset($data['php_helper_admin'])) { @@ -1525,16 +1533,16 @@ class ComponentbuilderModelJoomla_component extends AdminModel $data['php_postflight_update'] = base64_encode($data['php_postflight_update']); } - // Set the sql string to base64 string. - if (isset($data['sql'])) + // Set the php_method_install string to base64 string. + if (isset($data['php_method_install'])) { - $data['sql'] = base64_encode($data['sql']); + $data['php_method_install'] = base64_encode($data['php_method_install']); } - // Set the buildcompsql string to base64 string. - if (isset($data['buildcompsql'])) + // Set the sql_uninstall string to base64 string. + if (isset($data['sql_uninstall'])) { - $data['buildcompsql'] = base64_encode($data['buildcompsql']); + $data['sql_uninstall'] = base64_encode($data['sql_uninstall']); } // Set the readme string to base64 string. @@ -1543,23 +1551,29 @@ class ComponentbuilderModelJoomla_component extends AdminModel $data['readme'] = base64_encode($data['readme']); } + // Set the php_helper_both string to base64 string. + if (isset($data['php_helper_both'])) + { + $data['php_helper_both'] = base64_encode($data['php_helper_both']); + } + // Get the basic encryption key. $basickey = ComponentbuilderHelper::getCryptKey('basic'); // Get the encryption object $basic = new AES($basickey); - // Encrypt data whmcs_key. - if (isset($data['whmcs_key']) && $basickey) - { - $data['whmcs_key'] = $basic->encryptString($data['whmcs_key']); - } - // Encrypt data crowdin_username. if (isset($data['crowdin_username']) && $basickey) { $data['crowdin_username'] = $basic->encryptString($data['crowdin_username']); } + // Encrypt data whmcs_key. + if (isset($data['whmcs_key']) && $basickey) + { + $data['whmcs_key'] = $basic->encryptString($data['whmcs_key']); + } + // Encrypt data export_key. if (isset($data['export_key']) && $basickey) { diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 9763e0e12..1968aa8e6 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -2097,7 +2097,7 @@ class ComponentbuilderModelJoomla_components extends ListModel // #__componentbuilder_joomla_component (a) 'joomla_component' => array( 'search' => array('id', 'system_name', 'php_preflight_install', 'php_postflight_install', - 'php_preflight_update', 'php_postflight_update', 'php_method_uninstall', + 'php_preflight_update', 'php_postflight_update', 'php_method_uninstall', 'php_method_install', 'php_helper_admin', 'php_admin_event', 'php_helper_both', 'php_helper_site', 'php_site_event', 'javascript', 'readme', 'sql', 'sql_uninstall'), 'views' => 'joomla_components', @@ -2694,31 +2694,36 @@ class ComponentbuilderModelJoomla_components extends ListModel continue; } - // decode sql_uninstall - $item->sql_uninstall = base64_decode($item->sql_uninstall); - // decode php_postflight_install - $item->php_postflight_install = base64_decode($item->php_postflight_install); // decode php_site_event $item->php_site_event = base64_decode($item->php_site_event); - // decode php_helper_both - $item->php_helper_both = base64_decode($item->php_helper_both); // decode php_admin_event $item->php_admin_event = base64_decode($item->php_admin_event); - // decode css_admin - $item->css_admin = base64_decode($item->css_admin); + if ($basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true))) + { + // decrypt crowdin_username + $item->crowdin_username = $basic->decryptString($item->crowdin_username); + } // decode php_preflight_install $item->php_preflight_install = base64_decode($item->php_preflight_install); // decode php_method_uninstall $item->php_method_uninstall = base64_decode($item->php_method_uninstall); + // decode css_admin + $item->css_admin = base64_decode($item->css_admin); + // decode php_postflight_install + $item->php_postflight_install = base64_decode($item->php_postflight_install); + // decode sql + $item->sql = base64_decode($item->sql); + // decode buildcompsql + $item->buildcompsql = base64_decode($item->buildcompsql); + // decode php_helper_admin + $item->php_helper_admin = base64_decode($item->php_helper_admin); + // decode php_helper_site + $item->php_helper_site = base64_decode($item->php_helper_site); if ($basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true))) { // decrypt whmcs_key $item->whmcs_key = $basic->decryptString($item->whmcs_key); } - // decode php_helper_admin - $item->php_helper_admin = base64_decode($item->php_helper_admin); - // decode php_helper_site - $item->php_helper_site = base64_decode($item->php_helper_site); // decode javascript $item->javascript = base64_decode($item->javascript); // decode css_site @@ -2727,15 +2732,10 @@ class ComponentbuilderModelJoomla_components extends ListModel $item->php_preflight_update = base64_decode($item->php_preflight_update); // decode php_postflight_update $item->php_postflight_update = base64_decode($item->php_postflight_update); - // decode sql - $item->sql = base64_decode($item->sql); - if ($basickey && !is_numeric($item->crowdin_username) && $item->crowdin_username === base64_encode(base64_decode($item->crowdin_username, true))) - { - // decrypt crowdin_username - $item->crowdin_username = $basic->decryptString($item->crowdin_username); - } - // decode buildcompsql - $item->buildcompsql = base64_decode($item->buildcompsql); + // decode php_method_install + $item->php_method_install = base64_decode($item->php_method_install); + // decode sql_uninstall + $item->sql_uninstall = base64_decode($item->sql_uninstall); if ($basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true))) { // decrypt export_key @@ -2753,6 +2753,8 @@ class ComponentbuilderModelJoomla_components extends ListModel // decrypt crowdin_account_api_key $item->crowdin_account_api_key = $basic->decryptString($item->crowdin_account_api_key); } + // decode php_helper_both + $item->php_helper_both = base64_decode($item->php_helper_both); // unset the values we don't want exported. unset($item->asset_id); unset($item->checked_out); diff --git a/admin/models/joomla_module.php b/admin/models/joomla_module.php index eddc93149..592dded5d 100644 --- a/admin/models/joomla_module.php +++ b/admin/models/joomla_module.php @@ -689,42 +689,6 @@ class ComponentbuilderModelJoomla_module extends AdminModel return $data; } - /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ - public function validate($form, $data, $group = null) - { - // check if the not_required field is set - if (isset($data['not_required']) && UtilitiesStringHelper::check($data['not_required'])) - { - $requiredFields = (array) explode(',',(string) $data['not_required']); - $requiredFields = array_unique($requiredFields); - // now change the required field attributes value - foreach ($requiredFields as $requiredField) - { - // make sure there is a string value - if (UtilitiesStringHelper::check($requiredField)) - { - // change to false - $form->setFieldAttribute($requiredField, 'required', 'false'); - // also clear the data set - $data[$requiredField] = ''; - } - } - } - return parent::validate($form, $data, $group); - } - /** * Method to get the unique fields of this table. * diff --git a/admin/models/joomla_plugin.php b/admin/models/joomla_plugin.php index d773c25de..eb8fd4c1a 100644 --- a/admin/models/joomla_plugin.php +++ b/admin/models/joomla_plugin.php @@ -654,42 +654,6 @@ class ComponentbuilderModelJoomla_plugin extends AdminModel return $data; } - /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ - public function validate($form, $data, $group = null) - { - // check if the not_required field is set - if (isset($data['not_required']) && UtilitiesStringHelper::check($data['not_required'])) - { - $requiredFields = (array) explode(',',(string) $data['not_required']); - $requiredFields = array_unique($requiredFields); - // now change the required field attributes value - foreach ($requiredFields as $requiredField) - { - // make sure there is a string value - if (UtilitiesStringHelper::check($requiredField)) - { - // change to false - $form->setFieldAttribute($requiredField, 'required', 'false'); - // also clear the data set - $data[$requiredField] = ''; - } - } - } - return parent::validate($form, $data, $group); - } - /** * Method to get the unique fields of this table. * diff --git a/admin/models/server.php b/admin/models/server.php index 02c2150ad..bb324d5eb 100644 --- a/admin/models/server.php +++ b/admin/models/server.php @@ -198,7 +198,7 @@ class ComponentbuilderModelServer extends AdminModel * * @return mixed An array of data items on success, false on failure. */ - public function getVymlinked_components() + public function getVydlinked_components() { // Get the user object. $user = Factory::getUser(); diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index d2df56567..3ea0afee2 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -15,6 +15,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( `add_php_helper_admin` TINYINT(1) NOT NULL DEFAULT 0, `add_php_helper_both` TINYINT(1) NOT NULL DEFAULT 0, `add_php_helper_site` TINYINT(1) NOT NULL DEFAULT 0, + `add_php_method_install` TINYINT(1) NOT NULL DEFAULT 0, `add_php_method_uninstall` TINYINT(1) NOT NULL DEFAULT 0, `add_php_postflight_install` TINYINT(1) NOT NULL DEFAULT 0, `add_php_postflight_update` TINYINT(1) NOT NULL DEFAULT 0, @@ -75,6 +76,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( `php_helper_admin` MEDIUMTEXT NOT NULL, `php_helper_both` MEDIUMTEXT NOT NULL, `php_helper_site` MEDIUMTEXT NOT NULL, + `php_method_install` MEDIUMTEXT NOT NULL, `php_method_uninstall` MEDIUMTEXT NOT NULL, `php_postflight_install` MEDIUMTEXT NOT NULL, `php_postflight_update` MEDIUMTEXT NOT NULL, @@ -98,7 +100,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( `whmcs_buy_link` VARCHAR(255) NOT NULL DEFAULT '', `whmcs_key` VARCHAR(255) NOT NULL DEFAULT '', `whmcs_url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -114,18 +116,18 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( PRIMARY KEY (`id`), KEY `idx_system_name` (`system_name`), KEY `idx_name_code` (`name_code`), - KEY `idx_add_jcb_powers_path` (`add_jcb_powers_path`), - KEY `idx_add_sales_server` (`add_sales_server`), - KEY `idx_mvc_versiondate` (`mvc_versiondate`), KEY `idx_remove_line_breaks` (`remove_line_breaks`), - KEY `idx_add_placeholders` (`add_placeholders`), KEY `idx_debug_linenr` (`debug_linenr`), - KEY `idx_add_license` (`add_license`), - KEY `idx_license_type` (`license_type`), + KEY `idx_mvc_versiondate` (`mvc_versiondate`), KEY `idx_addreadme` (`addreadme`), - KEY `idx_add_powers` (`add_powers`), + KEY `idx_add_placeholders` (`add_placeholders`), KEY `idx_add_backup_folder_path` (`add_backup_folder_path`), KEY `idx_translation_tool` (`translation_tool`), + KEY `idx_add_license` (`add_license`), + KEY `idx_license_type` (`license_type`), + KEY `idx_add_powers` (`add_powers`), + KEY `idx_add_sales_server` (`add_sales_server`), + KEY `idx_add_jcb_powers_path` (`add_jcb_powers_path`), KEY `idx_add_php_helper_admin` (`add_php_helper_admin`), KEY `idx_add_admin_event` (`add_admin_event`), KEY `idx_add_php_helper_site` (`add_php_helper_site`), @@ -142,19 +144,20 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( KEY `idx_add_php_postflight_install` (`add_php_postflight_install`), KEY `idx_add_php_postflight_update` (`add_php_postflight_update`), KEY `idx_add_php_method_uninstall` (`add_php_method_uninstall`), + KEY `idx_add_php_method_install` (`add_php_method_install`), KEY `idx_add_sql` (`add_sql`), KEY `idx_add_sql_uninstall` (`add_sql_uninstall`), KEY `idx_assets_table_fix` (`assets_table_fix`), KEY `idx_add_update_server` (`add_update_server`), - KEY `idx_update_server_target` (`update_server_target`), KEY `idx_emptycontributors` (`emptycontributors`), + KEY `idx_update_server_target` (`update_server_target`), KEY `idx_add_git_folder_path` (`add_git_folder_path`), KEY `idx_creatuserhelper` (`creatuserhelper`), KEY `idx_adduikit` (`adduikit`), KEY `idx_addfootable` (`addfootable`), KEY `idx_add_email_helper` (`add_email_helper`), - KEY `idx_guid` (`guid`), KEY `idx_add_php_helper_both` (`add_php_helper_both`), + KEY `idx_guid` (`guid`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), KEY `idx_createdby` (`created_by`), @@ -207,7 +210,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module` ( `update_server` INT(11) NOT NULL DEFAULT 0, `update_server_target` TINYINT(1) NOT NULL DEFAULT 0, `update_server_url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -285,7 +288,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin` ( `update_server` INT(11) NOT NULL DEFAULT 0, `update_server_target` TINYINT(1) NOT NULL DEFAULT 0, `update_server_url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -330,7 +333,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_power` ( `guid` VARCHAR(36) NOT NULL DEFAULT '', `settings` TEXT NOT NULL, `system_name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -378,7 +381,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_power` ( `system_name` VARCHAR(255) NOT NULL DEFAULT '', `type` VARCHAR(64) NOT NULL DEFAULT '', `use_selection` TEXT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -501,7 +504,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_view` ( `sql` MEDIUMTEXT NOT NULL, `system_name` VARCHAR(255) NOT NULL DEFAULT '', `type` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -600,7 +603,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_custom_admin_view` ( `php_view` MEDIUMTEXT NOT NULL, `snippet` INT(11) NOT NULL DEFAULT 0, `system_name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -675,7 +678,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_site_view` ( `php_view` MEDIUMTEXT NOT NULL, `snippet` INT(11) NOT NULL DEFAULT 0, `system_name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -724,7 +727,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_template` ( `php_view` MEDIUMTEXT NOT NULL, `snippet` INT(11) NOT NULL DEFAULT 0, `template` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -760,7 +763,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_layout` ( `name` VARCHAR(255) NOT NULL DEFAULT '', `php_view` MEDIUMTEXT NOT NULL, `snippet` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -821,7 +824,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_dynamic_get` ( `view_selection` TEXT NOT NULL, `view_table_main` INT(11) NOT NULL DEFAULT 0, `where` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -870,7 +873,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_custom_code` ( `target` TINYINT(1) NOT NULL DEFAULT 0, `to_line` VARCHAR(100) NOT NULL DEFAULT '', `type` TINYINT(1) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -906,7 +909,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_property` ( `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, `name` VARCHAR(255) NOT NULL DEFAULT '', `visibility` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -941,7 +944,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_method` ( `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, `name` VARCHAR(255) NOT NULL DEFAULT '', `visibility` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -970,7 +973,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_placeholder` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `target` VARCHAR(255) NOT NULL DEFAULT '', `value` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1003,7 +1006,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_library` ( `php_setdocument` MEDIUMTEXT NOT NULL, `target` TINYINT(1) NOT NULL DEFAULT 1, `type` TINYINT(1) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1042,7 +1045,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_snippet` ( `type` INT(11) NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', `usage` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1073,7 +1076,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_validation_rule` ( `name` VARCHAR(255) NOT NULL DEFAULT '', `php` MEDIUMTEXT NOT NULL, `short_description` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1122,7 +1125,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_field` ( `on_save_model_field` TEXT NOT NULL, `store` INT(11) NOT NULL DEFAULT 0, `xml` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1175,7 +1178,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_fieldtype` ( `properties` TEXT NOT NULL, `short_description` VARCHAR(255) NOT NULL DEFAULT '', `store` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1214,7 +1217,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_language_translation` ( `plugins` TEXT NULL, `source` MEDIUMTEXT NOT NULL, `translation` TEXT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1239,7 +1242,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_language` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `langtag` VARCHAR(64) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1275,7 +1278,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_server` ( `secret` TEXT NOT NULL, `signature` TEXT NOT NULL, `username` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1312,7 +1315,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_help_document` ( `title` CHAR(64) NOT NULL DEFAULT '', `type` TINYINT(1) NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1341,7 +1344,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addfields` MEDIUMTEXT NOT NULL, `admin_view` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1367,7 +1370,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_conditions` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addconditions` MEDIUMTEXT NOT NULL, `admin_view` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1393,7 +1396,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_relations` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addrelations` MEDIUMTEXT NOT NULL, `admin_view` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1419,7 +1422,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_custom_tabs` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `admin_view` INT(11) NOT NULL DEFAULT 0, `tabs` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1445,7 +1448,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_admin_views` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addadmin_views` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1471,7 +1474,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_site_views` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addsite_views` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1497,7 +1500,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_custom_admin_views` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addcustom_admin_views` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1523,7 +1526,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_updates` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `joomla_component` INT(11) NOT NULL DEFAULT 0, `version_update` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1549,7 +1552,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_mysql_tweaks` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `joomla_component` INT(11) NOT NULL DEFAULT 0, `sql_tweak` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1575,7 +1578,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_custom_admin_menus` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addcustommenus` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1607,7 +1610,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_router` ( `mode_constructor_after_parent` TINYINT(1) NOT NULL DEFAULT 0, `mode_constructor_before_parent` TINYINT(1) NOT NULL DEFAULT 0, `mode_methods` TINYINT(1) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1633,7 +1636,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_config` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addconfig` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1660,7 +1663,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_dashboard` ( `dashboard_tab` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, `php_dashboard_methods` MEDIUMTEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1689,7 +1692,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_files_folders` ( `addfolders` TEXT NOT NULL, `addfoldersfullpath` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1715,7 +1718,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_placeholders` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addplaceholders` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1741,7 +1744,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_plugins` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addjoomla_plugins` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1767,7 +1770,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_modules` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addjoomla_modules` TEXT NOT NULL, `joomla_component` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1793,7 +1796,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_snippet_type` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `description` VARCHAR(255) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1819,7 +1822,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_library_config` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `addconfig` TEXT NOT NULL, `library` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1849,7 +1852,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_library_files_folders_urls` ( `addfoldersfullpath` TEXT NOT NULL, `addurls` TEXT NOT NULL, `library` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1877,7 +1880,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_extends` ( `extension_type` VARCHAR(64) NOT NULL DEFAULT '', `head` TEXT NULL, `name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1903,7 +1906,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module_updates` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `joomla_module` INT(11) NOT NULL DEFAULT 0, `version_update` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1933,7 +1936,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module_files_folders_urls `addfoldersfullpath` TEXT NOT NULL, `addurls` TEXT NOT NULL, `joomla_module` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1959,7 +1962,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_group` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `class_extends` INT(11) NOT NULL DEFAULT 0, `name` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -1986,7 +1989,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_updates` ( `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `joomla_plugin` INT(11) NOT NULL DEFAULT 0, `version_update` TEXT NOT NULL, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -2016,7 +2019,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_files_folders_urls `addfoldersfullpath` TEXT NOT NULL, `addurls` TEXT NOT NULL, `joomla_plugin` INT(11) NOT NULL DEFAULT 0, - `params` text NULL, + `params` TEXT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, diff --git a/admin/sql/updates/mysql/3.2.1-alpha4.sql b/admin/sql/updates/mysql/3.2.1-alpha4.sql new file mode 100644 index 000000000..902532589 --- /dev/null +++ b/admin/sql/updates/mysql/3.2.1-alpha4.sql @@ -0,0 +1,2 @@ +ALTER TABLE `#__componentbuilder_joomla_component` ADD `add_php_method_install` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_helper_site`; +ALTER TABLE `#__componentbuilder_joomla_component` ADD `php_method_install` MEDIUMTEXT NOT NULL AFTER `php_helper_site`; diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php index 24e9964e1..a683af364 100644 --- a/admin/views/admin_view/tmpl/edit.php +++ b/admin/views/admin_view/tmpl/edit.php @@ -206,521 +206,521 @@ $componentParams = $this->params; // will be removed just use $this->params inst