From 339aec221e8fb4c18fc5abf25aba83d6e5e42e6c Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 12 Feb 2023 21:15:41 +0200 Subject: [PATCH] Moves all major structre function to container. Adds new Server replacment class for legacy calls. Refactored multiple classes. Add more advanced compiler options, with donation notice. --- README.md | 12 +- admin/README.txt | 12 +- admin/helpers/compiler.php | 26 +- admin/helpers/compiler/a_Get.php | 7 +- admin/helpers/compiler/b_Structure.php | 1387 ++--------------- admin/helpers/compiler/c_Fields.php | 8 +- admin/helpers/compiler/e_Interpretation.php | 64 +- admin/helpers/compiler/f_Infusion.php | 19 +- admin/helpers/componentbuilder.php | 2 +- .../en-GB/en-GB.com_componentbuilder.ini | 102 +- admin/layouts/jcbsupportmessage.php | 116 ++ admin/models/ajax.php | 2 +- admin/models/componentbuilder.php | 2 +- admin/views/compiler/tmpl/default.php | 10 +- admin/views/compiler/view.html.php | 348 ++++- admin/views/search/view.html.php | 2 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 9 +- .../Compiler/Component/Dashboard.php | 213 +++ .../Compiler/Component/Data.php | 15 + .../Compiler/Component/Settings.php | 756 +++++++++ .../Compiler/Component/Structure.php | 118 ++ .../Compiler/Component/Structuremultiple.php | 355 +++++ .../Compiler/Component/Structuresingle.php | 609 ++++++++ .../src/Componentbuilder/Compiler/Config.php | 79 +- .../Compiler/Customcode/Extractor.php | 16 +- .../{Builder.php => Structure.php} | 6 +- .../{Builder.php => Structure.php} | 4 +- .../Library/{Builder.php => Structure.php} | 6 +- .../Compiler/Model/Createdate.php | 52 + .../Compiler/Model/Modifieddate.php | 155 ++ .../Compiler/Model/Updatesql.php | 8 +- .../src/Componentbuilder/Compiler/Power.php | 282 ++-- .../Compiler/Power/Autoloader.php | 413 +++-- .../Power/{Builder.php => Structure.php} | 8 +- .../Compiler/Service/Compiler.php | 18 + .../Compiler/Service/Component.php | 155 +- .../Compiler/Service/Customcode.php | 3 +- .../Compiler/Service/Joomlamodule.php | 26 +- .../Compiler/Service/Joomlaplugin.php | 26 +- .../Compiler/Service/Library.php | 14 +- .../Compiler/Service/Model.php | 34 + .../Compiler/Service/Power.php | 14 +- .../Compiler/Service/Utilities.php | 77 + .../Compiler/Utilities/Dynamicpath.php | 78 + .../Utilities/{Path.php => Pathfix.php} | 6 +- .../Compiler/Utilities/Paths.php | 128 +- .../Compiler/Utilities/Structure.php | 313 ++++ .../src/Componentbuilder/Server.php | 18 + .../src/Componentbuilder/Server/Ftp.php | 18 +- .../src/Componentbuilder/Server/Load.php | 4 +- .../Componentbuilder/Server/Model/Load.php | 2 + .../src/Componentbuilder/Server/Sftp.php | 38 +- .../Utilities/Constantpaths.php | 93 ++ .../src/Componentbuilder/Utilities/index.html | 1 + script.php | 2 +- site/helpers/componentbuilder.php | 2 +- .../en-GB/en-GB.com_componentbuilder.ini | 8 + 58 files changed, 4552 insertions(+), 1755 deletions(-) create mode 100644 admin/layouts/jcbsupportmessage.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Dashboard.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Settings.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structure.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuresingle.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlamodule/{Builder.php => Structure.php} (96%) rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/{Builder.php => Structure.php} (96%) rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Library/{Builder.php => Structure.php} (95%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Createdate.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Modifieddate.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/{Builder.php => Structure.php} (95%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Dynamicpath.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/{Path.php => Pathfix.php} (90%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/Constantpaths.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/index.html diff --git a/README.md b/README.md index 2c88d9ba6..c545ebfb5 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.1.13) 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.1.17) 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) @@ -140,14 +140,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*: 6th February, 2023 -+ *Version*: 3.1.13 ++ *Last Build*: 12th February, 2023 ++ *Version*: 3.1.17 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **360674** ++ *Line count*: **364590** + *Field count*: **2009** -+ *File count*: **2314** -+ *Folder count*: **408** ++ *File count*: **2325** ++ *Folder count*: **409** > 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:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 2c88d9ba6..c545ebfb5 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.1.13) 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.1.17) 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) @@ -140,14 +140,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*: 6th February, 2023 -+ *Version*: 3.1.13 ++ *Last Build*: 12th February, 2023 ++ *Version*: 3.1.17 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **360674** ++ *Line count*: **364590** + *Field count*: **2009** -+ *File count*: **2314** -+ *Folder count*: **408** ++ *File count*: **2325** ++ *Folder count*: **409** > 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:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 2de5cedac..ba182e7f0 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -620,27 +620,33 @@ class Compiler extends Infusion { // for plugin event TODO change event api signatures $component_context = CFactory::_('Config')->component_context; + // Trigger Event: jcb_ce_onBeforeSetFileContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeSetFileContent', array(&$component_context, &$name, &$path, &$bom, &$view) ); + // set the file name CFactory::_('Content')->set('FILENAME', $name); + // check if the file should get PHP opening $php = ''; if (ComponentbuilderHelper::checkFileType($name, 'php')) { $php = "trigger( 'jcb_ce_onGetFileContents', array(&$component_context, &$string, &$name, &$path, &$bom, &$view) ); + // see if we should add a BOM if (strpos((string) $string, (string) Placefix::_h('BOM')) !== false) { @@ -649,8 +655,10 @@ class Compiler extends Infusion ); $string = $php . $bom . $code; } + // set the answer $answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active, 3); + // set the dynamic answer if ($view) { @@ -658,19 +666,23 @@ class Compiler extends Infusion $answer, CFactory::_('Content')->get_($view), 3 ); } + // check if this file needs extra care :) - if (isset($this->updateFileContent[$path])) + if (CFactory::_('Registry')->exists('update.file.content.' . $path)) { $answer = CFactory::_('Customcode')->update($answer); } + // Trigger Event: jcb_ce_onBeforeSetFileContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeWriteFileContent', array(&$component_context, &$answer, &$name, &$path, &$bom, &$view) ); + // add answer back to file CFactory::_('Utilities.File')->write($path, $answer); + // count the file lines CFactory::_('Utilities.Counter')->line += substr_count((string) $answer, PHP_EOL); } @@ -695,7 +707,7 @@ class Compiler extends Infusion && ($update_server = CFactory::_('Component')->get('update_server')) !== null) { // move to server - ComponentbuilderHelper::moveToServer( + CFactory::_('Server')->legacyMove( $update_server_xml_path, $this->updateServerFileName . '.xml', (int) $update_server, @@ -726,7 +738,7 @@ class Compiler extends Infusion )) { // move to server - ComponentbuilderHelper::moveToServer( + CFactory::_('Server')->legacyMove( $module->update_server_xml_path, $module->update_server_xml_file_name, (int) $module->update_server, @@ -759,7 +771,7 @@ class Compiler extends Infusion )) { // move to server - ComponentbuilderHelper::moveToServer( + CFactory::_('Server')->legacyMove( $plugin->update_server_xml_path, $plugin->update_server_xml_file_name, (int) $plugin->update_server, @@ -1051,7 +1063,7 @@ class Compiler extends Infusion &$component_sales_name, &$this->componentData) ); // move to server - ComponentbuilderHelper::moveToServer( + CFactory::_('Server')->legacyMove( $this->filepath['component'], $component_sales_name . '.zip', (int) CFactory::_('Component')->get('sales_server'), @@ -1146,7 +1158,7 @@ class Compiler extends Infusion &$module) ); // move to server - ComponentbuilderHelper::moveToServer( + CFactory::_('Server')->legacyMove( $this->filepath['modules'][$module->id], $module->zip_name . '.zip', (int) $module->sales_server, @@ -1240,7 +1252,7 @@ class Compiler extends Infusion &$plugin) ); // move to server - ComponentbuilderHelper::moveToServer( + CFactory::_('Server')->legacyMove( $this->filepath['plugins'][$plugin->id], $plugin->zip_name . '.zip', (int) $plugin->sales_server, diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 99abf9918..2d1b75162 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -19,7 +19,6 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Unique; /** @@ -1140,7 +1139,7 @@ class Get // set the old version CFactory::_('Component')->set('old_component_version', CFactory::_('Component')->component_version); // set the new version, and set update switch - CFactory::_('Component')->set('component_version ', implode( + CFactory::_('Component')->set('component_version', implode( '.', $version )); } @@ -2772,7 +2771,7 @@ class Get * get the plugin xml template * * @return string - * + * @deprecated 3.3 */ public function getPluginXMLTemplate(&$plugin) { @@ -2804,7 +2803,6 @@ class Get * @param int $when To set when to update * * @return void - * * @deprecated 3.3 */ protected function setNewCustomCode($when = 1) @@ -2826,7 +2824,6 @@ class Get * @param int $when To set when to update * * @return void - * * @deprecated 3.3 */ protected function setExistingCustomCode($when = 1) diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 033aa2ae3..0da7c89ae 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -14,17 +14,10 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Filesystem\File; -use Joomla\CMS\Filesystem\Folder; -use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; - /** * Structure class @@ -262,6 +255,7 @@ class Structure extends Get * The Joomla Version Data * * @var object + * @deprecated 3.3 Use CFactory::_('Component.Settings') */ public $joomlaVersionData; @@ -291,6 +285,7 @@ class Structure extends Get * The standard folders * * @var array + * @deprecated 3.3 */ public $stdFolders = array('site', 'admin', 'media'); @@ -298,6 +293,7 @@ class Structure extends Get * The standard root files * * @var array + * @deprecated 3.3 */ public $stdRootFiles = array('access.xml', 'config.xml', 'controller.php', 'index.html', @@ -355,6 +351,7 @@ class Structure extends Get * The not new static items * * @var array + * @deprecated 3.3 Use CFactory::_('Registry')->get('files.not.new', []); */ public $notNew = array(); @@ -362,6 +359,7 @@ class Structure extends Get * Update the file content * * @var array + * @deprecated 3.3 Use CFactory::_('Registry')->get('update.file.content'); */ public $updateFileContent = array(); @@ -391,6 +389,7 @@ class Structure extends Get * The array of last modified dates * * @var array + * @deprecated 3.3 */ protected $lastModifiedDate = array(); @@ -398,6 +397,7 @@ class Structure extends Get * The default view switch * * @var bool/string + * @deprecated 3.3 Use CFactory::_('Registry')->get('build.dashboard'); */ public $dynamicDashboard = false; @@ -405,6 +405,7 @@ class Structure extends Get * The default view type * * @var string + * @deprecated 3.3 Use CFactory::_('Registry')->get('build.dashboard.type'); */ public $dynamicDashboardType; @@ -416,8 +417,6 @@ class Structure extends Get // first we run the parent constructor if (parent::__construct()) { - // set the standard admin file - $this->stdRootFiles[] = CFactory::_('Component')->get('name_code') . '.php'; // set incase no extra admin folder are loaded CFactory::_('Content')->set('EXSTRA_ADMIN_FOLDERS', ''); // set incase no extra site folder are loaded @@ -433,36 +432,29 @@ class Structure extends Get // make sure there is no old build CFactory::_('Utilities.Folder')->remove(CFactory::_('Utilities.Paths')->component_path); // load the libraries files/folders and url's - CFactory::_('Library.Builder')->run(); + CFactory::_('Library.Structure')->build(); // load the powers files/folders - CFactory::_('Power.Builder')->run(); + CFactory::_('Power.Structure')->build(); // load the module files/folders and url's - CFactory::_('Joomlamodule.Builder')->run(); + CFactory::_('Joomlamodule.Structure')->build(); // load the plugin files/folders and url's - CFactory::_('Joomlaplugin.Builder')->run(); - // set the Joomla Version Data - $this->joomlaVersionData = $this->setJoomlaVersionData(); - // for plugin event TODO change event api signatures - $component_context = CFactory::_('Config')->component_context; - // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData - CFactory::_('Event')->trigger( - 'jcb_ce_onAfterSetJoomlaVersionData', - array(&$component_context, &$this->joomlaVersionData) - ); + CFactory::_('Joomlaplugin.Structure')->build(); // set the dashboard - $this->setDynamicDashboard(); - // set the new folders - if (!$this->setFolders()) + CFactory::_('Component.Dashboard')->set(); + // set the component base structure + if (!CFactory::_('Component.Structure')->build()) { return false; } - // set all static folders and files - if (!$this->setStatic()) + + // set all single instance folders and files + if (!CFactory::_('Component.Structure.Single')->build()) { return false; } + // set all the dynamic folders and files - if (!$this->setDynamique()) + if (!CFactory::_('Component.Structure.Multiple')->build()) { return false; } @@ -477,33 +469,57 @@ class Structure extends Get * Build the Powers files, folders * * @return void - * @deprecated 3.3 Use CFactory::_('Power.Builder')->run(); + * @deprecated 3.3 Use CFactory::_('Power.Structure')->build(); */ private function buildPowers() { - CFactory::_('Power.Builder')->run(); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** * Build the Modules files, folders, url's and config * * @return void - * @deprecated 3.3 Use CFactory::_('Joomlamodule.Builder')->run(); + * @deprecated 3.3 Use CFactory::_('Joomlamodule.Structure')->build(); */ private function buildModules() { - CFactory::_('Joomlamodule.Builder')->run(); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** * Build the Plugins files, folders, url's and config * * @return void - * @deprecated 3.3 Use CFactory::_('Joomlaplugin.Builder')->run(); + * @deprecated 3.3 Use CFactory::_('Joomlaplugin.Structure')->build(); */ private function buildPlugins() { - CFactory::_('Joomlaplugin.Builder')->run(); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** @@ -514,161 +530,60 @@ class Structure extends Get */ private function createFolder($path) { - CFactory::_('Utilities.Folder')->create($path); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** * Build the Libraries files, folders, url's and config * * @return void - * @deprecated 3.3 Use CFactory::_('Library.Builder')->run(); + * @deprecated 3.3 Use CFactory::_('Library.Structure')->build(); */ private function setLibraries() { - CFactory::_('Library.Builder')->run(); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** * set the dynamic dashboard if set * * @return void - * + * @deprecated 3.3 Use CFactory::_('Component.Dashboard')->set(); */ private function setDynamicDashboard() { - // only add the dynamic dashboard if all checks out - if (CFactory::_('Component')->get('dashboard_type', 0) == 2 - && ($dashboard_ = CFactory::_('Component')->get('dashboard')) !== null - && StringHelper::check($dashboard_) - && strpos((string) $dashboard_, '_') !== false) - { - // set the default view - $getter = explode('_', (string) $dashboard_); - if (count((array) $getter) == 2 && is_numeric($getter[1])) - { - // the pointers - $t = StringHelper::safe($getter[0], 'U'); - $id = (int) $getter[1]; - // the dynamic stuff - $targets = array('A' => 'admin_views', - 'C' => 'custom_admin_views'); - $names = array('A' => 'admin view', - 'C' => 'custom admin view'); - $types = array('A' => 'adminview', 'C' => 'customadminview'); - $keys = array('A' => 'name_list', 'C' => 'code'); - // check the target values - if (isset($targets[$t]) && $id > 0) - { - // set the type name - $type_names = StringHelper::safe( - $targets[$t], 'w' - ); - // set the dynamic dash - if (($target_ = CFactory::_('Component')->get($targets[$t])) !== null - && ArrayHelper::check($target_)) - { - // search the target views - $dashboard = (array) array_filter( - $target_, - function ($view) use ($id, $t, $types) { - if (isset($view[$types[$t]]) - && $id == $view[$types[$t]]) - { - return true; - } - - return false; - } - ); - // set dashboard - if (ArrayHelper::check($dashboard)) - { - $dashboard = array_values($dashboard)[0]; - } - // check if view was found (this should be true) - if (isset($dashboard['settings']) - && isset($dashboard['settings']->{$keys[$t]})) - { - $this->dynamicDashboard - = StringHelper::safe( - $dashboard['settings']->{$keys[$t]} - ); - $this->dynamicDashboardType - = $targets[$t]; - } - else - { - // set massage that something is wrong - $this->app->enqueueMessage( - JText::_('

Dashboard Error

'), - 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', - $names[$t], $dashboard_, - $type_names - ), 'Error' - ); - } - } - else - { - // set massage that something is wrong - $this->app->enqueueMessage( - JText::_('

Dashboard Error

'), 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', - $names[$t], $dashboard_, - $type_names - ), 'Error' - ); - } - } - else - { - // the target value is wrong - $this->app->enqueueMessage( - JText::_('

Dashboard Error

'), 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The %s value for the dynamic dashboard is invalid.', - $dashboard_ - ), 'Error' - ); - } - } - else - { - // the target value is wrong - $this->app->enqueueMessage( - JText::_('

Dashboard Error

'), 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The %s value for the dynamic dashboard is invalid.', - $dashboard_ - ), 'Error' - ); - } - // if default was changed to dynamic dashboard the remove default tab and methods - if (StringHelper::check($this->dynamicDashboard)) - { - // dynamic dashboard is used - CFactory::_('Component')->remove('dashboard_tab'); - CFactory::_('Component')->remove('php_dashboard_methods'); - } - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** * Write data to file * * @return bool true on success - * + * @deprecated 3.3 */ public function writeFile($path, $data) { @@ -679,568 +594,58 @@ class Structure extends Get * Build the Initial Folders * * @return void - * + * @deprecated 3.3 Use CFactory::_('Component.Structure')->build(); */ private function setFolders() { - if (ObjectHelper::check( - $this->joomlaVersionData->create - )) - { - // creat the main component folder - if (!Folder::exists(CFactory::_('Utilities.Paths')->component_path)) - { - Folder::create(CFactory::_('Utilities.Paths')->component_path); - // count the folder created - CFactory::_('Utilities.Counter')->folder++; - CFactory::_('Utilities.File')->html(''); - } - // now build all folders needed for this component - foreach ($this->joomlaVersionData->create as $main => $folders) - { - CFactory::_('Utilities.Folder')->create(CFactory::_('Utilities.Paths')->component_path . '/' . $main); - if (ObjectHelper::check($folders)) - { - foreach ($folders as $sub => $subFolders) - { - CFactory::_('Utilities.Folder')->create( - CFactory::_('Utilities.Paths')->component_path . '/' . $main . '/' . $sub - ); - if (ObjectHelper::check($subFolders)) - { - foreach ($subFolders as $sub_2 => $subFolders_2) - { - CFactory::_('Utilities.Folder')->create( - CFactory::_('Utilities.Paths')->component_path . '/' . $main . '/' - . $sub . '/' . $sub_2 - ); - if (ObjectHelper::check( - $subFolders_2 - )) - { - foreach ( - $subFolders_2 as $sub_3 => $subFolders_3 - ) - { - CFactory::_('Utilities.Folder')->create( - CFactory::_('Utilities.Paths')->component_path . '/' . $main - . '/' . $sub . '/' . $sub_2 . '/' - . $sub_3 - ); - if (ObjectHelper::check( - $subFolders_3 - )) - { - foreach ( - $subFolders_3 as $sub_4 => - $subFolders_4 - ) - { - CFactory::_('Utilities.Folder')->create( - CFactory::_('Utilities.Paths')->component_path . '/' - . $main . '/' . $sub . '/' - . $sub_2 . '/' . $sub_3 - . '/' . $sub_4 - ); - if (ObjectHelper::check( - $subFolders_4 - )) - { - foreach ( - $subFolders_4 as $sub_5 - => $subFolders_5 - ) - { - CFactory::_('Utilities.Folder')->create( - CFactory::_('Utilities.Paths')->component_path - . '/' . $main . '/' - . $sub . '/' - . $sub_2 . '/' - . $sub_3 . '/' - . $sub_4 . '/' - . $sub_5 - ); - if (ObjectHelper::check( - $subFolders_5 - )) - { - foreach ( - $subFolders_5 as - $sub_6 => - $subFolders_6 - ) - { - CFactory::_('Utilities.Folder')->create( - CFactory::_('Utilities.Paths')->component_path - . '/' - . $main - . '/' - . $sub - . '/' - . $sub_2 - . '/' - . $sub_3 - . '/' - . $sub_4 - . '/' - . $sub_5 - . '/' - . $sub_6 - ); - if (ObjectHelper::check( - $subFolders_6 - )) - { - foreach ( - $subFolders_6 - as - $sub_7 - => - $subFolders_7 - ) - { - CFactory::_('Utilities.Folder')->create( - CFactory::_('Utilities.Paths')->component_path - . '/' - . $main - . '/' - . $sub - . '/' - . $sub_2 - . '/' - . $sub_3 - . '/' - . $sub_4 - . '/' - . $sub_5 - . '/' - . $sub_6 - . '/' - . $sub_7 - ); - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - - return true; - } - - return false; + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** * Set the Static File & Folder * * @return boolean - * + * @deprecated 3.3 Use CFactory::_('Component.Structure.Single')->build(); */ private function setStatic() { - if (ObjectHelper::check( - $this->joomlaVersionData->move->static - )) - { - $codeName = CFactory::_('Config')->component_code_name; - // TODO needs more looking at this must be dynamic actually - $this->notNew[] = 'LICENSE.txt'; - // do license check - $LICENSE = false; - $licenseChecker = strtolower((string) CFactory::_('Component')->get('license', '')); - if (strpos($licenseChecker, 'gnu') !== false - && strpos( - $licenseChecker, '2' - ) !== false - && (strpos($licenseChecker, 'gpl') !== false - || strpos( - $licenseChecker, 'general public license' - ) !== false)) - { - $LICENSE - = true; // we only add version 2 auto at this time (TODO) - } - // do README check - $README = false; - // add the README file if needed - if (CFactory::_('Component')->get('addreadme', false)) - { - $README = true; - } - // start moving - foreach ( - $this->joomlaVersionData->move->static as $ftem => $details - ) - { - // set item - $item = $details->naam; - // do the file renaming - if ($details->rename) - { - if ($details->rename === 'new') - { - $new = $details->newName; - } - else - { - $new = str_replace($details->rename, $codeName, (string) $item); - } - } - else - { - $new = $item; - } - // if not gnu/gpl license dont add the LICENSE.txt file - if ($item === 'LICENSE.txt' && !$LICENSE) - { - continue; - } - // if not needed do not add - if (($item === 'README.md' || $item === 'README.txt') - && !$README) - { - continue; - } - // check if we have a target value - if (isset($details->_target)) - { - // set destination path - $zipPath = str_replace( - $details->_target['type'] . '/', '', (string) $details->path - ); - $path = str_replace( - $details->_target['type'] . '/', - CFactory::_('Registry')->get('dynamic_paths.' . $details->_target['key'], '') . '/', - (string) $details->path - ); - } - else - { - // set destination path - $zipPath = str_replace('c0mp0n3nt/', '', (string) $details->path); - $path = str_replace( - 'c0mp0n3nt/', CFactory::_('Utilities.Paths')->component_path . '/', (string) $details->path - ); - } - // set the template folder path - $templatePath = (isset($details->custom) && $details->custom) - ? (($details->custom !== 'full') ? CFactory::_('Utilities.Paths')->template_path_custom - . '/' : '') : CFactory::_('Utilities.Paths')->template_path . '/'; - // set the final paths - $currentFullPath = (preg_match('/^[a-z]:/i', (string) $item)) ? $item - : $templatePath . '/' . $item; - $currentFullPath = str_replace('//', '/', (string) $currentFullPath); - $packageFullPath = str_replace('//', '/', $path . '/' . $new); - $zipFullPath = str_replace( - '//', '/', $zipPath . '/' . $new - ); - // now move the file - if ($details->type === 'file') - { - if (!File::exists($currentFullPath)) - { - $this->app->enqueueMessage( - JText::_('

File Path Error

'), 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The file path: %s does not exist, and was not added!', - $currentFullPath - ), 'Error' - ); - } - else - { - // get base name && get the path only - $packageFullPath0nly = str_replace( - basename($packageFullPath), '', $packageFullPath - ); - // check if path exist, if not creat it - if (!Folder::exists($packageFullPath0nly)) - { - Folder::create($packageFullPath0nly); - } - // move the file to its place - File::copy($currentFullPath, $packageFullPath); - // count the file created - CFactory::_('Utilities.Counter')->file++; - // store the new files - if (!in_array($ftem, $this->notNew)) - { - if (isset($details->_target)) - { - CFactory::_('Utilities.Files')->appendArray($details->_target['key'], - [ - 'path' => $packageFullPath, - 'name' => $new, - 'zip' => $zipFullPath - ] - ); - } - else - { - CFactory::_('Utilities.Files')->appendArray('static', - [ - 'path' => $packageFullPath, - 'name' => $new, - 'zip' => $zipFullPath - ] - ); - } - } - // ensure we update this file if needed - if (isset($this->updateFileContent[$ftem]) - && $this->updateFileContent[$ftem]) - { - // remove the pointer - unset($this->updateFileContent[$ftem]); - // set the full path - $this->updateFileContent[$packageFullPath] - = $packageFullPath; - } - } - } - elseif ($details->type === 'folder') - { - if (!Folder::exists($currentFullPath)) - { - $this->app->enqueueMessage( - JText::_('

Folder Path Error

'), - 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The folder path: %s does not exist, and was not added!', - $currentFullPath - ), 'Error' - ); - } - else - { - // move the folder to its place - Folder::copy( - $currentFullPath, $packageFullPath, '', true - ); - // count the folder created - CFactory::_('Utilities.Counter')->folder++; - } - } - // only add if no target found since those belong to plugins and modules - if (!isset($details->_target)) - { - // check if we should add the dynamic folder moving script to the installer script - $checker = array_values((array) explode('/', $zipFullPath)); - // TODO <-- this may not be the best way, will keep an eye on this. - // We basicly only want to check if a folder is added that is not in the stdFolders array - if (isset($checker[0]) - && StringHelper::check($checker[0]) - && !in_array($checker[0], $this->stdFolders)) - { - // activate dynamic folders - $this->setDynamicFolders(); - } - elseif (count((array) $checker) == 2 - && StringHelper::check($checker[0])) - { - $add_to_extra = false; - // set the target - $eNAME = 'FILES'; - $ename = 'filename'; - // this should not happen and must have been caught by the above if statment - if ($details->type === 'folder') - { - // only folders outside the standard folder are added - $eNAME = 'FOLDERS'; - $ename = 'folder'; - $add_to_extra = true; - } - // if this is a file, it can only be added to the admin/site/media folders - // all other folders are moved as a whole so their files do not need to be declared - elseif (in_array($checker[0], $this->stdFolders) - && !in_array($checker[1], $this->stdRootFiles)) - { - $add_to_extra = true; - } - // add if valid folder/file - if ($add_to_extra) - { - // set the tab - $eTab = Indent::_(2); - if ('admin' === $checker[0]) - { - $eTab = Indent::_(3); - } - // set the xml file - $key_ = 'EXSTRA_' - . StringHelper::safe( - $checker[0], 'U' - ) . '_' . $eNAME; - CFactory::_('Content')->add($key_, - PHP_EOL . $eTab . "<" . $ename . ">" - . $checker[1] . ""); - } - } - } - } - - return true; - } - - return false; + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** * Set the Dynamic File & Folder * * @return boolean + * @deprecated 3.3 Use CFactory::_('Component.Structure.Multiple')->build(); * */ private function setDynamique() { - $back = false; - $front = false; - if ((isset($this->joomlaVersionData->move->dynamic) - && ObjectHelper::check( - $this->joomlaVersionData->move->dynamic - )) - && CFactory::_('Component')->isArray('admin_views')) - { - if (!StringHelper::check($this->dynamicDashboard)) - { - // setup dashboard - $target = array('admin' => CFactory::_('Component')->get('name_code')); - $this->buildDynamique($target, 'dashboard'); - } - // now the rest of the views - foreach (CFactory::_('Component')->get('admin_views') as $nr => $view) - { - if (ObjectHelper::check($view['settings'])) - { - $created = $this->getCreatedDate($view); - $modified = $this->getLastModifiedDate($view); - if ($view['settings']->name_list != 'null') - { - $target - = array('admin' => $view['settings']->name_list); - $config = array(Placefix::_h('CREATIONDATE') => $created, - Placefix::_h('BUILDDATE') => $modified, - Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'list', false, $config); - } - if ($view['settings']->name_single != 'null') - { - $target - = array('admin' => $view['settings']->name_single); - $config = array(Placefix::_h('CREATIONDATE') => $created, - Placefix::_h('BUILDDATE') => $modified, - Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique( - $target, 'single', false, $config - ); - } - if (isset($view['edit_create_site_view']) - && is_numeric( - $view['edit_create_site_view'] - ) - && $view['edit_create_site_view'] > 0) - { - // setup the front site edit-view files - $target - = array('site' => $view['settings']->name_single); - $config = array(Placefix::_h('CREATIONDATE') => $created, - Placefix::_h('BUILDDATE') => $modified, - Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'edit', false, $config); - } - } - // quick set of checkin once - if (isset($view['checkin']) && $view['checkin'] == 1 - && !$this->addCheckin) - { - // switch to add checking to config - $this->addCheckin = true; - } - } - $back = true; - } - if ((isset($this->joomlaVersionData->move->dynamic) - && ObjectHelper::check( - $this->joomlaVersionData->move->dynamic - )) - && CFactory::_('Component')->isArray('site_views')) - { - - foreach (CFactory::_('Component')->get('site_views') as $nr => $view) - { - $created = $this->getCreatedDate($view); - $modified = $this->getLastModifiedDate($view); - if ($view['settings']->main_get->gettype == 2) - { - // set list view - $target = array('site' => $view['settings']->code); - $config = array(Placefix::_h('CREATIONDATE') => $created, - Placefix::_h('BUILDDATE') => $modified, - Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'list', false, $config); - } - elseif ($view['settings']->main_get->gettype == 1) - { - // set single view - $target = array('site' => $view['settings']->code); - $config = array(Placefix::_h('CREATIONDATE') => $created, - Placefix::_h('BUILDDATE') => $modified, - Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'single', false, $config); - } - } - $front = true; - } - if ((isset($this->joomlaVersionData->move->dynamic) - && ObjectHelper::check( - $this->joomlaVersionData->move->dynamic - )) - && CFactory::_('Component')->isArray('custom_admin_views')) - { - foreach (CFactory::_('Component')->get('custom_admin_views') as $nr => $view) - { - $created = $this->getCreatedDate($view); - $modified = $this->getLastModifiedDate($view); - if ($view['settings']->main_get->gettype == 2) - { - // set list view$view - $target = array('custom_admin' => $view['settings']->code); - $config = array(Placefix::_h('CREATIONDATE') => $created, - Placefix::_h('BUILDDATE') => $modified, - Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'list', false, $config); - } - elseif ($view['settings']->main_get->gettype == 1) - { - // set single view - $target = array('custom_admin' => $view['settings']->code); - $config = array(Placefix::_h('CREATIONDATE') => $created, - Placefix::_h('BUILDDATE') => $modified, - Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'single', false, $config); - } - } - $back = true; - } - // check if we had success - if ($back || $front) - { - return true; - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); return false; } @@ -1363,23 +768,11 @@ class Structure extends Get * @param array $view The view values * * @return string Last Modified Date - * + * @deprecated 3.3 Use CFactory::_('Model.Createdate')->get($view); */ public function getCreatedDate($view) { - if (isset($view['settings']->created) - && StringHelper::check($view['settings']->created)) - { - // first set the main date - $date = strtotime((string) $view['settings']->created); - } - else - { - // first set the main date - $date = strtotime("now"); - } - - return JFactory::getDate($date)->format('jS F, Y'); + return CFactory::_('Model.Createdate')->get($view); } /** @@ -1388,119 +781,11 @@ class Structure extends Get * @param array $view The view values * * @return string Last Modified Date - * + * @deprecated 3.3 Use CFactory::_('Model.Modifieddate')->get($view); */ public function getLastModifiedDate($view) { - // first set the main date - if (isset($view['settings']->modified) - && StringHelper::check($view['settings']->modified) - && '0000-00-00 00:00:00' !== $view['settings']->modified) - { - $date = strtotime((string) $view['settings']->modified); - } - else - { - // use todays date - $date = strtotime("now"); - } - // search for the last modified date - if (isset($view['adminview'])) - { - $id = $view['adminview'] . 'admin'; - // now check if value has been set - if (!isset($this->lastModifiedDate[$id])) - { - if (isset($view['settings']->fields) - && ArrayHelper::check( - $view['settings']->fields - )) - { - foreach ($view['settings']->fields as $field) - { - if (isset($field['settings']) - && ObjectHelper::check( - $field['settings'] - ) - && isset($field['settings']->modified) - && StringHelper::check( - $field['settings']->modified - ) - && '0000-00-00 00:00:00' - !== $field['settings']->modified) - { - $anotherDate = strtotime( - (string) $field['settings']->modified - ); - if ($anotherDate > $date) - { - $date = $anotherDate; - } - } - } - } - } - } - elseif (isset($view['siteview'])) - { - $id = $view['siteview'] . 'site'; - // now check if value has been set - if (!isset($this->lastModifiedDate[$id])) - { - if (isset($view['settings']->main_get->modified) - && StringHelper::check( - $view['settings']->main_get->modified - ) - && '0000-00-00 00:00:00' - !== $view['settings']->main_get->modified) - { - $anotherDate = strtotime( - (string) $view['settings']->main_get->modified - ); - if ($anotherDate > $date) - { - $date = $anotherDate; - } - } - } - } - elseif (isset($view['customadminview'])) - { - $id = $view['customadminview'] . 'customadmin'; - // now check if value has been set - if (!isset($this->lastModifiedDate[$id])) - { - if (isset($view['settings']->main_get->modified) - && StringHelper::check( - $view['settings']->main_get->modified - ) - && '0000-00-00 00:00:00' - !== $view['settings']->main_get->modified) - { - $anotherDate = strtotime( - (string) $view['settings']->main_get->modified - ); - if ($anotherDate > $date) - { - $date = $anotherDate; - } - } - } - } - // check if ID was found - if (!isset($id)) - { - $id = md5($date); - } - // now load the date - if (!isset($this->lastModifiedDate[$id])) - { - $this->lastModifiedDate[$id] = $date; - } - - return JFactory::getDate($this->lastModifiedDate[$id])->format( - 'jS F, Y' - ); + return CFactory::_('Model.Modifieddate')->get($view); } /** @@ -1512,440 +797,30 @@ class Structure extends Get * @param array $cofig to add more data to the files info * * @return boolean - * + * @deprecated 3.3 Use CFactory::_('Utilities.Structure')->build($target, $type, $fileName, $config); */ - public function buildDynamique($target, $type, $fileName = false, - $config = false - ) + public function buildDynamique($target, $type, $fileName = null, $config = null) { - // did we build the files (any number) - $build_status = false; - // check that we have the target values - if (ArrayHelper::check($target)) - { - // search the target - foreach ($target as $main => $name) - { - // make sure it is lower case - $name = StringHelper::safe($name); - // setup the files - foreach ( - $this->joomlaVersionData->move->dynamic->{$main} as $item => - $details - ) - { - if ($details->type === $type) - { - // set destination path - $path = ''; - if (strpos((string) $details->path, 'VIEW') !== false) - { - $path = str_replace('VIEW', $name, (string) $details->path); - } - else - { - $path = $details->path; - } - // make sure we have component to replace - if (strpos((string) $path, 'c0mp0n3nt') !== false) - { - $zipPath = str_replace('c0mp0n3nt/', '', (string) $path); - $path = str_replace( - 'c0mp0n3nt/', CFactory::_('Utilities.Paths')->component_path . '/', (string) $path - ); - } - else - { - $this->app->enqueueMessage( - JText::sprintf( - '

c0mp0n3nt issue found

The path (%s) could not be used.

', - $path - ), 'Error' - ); - continue; - } - - // setup the folder - if (!Folder::exists($path)) - { - Folder::create($path); - CFactory::_('Utilities.File')->html($zipPath); - // count the folder created - CFactory::_('Utilities.Counter')->folder++; - } - // do the file renaming - if ($details->rename) - { - if ($fileName) - { - $new = str_replace( - $details->rename, $fileName, (string) $item - ); - $name = $name . '_' . $fileName; - } - elseif ($details->rename === 'new') - { - $new = $details->newName; - } - else - { - $new = str_replace( - $details->rename, $name, (string) $item - ); - } - } - else - { - $new = $item; - } - if (!File::exists($path . '/' . $new)) - { - // move the file to its place - File::copy( - CFactory::_('Utilities.Paths')->template_path . '/' . $item, - $path . '/' . $new - ); - // count the file created - CFactory::_('Utilities.Counter')->file++; - } - // we can't have dots in a file name (oops) - if (strpos($name, '.') !== false) - { - $name = preg_replace('/[\.]+/', '_', (string) $name); - } - // setup array for new file - $newFIle = array('path' => $path . '/' . $new, - 'name' => $new, 'view' => $name, - 'zip' => $zipPath . '/' . $new); - if (ArrayHelper::check($config)) - { - $newFIle['config'] = $config; - } - // store the new files - CFactory::_('Utilities.Files')->appendArray('dynamic.' . $name, $newFIle); - // we have build atleast one - $build_status = true; - } - } - } - } - - return $build_status; + return CFactory::_('Utilities.Structure')->build($target, $type, $fileName, $config); } /** * set the Joomla Version Data * * @return object The version data - * + * @deprecated 3.3 */ private function setJoomlaVersionData() { - // option to load other settings - $custom_settings = CFactory::_('Utilities.Paths')->template_path . '/settings_' . CFactory::_('Config')->component_code_name . '.json'; - // set the version data - if (File::exists($custom_settings)) - { - $version_data = json_decode( - (string) FileHelper::getContent( - $custom_settings - ) - ); - } - else - { - $version_data = json_decode( - (string) FileHelper::getContent( - CFactory::_('Utilities.Paths')->template_path . '/settings.json' - ) - ); - } - // set some defaults - $uikit = CFactory::_('Config')->get('uikit', 0); - $footable = CFactory::_('Config')->get('footable', false); - $add_eximport = CFactory::_('Config')->get('add_eximport', false); - // add custom folders - if (CFactory::_('Component')->isArray('folders') - || $add_eximport || $uikit || $footable) - { - if ($add_eximport) - { - // move the import view folder in place - CFactory::_('Component')->appendArray('folders', array('folder' => 'importViews', - 'path' => 'admin/views/import', - 'rename' => 1)); - // move the phpspreadsheet Folder (TODO we must move this to a library package) - CFactory::_('Component')->appendArray('folders', array('folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor', - 'path' => '/libraries/phpspreadsheet/', - 'rename' => 0)); - } - - // set uikit - if (2 == $uikit || 1 == $uikit) - { - // move the UIKIT Folder into place - CFactory::_('Component')->appendArray('folders', array('folder' => 'uikit-v2', - 'path' => 'media', - 'rename' => 0)); - } - if (2 == $uikit || 3 == $uikit) - { - // move the UIKIT-3 Folder into place - CFactory::_('Component')->appendArray('folders', array('folder' => 'uikit-v3', - 'path' => 'media', - 'rename' => 0)); - } - - // set footable - $footable_version = CFactory::_('Config')->get('footable_version', 2); - if ($footable && 2 == $footable_version) - { - // move the footable folder into place - CFactory::_('Component')->appendArray('folders', array('folder' => 'footable-v2', - 'path' => 'media', - 'rename' => 0)); - } - elseif ($footable && 3 == $footable_version) - { - // move the footable folder into place - CFactory::_('Component')->appendArray('folders', array('folder' => 'footable-v3', - 'path' => 'media', - 'rename' => 0)); - } - - // pointer tracker - $pointer_tracker = 'h'; - foreach (CFactory::_('Component')->get('folders') as $custom) - { - // check type of target type - $_target_type = 'c0mp0n3nt'; - if (isset($custom['target_type'])) - { - $_target_type = $custom['target_type']; - } - // for good practice - ComponentbuilderHelper::fixPath( - $custom, array('path', 'folder', 'folderpath') - ); - // fix custom path - if (isset($custom['path']) - && StringHelper::check($custom['path'])) - { - $custom['path'] = trim((string) $custom['path'], '/'); - } - // by default custom path is true - $customPath = 'custom'; - // set full path if this is a full path folder - if (!isset($custom['folder']) && isset($custom['folderpath'])) - { - // update the dynamic path - $custom['folderpath'] = $this->updateDynamicPath( - $custom['folderpath'] - ); - // set the folder path with / if does not have a drive/windows full path - $custom['folder'] = (preg_match( - '/^[a-z]:/i', $custom['folderpath'] - )) - ? trim($custom['folderpath'], '/') - : '/' . trim($custom['folderpath'], '/'); - // remove the file path - unset($custom['folderpath']); - // triget fullpath - $customPath = 'full'; - } - // make sure we use the correct name - $pathArray = (array) explode('/', (string) $custom['path']); - $firstFolder = array_values($pathArray)[0]; - $lastFolder = end($pathArray); - // only rename folder if last has folder name - if (isset($custom['rename']) && $custom['rename'] == 1) - { - $custom['path'] = str_replace( - '/' . $lastFolder, '', (string) $custom['path'] - ); - $rename = 'new'; - $newname = $lastFolder; - } - elseif ('full' === $customPath) - { - // make sure we use the correct name - $folderArray = (array) explode('/', (string) $custom['folder']); - $lastFolder = end($folderArray); - $rename = 'new'; - $newname = $lastFolder; - } - else - { - $lastFolder = $custom['folder']; - $rename = false; - $newname = ''; - } - // insure we have no duplicates - $key_pointer = StringHelper::safe( - $custom['folder'] - ) . '_f' . $pointer_tracker; - $pointer_tracker++; - // fix custom path - $custom['path'] = ltrim((string) $custom['path'], '/'); - // set new folder to object - $version_data->move->static->{$key_pointer} = new stdClass(); - $version_data->move->static->{$key_pointer}->naam - = str_replace( - '//', '/', (string) $custom['folder'] - ); - $version_data->move->static->{$key_pointer}->path - = $_target_type - . '/' . $custom['path']; - $version_data->move->static->{$key_pointer}->rename = $rename; - $version_data->move->static->{$key_pointer}->newName = $newname; - $version_data->move->static->{$key_pointer}->type = 'folder'; - $version_data->move->static->{$key_pointer}->custom - = $customPath; - // set the target if type and id is found - if (isset($custom['target_id']) - && isset($custom['target_type'])) - { - $version_data->move->static->{$key_pointer}->_target - = array('key' => $custom['target_id'] . '_' - . $custom['target_type'], - 'type' => $custom['target_type']); - } - } - CFactory::_('Component')->remove('folders'); - unset($custom); - } - // get the google chart switch - $google_chart = CFactory::_('Config')->get('google_chart', false); - // add custom files - if (CFactory::_('Component')->isArray('files') - || $google_chart) - { - if ($google_chart) - { - // move the google chart files - CFactory::_('Component')->appendArray('files', array('file' => 'google.jsapi.js', - 'path' => 'media/js', - 'rename' => 0)); - CFactory::_('Component')->appendArray('files', array('file' => 'chartbuilder.php', - 'path' => 'admin/helpers', - 'rename' => 0)); - } - - // pointer tracker - $pointer_tracker = 'h'; - foreach (CFactory::_('Component')->get('files') as $custom) - { - // check type of target type - $_target_type = 'c0mp0n3nt'; - if (isset($custom['target_type'])) - { - $_target_type = $custom['target_type']; - } - // for good practice - ComponentbuilderHelper::fixPath( - $custom, array('path', 'file', 'filepath') - ); - // by default custom path is true - $customPath = 'custom'; - // set full path if this is a full path file - if (!isset($custom['file']) && isset($custom['filepath'])) - { - // update the dynamic path - $custom['filepath'] = $this->updateDynamicPath( - $custom['filepath'] - ); - // set the file path with / if does not have a drive/windows full path - $custom['file'] = (preg_match( - '/^[a-z]:/i', $custom['filepath'] - )) - ? trim($custom['filepath'], '/') - : '/' . trim($custom['filepath'], '/'); - // remove the file path - unset($custom['filepath']); - // triget fullpath - $customPath = 'full'; - } - // make sure we have not duplicates - $key_pointer = StringHelper::safe( - $custom['file'] - ) . '_g' . $pointer_tracker; - $pointer_tracker++; - // set new file to object - $version_data->move->static->{$key_pointer} = new stdClass(); - $version_data->move->static->{$key_pointer}->naam = str_replace( - '//', '/', (string) $custom['file'] - ); - // update the dynamic component name placholders in file names - $custom['path'] = CFactory::_('Placeholder')->update_( - $custom['path'] - ); - // get the path info - $pathInfo = pathinfo((string) $custom['path']); - if (isset($pathInfo['extension']) && $pathInfo['extension']) - { - $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); - // set the info - $version_data->move->static->{$key_pointer}->path - = $_target_type - . '/' . $pathInfo['dirname']; - $version_data->move->static->{$key_pointer}->rename = 'new'; - $version_data->move->static->{$key_pointer}->newName - = $pathInfo['basename']; - } - elseif ('full' === $customPath) - { - // fix custom path - $custom['path'] = ltrim((string) $custom['path'], '/'); - // get file array - $fileArray = (array) explode('/', (string) $custom['file']); - // set the info - $version_data->move->static->{$key_pointer}->path - = $_target_type - . '/' . $custom['path']; - $version_data->move->static->{$key_pointer}->rename = 'new'; - $version_data->move->static->{$key_pointer}->newName = end( - $fileArray - ); - } - else - { - // fix custom path - $custom['path'] = ltrim((string) $custom['path'], '/'); - // set the info - $version_data->move->static->{$key_pointer}->path - = $_target_type - . '/' . $custom['path']; - $version_data->move->static->{$key_pointer}->rename = false; - } - $version_data->move->static->{$key_pointer}->type = 'file'; - $version_data->move->static->{$key_pointer}->custom - = $customPath; - // set the target if type and id is found - if (isset($custom['target_id']) - && isset($custom['target_type'])) - { - $version_data->move->static->{$key_pointer}->_target - = array('key' => $custom['target_id'] . '_' - . $custom['target_type'], - 'type' => $custom['target_type']); - } - // check if file should be updated - if (!isset($custom['notnew']) || $custom['notnew'] == 0 - || $custom['notnew'] != 1) - { - $this->notNew[] = $key_pointer; - } - else - { - // update the file content - $this->updateFileContent[$key_pointer] = true; - } - } - CFactory::_('Component')->remove('files'); - unset($custom); - } - - return $version_data; + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

%s Warning

', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** @@ -1992,15 +867,11 @@ class Structure extends Get * @param string $path The full path * * @return string The updated path - * + * @deprecated 3.3 Use CFactory::_('Utilities.Dynamicpath')->update($path); */ protected function updateDynamicPath($path) { - return CFactory::_('Placeholder')->update_( - CFactory::_('Placeholder')->update( - $path, ComponentbuilderHelper::$constantPaths - ) - ); + return CFactory::_('Utilities.Dynamicpath')->update($path); } /** diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 5de6f89a0..4c785f487 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -5443,7 +5443,7 @@ class Fields extends Structure } // load another file $target = array('admin' => 'customfield'); - $this->buildDynamique( + CFactory::_('Utilities.Structure')->build( $target, 'fieldcustom', $data['custom']['type'] ); // get the extends name @@ -5540,7 +5540,7 @@ class Fields extends Structure { // first build the custom field type file $target = array('admin' => 'customfield'); - $this->buildDynamique( + CFactory::_('Utilities.Structure')->build( $target, 'field' . $data['custom']['extends'], $data['custom']['type'] ); @@ -5739,7 +5739,7 @@ class Fields extends Structure { // we first create the file $target = array('admin' => 'filter_' . $nameListCode); - $this->buildDynamique( + CFactory::_('Utilities.Structure')->build( $target, 'filter' ); // the search language string @@ -6087,7 +6087,7 @@ class Fields extends Structure CFactory::_('Content')->set_('customfilterfield_' . $filter['filter_type'], 'ADD_BUTTON', ''); // now build the custom filter field type file $target = array('admin' => 'customfilterfield'); - $this->buildDynamique( + CFactory::_('Utilities.Structure')->build( $target, 'fieldlist', $filter['filter_type'] ); diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index c4434e0c1..f31e63688 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -273,7 +273,7 @@ class Interpretation extends Fields $component = CFactory::_('Config')->component_code_name; $Component = CFactory::_('Content')->get('Component'); $target = array('admin' => 'emailer'); - $done = $this->buildDynamique($target, 'emailer', $component); + $done = CFactory::_('Utilities.Structure')->build($target, 'emailer', $component); if ($done) { // the text for the file BAKING @@ -820,7 +820,7 @@ class Interpretation extends Fields { // set whmcs encrypt file into place $target = array('admin' => 'whmcs'); - $done = $this->buildDynamique($target, 'whmcs'); + $done = CFactory::_('Utilities.Structure')->build($target, 'whmcs'); // the text for the file WHMCS_ENCRYPTION_BODY CFactory::_('Content')->set_('whmcs', 'WHMCS_ENCRYPTION_BODY', $this->setWHMCSCryption()); // ENCRYPT_FILE @@ -1105,7 +1105,7 @@ class Interpretation extends Fields ); $name = explode('.xml', $name)[0]; $target = array('admin' => $name); - $this->buildDynamique($target, 'update_server'); + CFactory::_('Utilities.Structure')->build($target, 'update_server'); CFactory::_('Content')->set_($name, 'UPDATE_SERVER_XML', implode(PHP_EOL, $updateXML)); // set the Update server file name @@ -1284,7 +1284,7 @@ class Interpretation extends Fields { $name = StringHelper::safe($update['version']); $target = array('admin' => $name); - $this->buildDynamique($target, 'sql_update', $update['version']); + CFactory::_('Utilities.Structure')->build($target, 'sql_update', $update['version']); $_name = preg_replace('/[\.]+/', '_', (string) $update['version']); CFactory::_('Content')->set_($name . '_' . $_name, 'UPDATE_VERSION_MYSQL', $update['mysql'] @@ -1389,10 +1389,10 @@ class Interpretation extends Fields { // set help file into admin place $target = array('admin' => 'help'); - $admindone = $this->buildDynamique($target, 'help'); + $admindone = CFactory::_('Utilities.Structure')->build($target, 'help'); // set the help file into site place $target = array('site' => 'help'); - $sitedone = $this->buildDynamique($target, 'help'); + $sitedone = CFactory::_('Utilities.Structure')->build($target, 'help'); if ($admindone && $sitedone) { // HELP @@ -2133,7 +2133,7 @@ class Interpretation extends Fields // build the file target values $target = array('site' => $nameSingleCode); // build the edit.xml file - if ($this->buildDynamique($target, 'admin_menu')) + if (CFactory::_('Utilities.Structure')->build($target, 'admin_menu')) { // set the lang $lang = StringHelper::safe( @@ -2183,7 +2183,7 @@ class Interpretation extends Fields // build the file target values $target = array('site' => $view['settings']->code); // build the default.xml file - if ($this->buildDynamique($target, 'menu')) + if (CFactory::_('Utilities.Structure')->build($target, 'menu')) { // set the lang $lang = StringHelper::safe( @@ -5471,9 +5471,11 @@ class Interpretation extends Fields elseif (1 == $type) { // add this button only if this is not the default view - if ($this->dynamicDashboardType !== 'custom_admin_views' - || ($this->dynamicDashboardType === 'custom_admin_views' - && $this->dynamicDashboard !== $viewCodeName)) + $dynamic_dashboard = CFactory::_('Registry')->get('build.dashboard', ''); + $dynamic_dashboard_type = CFactory::_('Registry')->get('build.dashboard.type', ''); + if ($dynamic_dashboard_type !== 'custom_admin_views' + || ($dynamic_dashboard_type === 'custom_admin_views' + && $dynamic_dashboard !== $viewCodeName)) { $buttons[] = $tab . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " add cpanel button"; @@ -5663,7 +5665,7 @@ class Interpretation extends Fields // add the controller for this view // build the file $target = array(CFactory::_('Config')->build_target => $viewCodeName); - $this->buildDynamique($target, 'custom_form'); + CFactory::_('Utilities.Structure')->build($target, 'custom_form'); // GET_FORM_CUSTOM } } @@ -5807,14 +5809,14 @@ class Interpretation extends Fields )) { // get dates - $created = $this->getCreatedDate($view); - $modified = $this->getLastModifiedDate($view); + $created = CFactory::_('Model.Createdate')->get($view); + $modified = CFactory::_('Model.Modifieddate')->get($view); // add file to view $target = array(CFactory::_('Config')->build_target => $view['settings']->code); $config = array(Placefix::_h('CREATIONDATE') => $created, Placefix::_h('BUILDDATE') => $modified, Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'javascript_file', false, $config); + CFactory::_('Utilities.Structure')->build($target, 'javascript_file', false, $config); // set path if ('site' === CFactory::_('Config')->build_target) { @@ -6997,8 +6999,8 @@ class Interpretation extends Fields if (($data_ = CFactory::_('Registry')-> extract('builder.template_data.' . CFactory::_('Config')->build_target . '.' . $view['settings']->code)) !== null) { - $created = $this->getCreatedDate($view); - $modified = $this->getLastModifiedDate($view); + $created = CFactory::_('Model.Createdate')->get($view); + $modified = CFactory::_('Model.Modifieddate')->get($view); foreach ($data_ as $template => $data) { // build the file @@ -7006,7 +7008,7 @@ class Interpretation extends Fields $config = array(Placefix::_h('CREATIONDATE') => $created, Placefix::_h('BUILDDATE') => $modified, Placefix::_h('VERSION') => $view['settings']->version); - $this->buildDynamique($target, 'template', $template, $config); + CFactory::_('Utilities.Structure')->build($target, 'template', $template, $config); // set the file data $TARGET = StringHelper::safe( CFactory::_('Config')->build_target, 'U' @@ -7050,7 +7052,7 @@ class Interpretation extends Fields { // build the file $target = array(CFactory::_('Config')->build_target => $layout); - $this->buildDynamique($target, 'layout'); + CFactory::_('Utilities.Structure')->build($target, 'layout'); // set the file data $TARGET = StringHelper::safe( CFactory::_('Config')->build_target, 'U' @@ -13424,12 +13426,12 @@ class Interpretation extends Fields { // first build the layout file $target = array('admin' => $nameSingleCode); - $this->buildDynamique($target, $type, $layoutName); + CFactory::_('Utilities.Structure')->build($target, $type, $layoutName); // add to front if needed if (CFactory::_('Config')->lang_target === 'both') { $target = array('site' => $nameSingleCode); - $this->buildDynamique($target, $type, $layoutName); + CFactory::_('Utilities.Structure')->build($target, $type, $layoutName); } if (StringHelper::check($items)) { @@ -13458,12 +13460,12 @@ class Interpretation extends Fields { // first build the layout file $target = array('admin' => $nameSingleCode); - $this->buildDynamique($target, 'layoutoverride', $layoutName); + CFactory::_('Utilities.Structure')->build($target, 'layoutoverride', $layoutName); // add to front if needed if (CFactory::_('Config')->lang_target === 'both') { $target = array('site' => $nameSingleCode); - $this->buildDynamique($target, 'layoutoverride', $layoutName); + CFactory::_('Utilities.Structure')->build($target, 'layoutoverride', $layoutName); } // make sure items is an empty string (should not be needed.. but) if (!StringHelper::check($items)) @@ -15404,7 +15406,7 @@ class Interpretation extends Fields { // setup Ajax files $target = array('admin' => 'import_' . $nameListCode); - $this->buildDynamique($target, 'customimport'); + CFactory::_('Utilities.Structure')->build($target, 'customimport'); // load the custom script to the files // IMPORT_EXT_METHOD <<>> CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_EXT_METHOD', CFactory::_('Customcode.Dispenser')->get( @@ -16566,14 +16568,14 @@ class Interpretation extends Fields && StringHelper::check($list_fileScript)) { // get dates - $_created = $this->getCreatedDate($viewArray); - $_modified = $this->getLastModifiedDate($viewArray); + $_created = CFactory::_('Model.Createdate')->get($viewArray); + $_modified = CFactory::_('Model.Modifieddate')->get($viewArray); // add file to view $_target = array(CFactory::_('Config')->build_target => $nameListCode); $_config = array(Placefix::_h('CREATIONDATE') => $_created, Placefix::_h('BUILDDATE') => $_modified, Placefix::_h('VERSION') => $viewArray['settings']->version); - $this->buildDynamique($_target, 'javascript_file', false, $_config); + CFactory::_('Utilities.Structure')->build($_target, 'javascript_file', false, $_config); // set path $_path = '/administrator/components/com_' . CFactory::_('Config')->component_code_name . '/assets/js/' . $nameListCode . '.js'; @@ -18733,7 +18735,7 @@ class Interpretation extends Fields { // lets also set the category helper for this view $target = array('site' => 'category' . $otherView); - $this->buildDynamique($target, 'category'); + CFactory::_('Utilities.Structure')->build($target, 'category'); // insure the file gets updated CFactory::_('Content')->set_('category' . $otherView, 'view', $otherView); CFactory::_('Content')->set_('category' . $otherView, 'View', ucfirst((string) $otherView)); @@ -22951,7 +22953,7 @@ class Interpretation extends Fields $slidecounter++; // build the template file $target = array('custom_admin' => CFactory::_('Config')->component_code_name); - $this->buildDynamique($target, 'template', $tempName); + CFactory::_('Utilities.Structure')->build($target, 'template', $tempName); // set the file data $TARGET = StringHelper::safe( CFactory::_('Config')->build_target, 'U' @@ -23178,7 +23180,7 @@ class Interpretation extends Fields // set the code name $codeName = CFactory::_('Config')->component_code_name; // set default dashboard - if (!StringHelper::check($this->dynamicDashboard)) + if (!CFactory::_('Registry')->get('build.dashboard')) { $menus .= "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_DASHBOARD'), 'index.php?option=com_" . $codeName @@ -24272,7 +24274,7 @@ class Interpretation extends Fields CFactory::_('Config')->lang_target, $lang . '_GLOBAL_DESC', "The Global Parameters" ); // add auto checkin if required - if ($this->addCheckin) + if (CFactory::_('Config')->get('add_checkin', false)) { $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . 'name="check_in"'; diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 18de73afc..7f9321938 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -116,7 +116,8 @@ class Infusion extends Interpretation CFactory::_('Content')->get('CREATIONDATE')); // BUILDDATE - CFactory::_('Content')->set('BUILDDATE', JFactory::getDate()->format('jS F, Y')); + CFactory::_('Content')->set('BUILDDATE', JFactory::getDate( + CFactory::_('Config')->get('build_date', 'now'))->format('jS F, Y')); CFactory::_('Content')->set('GLOBALBUILDDATE', CFactory::_('Content')->get('BUILDDATE')); @@ -1104,8 +1105,8 @@ class Infusion extends Interpretation ); // check if this custom admin view is the default view - if ($this->dynamicDashboardType === 'custom_admin_views' - && $this->dynamicDashboard === $view['settings']->code) + if (CFactory::_('Registry')->get('build.dashboard.type', '') === 'custom_admin_views' + && CFactory::_('Registry')->get('build.dashboard', '') === $view['settings']->code) { // HIDEMAINMENU <<>> CFactory::_('Content')->set_($view['settings']->code, 'HIDEMAINMENU', ''); @@ -1328,7 +1329,7 @@ class Infusion extends Interpretation $this->setVersionController(); // only set these if default dashboard it used - if (!StringHelper::check($this->dynamicDashboard)) + if (!CFactory::_('Registry')->get('build.dashboard')) { // DASHBOARDVIEW CFactory::_('Content')->set('DASHBOARDVIEW', CFactory::_('Config')->component_code_name); @@ -1360,7 +1361,7 @@ class Infusion extends Interpretation else { // DASHBOARDVIEW - CFactory::_('Content')->set('DASHBOARDVIEW', $this->dynamicDashboard); + CFactory::_('Content')->set('DASHBOARDVIEW', CFactory::_('Registry')->get('build.dashboard')); } // add import @@ -1368,7 +1369,7 @@ class Infusion extends Interpretation { // setup import files $target = array('admin' => 'import'); - $this->buildDynamique($target, 'import'); + CFactory::_('Utilities.Structure')->build($target, 'import'); // IMPORT_EXT_METHOD <<>> CFactory::_('Content')->set_('import', 'IMPORT_EXT_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( ComponentbuilderHelper::getDynamicScripts('ext') @@ -1388,7 +1389,7 @@ class Infusion extends Interpretation { // setup Ajax files $target = array('admin' => 'ajax'); - $this->buildDynamique($target, 'ajax'); + CFactory::_('Utilities.Structure')->build($target, 'ajax'); // set the controller CFactory::_('Content')->set_('ajax', 'REGISTER_AJAX_TASK', $this->setRegisterAjaxTask('admin')); CFactory::_('Content')->set_('ajax', 'AJAX_INPUT_RETURN', $this->setAjaxInputReturn('admin')); @@ -1403,7 +1404,7 @@ class Infusion extends Interpretation { // setup Ajax files $target = array('site' => 'ajax'); - $this->buildDynamique($target, 'ajax'); + CFactory::_('Utilities.Structure')->build($target, 'ajax'); // set the controller CFactory::_('Content')->set_('ajax', 'REGISTER_SITE_AJAX_TASK', $this->setRegisterAjaxTask('site')); CFactory::_('Content')->set_('ajax', 'AJAX_SITE_INPUT_RETURN', $this->setAjaxInputReturn('site')); @@ -1420,7 +1421,7 @@ class Infusion extends Interpretation { // setup rule file $target = array('admin' => 'a_rule_zi'); - $this->buildDynamique($target, 'rule', $rule); + CFactory::_('Utilities.Structure')->build($target, 'rule', $rule); // set the JFormRule Name CFactory::_('Content')->set_('a_rule_zi_' . $rule, 'Name', ucfirst((string) $rule)); // set the JFormRule PHP diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index df9820666..93e5d76a0 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -73,10 +73,10 @@ use Joomla\Utilities\ArrayHelper; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; +use VDM\Joomla\Utilities; use Joomla\Archive\Archive; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\Path; -use VDM\Joomla\Utilities; /** * Componentbuilder component helper. diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index d5a814154..e2ebf971a 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1284,12 +1284,14 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_YES="Yes" COM_COMPONENTBUILDER_ADMIN_VIEW_YOUTUBE="Youtube" COM_COMPONENTBUILDER_ADMIN_VIEW_ZOOM_IN="Zoom In" COM_COMPONENTBUILDER_ADMIN_VIEW_ZOOM_OUT="Zoom Out" +COM_COMPONENTBUILDER_ADVANCED_OPTIONS="Advanced Options" COM_COMPONENTBUILDER_AHEAD="Ahead" COM_COMPONENTBUILDER_AHEAD_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BNEWER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Ahead means your local snippet (with the same name, library and type) has a newer modified date then the community snippet (with the same name, library and type)." COM_COMPONENTBUILDER_AJAX="Ajax" COM_COMPONENTBUILDER_ALIAS="Alias" COM_COMPONENTBUILDER_ALIGNMENT="Alignment" COM_COMPONENTBUILDER_ALL="All" +COM_COMPONENTBUILDER_ALLOWS_YOU_TO_OVERRIDE_THE_BUILD_DATE_BY_SELECTING_A_DATE_MANUALLY_FROM_THE_CALENDER="Allows you to override the build date by selecting a date manually from the calender." COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED="All found instances in %s where replaced" COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter." COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME="All is good, there is no notice at this time." @@ -1332,10 +1334,12 @@ COM_COMPONENTBUILDER_BASIC_TUTORIAL_ON_GIT_BSB="Basic Tutorial on git: %s COM_COMPONENTBUILDER_BBEST_TO_NOT_CONTINUEBBR_WE_COULD_NOT_LOAD_THE_CHECKSUM_FOR_THIS_PACKAGE_AND_SO_NO_VALIDATION_WAS_POSSIBLE_THIS_MAY_BE_DUE_TO_YOUR_NETWORK_OR_A_CHANGE_TO_THAT_PACKAGE_NAME="Best to not continue!
We could not load the checksum for this package, and so no validation was possible. This may be due to your network, or a change to that package name." COM_COMPONENTBUILDER_BBEST_TO_NOT_CONTINUEBBR_YOU_CAN_REFRESH_AND_TRY_AGAINBR_BUT_NOTE_THAT_THIS_PACKAGE_BFAILEDB_CHECKSUM_VALIDATION_THIS_COULD_BE_A_SERIOUS_SECURITY_BREACH_DO_NOT_CONTINUE="Best to not continue!
You can Refresh and try again.
But note that this package FAILED checksum validation, this could be a serious security breach! DO NOT CONTINUE!!!" COM_COMPONENTBUILDER_BCUSTOM_FILESB_NOT_MOVED_TO_CORRECT_LOCATION="Custom files not moved to correct location!" +COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR="Become a Contributor" COM_COMPONENTBUILDER_BEHAVIOUR="Behaviour" COM_COMPONENTBUILDER_BEHIND="Behind" COM_COMPONENTBUILDER_BEHIND_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BOLDER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Behind means your local snippet (with the same name, library and type) has a older modified date then the community snippet (with the same name, library and type)." COM_COMPONENTBUILDER_BETA_RELEASE="Beta Release" +COM_COMPONENTBUILDER_BE_A_PART_OF_JCB="Be a Part of JCB" COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE="Be cautious! Do not continue unless you trust the origin of this package!" COM_COMPONENTBUILDER_BFIELD_TYPEB_IDS_MISMATCH_IN_BSB="Field type id:%s mismatch in %s." COM_COMPONENTBUILDER_BFIELD_TYPEB_NOT_SET_FOR_BSB="Field type not set for %s." @@ -1353,6 +1357,7 @@ COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CH COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB="The tmp folder has been clear successfully!" COM_COMPONENTBUILDER_BUILD="Build" COM_COMPONENTBUILDER_BUILDIN="Build-in" +COM_COMPONENTBUILDER_BUILD_DATE="Build Date" COM_COMPONENTBUILDER_BULK="Bulk" COM_COMPONENTBUILDER_BULK_GET_ALL_NEW_SNIPPETS="Bulk Get All New Snippets" COM_COMPONENTBUILDER_BULK_TOOLS="Bulk Tools" @@ -3667,6 +3672,7 @@ COM_COMPONENTBUILDER_CONFIG_VIEW_FIELD_LABEL="View & Field" COM_COMPONENTBUILDER_CONFIG_YES="Yes" COM_COMPONENTBUILDER_CONFIRMATION_STEP_BEFORE_IMPORTING="Confirmation Step Before Importing!" COM_COMPONENTBUILDER_CONTEXT="Context" +COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB="Contribute to JCB" COM_COMPONENTBUILDER_CONTRIBUTOR="Contributor" COM_COMPONENTBUILDER_CONTRIBUTORS="Contributors" COM_COMPONENTBUILDER_COPYRIGHT="Copyright" @@ -4394,6 +4400,8 @@ COM_COMPONENTBUILDER_DISPLAY_SWITCH_FOR_DYNAMIC_PLACEMENT_IN_RELATION_TO_THE_USE COM_COMPONENTBUILDER_DIVERGED="Diverged" COM_COMPONENTBUILDER_DIVERGED_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BDIVERGEDB_FROM_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_IN_THAT_IT_DOES_NOT_HAVE_THE_SAME_BCREATIONB_OR_BMODIFIED_DATEB="Diverged means your local snippet (with the same name, library and type) has a diverged from the community snippet (with the same name, library and type) in that it does not have the same creation or modified date." COM_COMPONENTBUILDER_DOES_THIS_PACKAGE_REQUIRE_A_KEY_TO_INSTALL="Does this package require a key to install." +COM_COMPONENTBUILDER_DONATE_TO_JCB="Donate to JCB" +COM_COMPONENTBUILDER_DONATIONS="Donations!" COM_COMPONENTBUILDER_DOWNLOAD_UPDATE="Download Update" COM_COMPONENTBUILDER_DO_NOT_ADD="Do not add" COM_COMPONENTBUILDER_DTCOMPANYDTDDSDD="
Company
%s
" @@ -4708,6 +4716,7 @@ COM_COMPONENTBUILDER_EDIT_S_S_DIRECTLY="Edit %s (%s) directly" COM_COMPONENTBUILDER_EDIT_VERSIONS="Edit Version" COM_COMPONENTBUILDER_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." COM_COMPONENTBUILDER_EDIT_VIEW="Edit View" +COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY="Elevate JCB Today" COM_COMPONENTBUILDER_EMAIL="Email" COM_COMPONENTBUILDER_EMAIL_S="Email %s" COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT="Email with the new key was sent" @@ -4716,6 +4725,8 @@ COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB="Copyright: %s" COM_COMPONENTBUILDER_EMEMAILEM_BSB="Email: %s" COM_COMPONENTBUILDER_EMLICENSEEM_BSB="License: %s" COM_COMPONENTBUILDER_EMOWNEREM_BSB="Owner: %s" +COM_COMPONENTBUILDER_EMPOWER_JCB="Empower JCB" +COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB="Empower the Future with JCB" COM_COMPONENTBUILDER_EMPTY_TRASH="Empty trash" COM_COMPONENTBUILDER_EMWEBSITEEM_BSB="Website: %s" COM_COMPONENTBUILDER_ENTER_YOUR_REPLACE_TEXT="Enter your replace text" @@ -5451,6 +5462,7 @@ COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE="Force Local Update" COM_COMPONENTBUILDER_FORCE_THAT_THIS_JCB_PACKAGE_IMPORT_SEARCH_FOR_LOCAL_ITEMS_TO_BE_DONE_WITH_GUID_VALUE_ONLY_IF_BMERGEB_IS_SET_TO_YES_ABOVE="Force that this JCB package import (search for local items) to be done with GUID value only, if Merge is set to yes above." COM_COMPONENTBUILDER_FOUND="Found" COM_COMPONENTBUILDER_FOUND_TEXT="Found Text" +COM_COMPONENTBUILDER_FOUR_SPACES="4 Spaces" COM_COMPONENTBUILDER_FREEOPEN="Free/Open" COM_COMPONENTBUILDER_FULL_WIDTH_IN_TAB="Full Width in Tab" COM_COMPONENTBUILDER_FUNCTION_NAME_ALREADY_TAKEN_PLEASE_TRY_AGAIN="Function name already taken, please try again." @@ -5487,6 +5499,7 @@ COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY="Get the COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION="Get the snippet from gitHub and update the local version" COM_COMPONENTBUILDER_GET_TOKEN="Get Token" COM_COMPONENTBUILDER_GET_TOKEN_FROM_VDM_TO_GET_UPDATE_NOTICE_AND_ADD_IT_TO_YOUR_GLOBAL_OPTIONS="Get token from VDM to get update notice, and add it to your global options." +COM_COMPONENTBUILDER_GIVE_TO_JCB="Give to JCB" COM_COMPONENTBUILDER_GLOBAL="Global" COM_COMPONENTBUILDER_GLUECODE="Glue/Code" COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK="Great, this function name will work!" @@ -5594,6 +5607,7 @@ COM_COMPONENTBUILDER_HELP_DOCUMENT_URL_LABEL="URL" COM_COMPONENTBUILDER_HELP_DOCUMENT_URL_MESSAGE="Error! Please add url here." COM_COMPONENTBUILDER_HELP_DOCUMENT_VERSION_DESC="A count of the number of times this Help Document has been revised." COM_COMPONENTBUILDER_HELP_DOCUMENT_VERSION_LABEL="Version" +COM_COMPONENTBUILDER_HELP_JCB_GROW="Help JCB Grow" COM_COMPONENTBUILDER_HELP_MANAGER="Help" COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_THE_REPLACE_TEXT_THAT_YOU_WOULD_LIKE_TO_USE_AS_REPLACEMENT_FOR_THE_SEARCH_TEXT_FOUND="Here you can enter the replace text that you would like to use as replacement for the search text found." COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_YOUR_SEARCH_TEXT="Here you can enter your search text." @@ -5604,11 +5618,15 @@ COM_COMPONENTBUILDER_HIDE_ONLY="Hide Only" COM_COMPONENTBUILDER_HIDE_TOGGLE="Hide Toggle" COM_COMPONENTBUILDER_HOW_TO_GET_A_S_FREE_KEYSA_FROM_VDM="How to get free keys from VDM." COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE="

Custom Codes Warning

" +COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP="

c0mp0n3nt issue found

The path (%s) could not be used.

" +COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE="

Dashboard Error

" COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE="

Dynamic folder(s) were detected.

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="

External Code Error

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="

External Code Notice

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE="

External Code Warning

" COM_COMPONENTBUILDER_HR_HTHREEFIELD_NOTICEHTHREE="

Field Notice

" +COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE="

File Path Error

" +COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE="

Folder Path Error

" COM_COMPONENTBUILDER_HTHREEPLACEHOLDER_REMOVEDHTHREEPBTHISB_CUSTOM_CODE_CAN_ONLY_BE_USED_IN_BOTHERB_CUSTOM_CODE_NOT_IN_IT_SELF_SINCE_THAT_WILL_CAUSE_A_INFINITE_LOOP_IN_THE_COMPILERP="

Placeholder Removed!

This custom code can only be used in other custom code, not in it self! Since that will cause a infinite loop in the compiler.

" COM_COMPONENTBUILDER_HTHREESHTHREEPCUSTOM_CODE_CAN_ONLY_BE_USED_IN_OTHER_CUSTOM_CODE_IF_SET_AS_BJCB_MANUALB_YOU_CAN_NOT_ADD_THEM_TO_EMHASH_AUTOMATIONEM_CODE_AT_THIS_POINTP="

%s

Custom code can only be used in other custom code if set as JCB (manual), you can not add them to Hash (Automation) code at this point.

" COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

%s namespace error (%s)

You must at-least have two sections in your namespace, you just have one (%s). This is an unacceptable action, please see psr-4 for more info.

This %s was therefore removed, click here to fix this issue.

" @@ -5683,6 +5701,10 @@ COM_COMPONENTBUILDER_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE="Package to import not COM_COMPONENTBUILDER_IMPORT_UPDATE_DATA="Import Data" COM_COMPONENTBUILDER_IMPORT_UPLOAD_BOTTON="Upload File" COM_COMPONENTBUILDER_INACTIVE="Inactive" +COM_COMPONENTBUILDER_INDENTATION_OPTIONS="Indentation Options" +COM_COMPONENTBUILDER_INVEST_IN_JCB="Invest in JCB" +COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS="Invest in the future of Joomla Component Builder (JCB) by making a financial contribution, no matter how small. The continual support of all those using the tool will be more than enough to ensure its continued growth and relevance. By investing in this open-source project, you are securing its future as a vital tool for PHP programmers." +COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS="Invest in the future of Joomla Component Builder (JCB) by making a financial donation. Support the necessary development and maintenance of this open-source project, ensuring its continued growth and relevance for the community. Your contribution will help secure the future of this vital tool for PHP programmers." COM_COMPONENTBUILDER_IN_SYNC="In Sync" COM_COMPONENTBUILDER_ISOLATE="Isolate" COM_COMPONENTBUILDER_IS_BEING_COMPILED="is being compiled" @@ -5690,14 +5712,66 @@ COM_COMPONENTBUILDER_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES="Is Not (only 4 list/r COM_COMPONENTBUILDER_IS_ONLY_FOUR_LISTRADIOCHECKBOXES="Is (only 4 list/radio/checkboxes)" COM_COMPONENTBUILDER_ITEM_CODE="Item Code" COM_COMPONENTBUILDER_IWEBSITEI_BSB="Website: %s" +COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE="JCB: Be the Change" +COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE="JCB Builds a Better Future" COM_COMPONENTBUILDER_JCB_COMMUNITY="JCB Community" COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages" COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS="JCB Community Snippets" +COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE="JCB Contributes to Open-Source" +COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS="JCB Empowers PHP Developers" +COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT="JCB Enables PHP Development" +COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY="JCB Enhances Productivity" +COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY="JCB Fosters a Strong Community" +COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES="JCB Helps Grow Businesses" +COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE="JCB Helps PHP Thrive" +COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION="JCB Improves PHP's Reputation" +COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT="JCB Improves PHP Development" +COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE="JCB Improves User Experience" +COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW="JCB Improves Workflow" +COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED="JCB Increases Development Speed" +COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE="JCB Increases Revenue" +COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION="JCB Increases User Satisfaction" +COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS="JCB Invests in PHP's Success" +COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE="JCB: Invest in Change" +COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT="JCB: Invest in Impact" +COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS="JCB: Invest in Progress" +COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY="JCB: Invest in Progress Today" +COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS="JCB: Invest in Success" +COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY="JCB: Invest in the Community" +COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE="JCB: Invest in the Future" +COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE="JCB: Invest in Your Future" +COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB="JCB is not yet fully ready for Joomla 4, but with your help, we can make the transition faster. Show your support by making a donation today and help us bring JCB to the next level.

Your component will still only be compiled for Joomla 3" +COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS="JCB Lowers Development Stress" +COM_COMPONENTBUILDER_JCB_NEEDS_YOU="JCB Needs You" +COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION="JCB Offers a Stronger Solution" +COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES="JCB Offers More Features" COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT="JCB Package Import" COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE="JCB Package info path does not work, we advice you not to continue with the import of the selected package!" +COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY="JCB Promotes Efficiency" +COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL="JCB Promotes Goodwill" +COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE="JCB Provides a Better Experience" COM_COMPONENTBUILDER_JCB_PRO_BOARD="JCB Pro board" COM_COMPONENTBUILDER_JCB_PRO_NOTICE_BOARD="JCB Pro Notice Board" +COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS="JCB Reduces Development Costs" +COM_COMPONENTBUILDER_JCB_SAVES_TIME="JCB Saves Time" +COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT="JCB Streamlines Development" +COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM="JCB Supports a Thriving Ecosystem" +COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE="JCB Supports a Worthy Cause" +COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE="JCB Supports Open-Source" +COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION="JCB Supports PHP Innovation" +COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY="JCB Supports the PHP Community" +COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS="JCB: Your Contribution Matters" +COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS="JCB: Your Donation Matters" +COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS="JCB: Your Support Counts" +COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY="JCB: Your Support is Key" +COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS="JCB: Your Support Matters" +COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST="JCB: Your Support Matters Most" COM_COMPONENTBUILDER_JOIN_FIELDS="Join Fields" +COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY="Join JCB's Community" +COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY="Join JCB's Journey" +COM_COMPONENTBUILDER_JOIN_JCBS_MISSION="Join JCB's Mission" +COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS="Join JCB's Success" +COM_COMPONENTBUILDER_JOIN_JCBS_VISION="Join JCB's Vision" COM_COMPONENTBUILDER_JOIN_TYPE="Join Type" COM_COMPONENTBUILDER_JOOMLA_COMPONENT="Joomla Component" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS="Joomla Components" @@ -5808,6 +5882,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL="MySQL" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMP_DESCRIPTION="To build the component fields and back-end views dynamically using a mySQL table file." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMP_LABEL="Build Backend-views Dynamically" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY="Joomla Component Builder - Backup Key" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY="Joomla Component Builder (JCB) is a crucial tool for PHP programmers who use Joomla to earn a living. By making a financial donation, you can support the growth and continuity of this vital resource and ensure its relevance for years to come. Your contribution, no matter how big or small, will be deeply appreciated by the project's team and the wider community." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CLEAR_TMP_BUTTON_ACCESS="Joomla Component Clear tmp Button Access" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CLEAR_TMP_BUTTON_ACCESS_DESC="Allows the users in this group to access the clear tmp button." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CLONE_BUTTON_ACCESS="Joomla Component Clone Button Access" @@ -6153,6 +6228,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE="Error! Please add websi COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP" COM_COMPONENTBUILDER_JOOMLA_FIELDS="Joomla fields" +COM_COMPONENTBUILDER_JOOMLA_FOUR="Joomla 4" COM_COMPONENTBUILDER_JOOMLA_MODULE="Joomla Module" COM_COMPONENTBUILDER_JOOMLA_MODULES="Joomla Modules" COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS="Joomla Modules Access" @@ -7094,6 +7170,8 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_DESC="A count of the number of times COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_LABEL="Version" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_YES="Yes" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ZIP="ZIP" +COM_COMPONENTBUILDER_JOOMLA_THREE="Joomla 3" +COM_COMPONENTBUILDER_JOOMLA_VERSION="Joomla Version" COM_COMPONENTBUILDER_JUST_GET_ALL_SNIPPETS="Just Get All Snippets" COM_COMPONENTBUILDER_KEEP_HISTORY="Keep History" COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS="- Keep Original Access -" @@ -7764,6 +7842,8 @@ COM_COMPONENTBUILDER_LOCAL="Local" COM_COMPONENTBUILDER_LOCAL_GET="Local (get)" COM_COMPONENTBUILDER_LOCAL_SNIPPET="Local snippet" COM_COMPONENTBUILDER_MAIN_MENU="Main Menu" +COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB="Make a Difference with JCB" +COM_COMPONENTBUILDER_MANUAL="Manual" COM_COMPONENTBUILDER_MATCH_BEHAVIOUR="Match Behaviour" COM_COMPONENTBUILDER_MATCH_CASE="Match Case" COM_COMPONENTBUILDER_MATCH_FIELD="Match Field" @@ -8069,7 +8149,7 @@ COM_COMPONENTBUILDER_POWER_LICENSING="Licensing" COM_COMPONENTBUILDER_POWER_LICENSING_TEMPLATE_HINT="/** * @package Joomla.Component.Builder * - * @created 3rd September, 2015 + * @created 4th September, 2015 * @author Llewellyn van der Merwe * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. @@ -8221,6 +8301,7 @@ COM_COMPONENTBUILDER_SELECT_AN_OPTION="Select an option" COM_COMPONENTBUILDER_SELECT_A_PROPERTY="Select a property" COM_COMPONENTBUILDER_SELECT_A_SITE_VIEW="Select a site view" COM_COMPONENTBUILDER_SELECT_A_SNIPPET="select a snippet" +COM_COMPONENTBUILDER_SELECT_BUILD_DATE="Select Build Date" COM_COMPONENTBUILDER_SELECT_COMPONENT="Select Component" COM_COMPONENTBUILDER_SELECT_EXTENSION="Select Extension" COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE="Select the component to compile" @@ -8379,6 +8460,7 @@ COM_COMPONENTBUILDER_SHOULD_THIS_FIELD_BE_ESCAPED_IN_THE_LIST_VIEW="Should this COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT="Should we be showing more elaborate information during import." COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED="Should we force the update of all local data, even if it is newer then the data being imported." COM_COMPONENTBUILDER_SHOULD_WE_MERGE_THE_COMPONENTS_WITH_SIMILAR_LOCAL_COMPONENTS_MERGING_THE_COMPONENTS_USE_TO_BE_THE_DEFAULT_BEHAVIOUR_BUT_NOW_YOU_CAN_IMPORT_THE_COMPONENTS_AND_FORCE_IT_NOT_TO_MERGE_THE_FOLLOWING_AREAS_VALIDATION_RULE_FIELDTYPE_SNIPPET_LANGUAGE_LANGUAGE_TRANSLATION_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_CLASS_PROPERTY_CLASS_METHOD_BMUST_AND_WILL_STILLB_MERGE_EVEN_OF_YOUR_SELECTION_IS_BNOB_BECAUSE_OF_THE_SINGULAR_NATURE_OF_THOSE_AREAS="Should we merge the component/s with similar local component/s. Merging the component/s use to be the default behaviour, but now you can import the component/s and force it not to merge. The following areas (validation_rule, fieldtype, snippet, language, language_translation, joomla_plugin_group, class_extends, class_property, class_method) must and will still merge even of your selection is No, because of the singular nature of those areas." +COM_COMPONENTBUILDER_SHOW_ADVANCED_OPTIONS="Show Advanced Options" COM_COMPONENTBUILDER_SHOW_IN_ALL_LIST_VIEWS="Show in All List Views" COM_COMPONENTBUILDER_SHOW_ONLY="Show Only" COM_COMPONENTBUILDER_SHOW_TOGGLE="Show Toggle" @@ -9042,6 +9124,8 @@ COM_COMPONENTBUILDER_SUBMENU_TEMPLATES="Templates" COM_COMPONENTBUILDER_SUBMENU_VALIDATION_RULES="Validation Rules" COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED="Success! The snippet was saved." COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED_BUT_THE_MODIFIED_DATE_COULD_NOT_BE_ADJUSTED_BR_BR_BTHIS_MEANS_THE_SNIPPETS_WILL_CONTINUE_TO_APPEAR_OUT_OF_DATEB="Success! The snippet was saved. But the modified date could not be adjusted.

This means the snippets will continue to appear out of date." +COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY="Support JCB Today" +COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL="Support Joomla Component Builder (JCB) with a financial donation to show gratitude for the time and effort saved in your development process. Your contribution, no matter the size, will be appreciated by the project's team and the wider community. Help ensure the growth and relevance of this essential tool." COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM="%szdEQzdmVsMHBtRW50T%sQFlvVXJTM3J2IXM=" COM_COMPONENTBUILDER_SZIP_COULD_NOT_BE_INSTALLED="%s.zip could not be installed!" COM_COMPONENTBUILDER_SZIP_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION="%s.zip was removed the from tmp folder during installation!" @@ -9198,6 +9282,7 @@ COM_COMPONENTBUILDER_THE_BNONE_DBB_OPTION_WILL_REMOVE_THIS_FIELD_FROM_BEING_SAVE COM_COMPONENTBUILDER_THE_BONLY_IN_ADMIN_LIST_VIEWB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_ADMIN_LIST_VIEW_NOT_TO_ANY_LINKED_VIEWS="The Only in Admin List View option will only Add this field to the admin list view, not to any linked views." COM_COMPONENTBUILDER_THE_BONLY_IN_LINKED_LIST_VIEWSB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_LINKED_LIST_VIEW_IF_THIS_VIEW_GETS_LINKED_TO_OTHER_VIEW_NOT_TO_THIS_ADMIN_LIST_VIEW="The Only in Linked List Views option will only Add this field to the linked list view, if this view gets linked to other view, not to this admin list view." COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The phpseclib\NET\SFTP library\class is not available! This library\class should have been added to your libraries/vdm_io/vendor folder. Please contact your system administrator for more info" +COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT="The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component." COM_COMPONENTBUILDER_THE_BSB_CUT_SEQUENCE_FAILED_ON_THE_RETURNED_EXTERNAL_CODESTRING_AS_MORE_LINES_HAS_TO_BE_CUT_THEN_WAS_FOUND_IN_THE_CODESTRING_WE_HAVE_COMPLETELY_REMOVED_THE_CODE_PLEASE_CHECK_THIS_CODESTRING="The %s cut sequence failed on the returned external code/string as more lines has to be cut then was found in the code/string. We have completely removed the code. Please check this code/string!" COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The %s file could not be moved to %s path on %s server." COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The %s file could not be moved to %s server." @@ -9205,11 +9290,13 @@ COM_COMPONENTBUILDER_THE_BSB_IS_NOT_A_VALID_URLPATH="The %s is not a vali COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The %s library\class is not available! This library\class should have been added to your libraries/phpseclib/vendor folder. Please contact your system administrator for more info!" COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="The %s library can not be deleted, or things will break." COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING="The %s returned an invalid string!" +COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID="The %s value for the dynamic dashboard is invalid." COM_COMPONENTBUILDER_THE_BSHOW_IN_ALL_LIST_VIEWSB_OPTION_WILL_ADD_THIS_FIELD_TO_ALL_LIST_VIEWS_ADMIN_AMP_LINKED="The Show in All List Views option will Add this field to all list views, admin & linked." COM_COMPONENTBUILDER_THE_BSINGLE_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_JUST_ONE_VALUE_IN_THIS_FILTERFIELD="The single filter selection option allows the user to select just one value in this filter/field." COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been added for the first time. Please investigate to ensure the correct code/string was used! Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention! Do not ignore this warning as it will only show once." COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been changed since the last compilation. Please investigate to ensure the changes are safe! Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention! Do not ignore this warning as it will only show once." COM_COMPONENTBUILDER_THE_COMPONENT="The Component" +COM_COMPONENTBUILDER_THE_COMPONENTS_LAST_MODIFIED_DATE_WILL_BE_USED="The component's last modified date will be used." COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views" COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config" COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS="The component custom admin menus" @@ -9223,6 +9310,9 @@ COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS="The component plugins" COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS="The component site views" COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates" COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL="The Component with all linked admin views, fields linked to admin views, custom admin views, site views, templates and layouts were cloned successful!" +COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY="The continued support of individuals like you has allowed Joomla Component Builder (JCB) to thrive for seven years since going public. Your contributions have been crucial in ensuring the growth and relevance of this vital tool for PHP programmers. Thank you for your support and for being a part of JCB's journey." +COM_COMPONENTBUILDER_THE_FILE_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The file path: %s does not exist, and was not added!" +COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The folder path: %s does not exist, and was not added!" COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for %s could not be made. Please check your signature details!" COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for %s was not well formed, please check your signature details!" COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE="The key of this package." @@ -9274,6 +9364,7 @@ COM_COMPONENTBUILDER_TRASHED_ITEMS="Trashed items" COM_COMPONENTBUILDER_TRASH_AREA="Trash Area" COM_COMPONENTBUILDER_TUTORIAL_ON_FORKING_JCB_SNIPPETS_BSB="Tutorial on forking JCB snippets: %s" COM_COMPONENTBUILDER_TUTORIAL_ON_MAKING_A_PULL_REQUEST_BSB="Tutorial on making a pull request: %s" +COM_COMPONENTBUILDER_TWO_SPACES="2 Spaces" COM_COMPONENTBUILDER_TYPE="Type" COM_COMPONENTBUILDER_TYPE_ADMIN_CUSTOM_TABS="Admin Custom Tabs" COM_COMPONENTBUILDER_TYPE_ADMIN_FIELDS="Admin Fields" @@ -9444,20 +9535,29 @@ COM_COMPONENTBUILDER_WEBSITE="Website" COM_COMPONENTBUILDER_WEBSITE_OF_S="Website of %s" COM_COMPONENTBUILDER_WEBSITE_S="Website: %s" COM_COMPONENTBUILDER_WE_DID_NOT_CHECK_THE_SNIPPET_IT_SELF_TO_SEE_IF_IT_CHANGED_WE_ONLY_WORK_ON_DATES="We did not check the snippet it self, to see if it changed. We only work on dates." +COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY="We extend our gratitude to all those who support Joomla Component Builder (JCB), whether as a hobby or as a part of their business. Your contributions, whether financial or in the form of active involvement, have had a significant impact on ensuring the growth and relevance of this vital tool for PHP programmers. We highly value the dedication of hobbyists and the commitment of companies who support JCB, as they have allowed the project to continue its development and maintenance, providing valuable resources for the community. We are grateful for your contributions, no matter how small, and thank you for being a part of the positive impact that JCB has on the PHP programming community." +COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY="We extend our heartfelt appreciation to those who have supported the Joomla Component Builder (JCB) project over the years. Your contributions, no matter how big or small, have been instrumental in ensuring its growth and relevance as a vital tool for PHP programmers. Seven years after going public, JCB is still here today because of the support of individuals like you who believe in the importance of this open-source project. Your generosity has allowed the project to continue its development and maintenance, providing valuable resources for the community. Thank you for your unwavering support and for being a part of JCB's journey." +COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY="We extend our sincere appreciation to the companies who use Joomla Component Builder (JCB) and support the project. Your contributions, whether financial or in the form of active involvement, have been instrumental in ensuring the growth and relevance of this vital tool for PHP programmers. Your support has allowed JCB to continue its development and maintenance, providing valuable resources for the community. Thank you for your unwavering commitment to the project and for being a part of JCB's journey." COM_COMPONENTBUILDER_WE_FAILED_TO_MOVE_BSB="We failed to move %s!" COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS="We found dynamic code all in one line, and ignored it! Please review (%s) for more details!" COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S="We found some instances in %s" COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved %s!" +COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET="What version of Joomla would you like to target." +COM_COMPONENTBUILDER_WHICH_TYPE_OF_INDENTATION_WOULD_YOU_LIKE_TO_USE_PLEASE_NOTE_THAT_THIS_DOES_NOT_YET_IMPACT_THE_STATIC_TEMPLATES="Which type of indentation would you like to use? Please note that this does not yet impact the static templates." COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION="While we download all 26 compiler GIF animations randomly used in the compiler GUI during compilation" COM_COMPONENTBUILDER_WHOLE_WORD="Whole Word" COM_COMPONENTBUILDER_WIKI="Wiki" COM_COMPONENTBUILDER_WITH="with" +COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY="Without sufficient support, the future of Joomla Component Builder (JCB) is in jeopardy. As a vital tool for PHP programmers, it is crucial to ensure its continued development and maintenance. By making a financial contribution, no matter how small, you are helping to safeguard the future of this open-source project. Neglecting to support JCB could result in its decline and loss as a resource for the community." COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH="Would you like to do a reverse search?" +COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_OVERRIDE_THE_BUILD_DATE="Would you like to override the build date." COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH="Would you like to repeat the same search?" +COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_SEE_THE_ADVANCED_COMPILER_OPTIONS="Would you like to see the advanced compiler options?" COM_COMPONENTBUILDER_YES="Yes" COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL" COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE="Your are about to update ALL values that can be found in the database." COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row" +COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE="Your component will be compiled to work in Joomla 3" COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 128 bit encryption using the above 32 character key." COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then 700 000 000 000 000 000 000 000 000 000 000 years to crack theoretically. Unless they have this key above, so do keep it safe." COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items." diff --git a/admin/layouts/jcbsupportmessage.php b/admin/layouts/jcbsupportmessage.php new file mode 100644 index 000000000..4b78bce9e --- /dev/null +++ b/admin/layouts/jcbsupportmessage.php @@ -0,0 +1,116 @@ + + * @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('JPATH_BASE') or die('Restricted access'); + +// Different support requests/appreciation +$support = [ + JText::_("COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY"), + JText::_("COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), + JText::_("COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL"), + JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), + JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), + JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY"), + JText::_("COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY"), + JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), + JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY") +]; + +// build the support message +$support_message = $support[random_int(0, 8)]; + +// the button titles +$titles = [ + JText::_("COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT"), + JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE"), + JText::_("COM_COMPONENTBUILDER_JCB_SAVES_TIME"), + JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW"), + JText::_("COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS"), + JText::_("COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT"), + JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY"), + JText::_("COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY"), + JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE"), + JText::_("COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS"), + JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY"), + JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT"), + JText::_("COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES"), + JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION"), + JText::_("COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE"), + JText::_("COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE"), + JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES"), + JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED"), + JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE"), + JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION"), + JText::_("COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS"), + JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL"), + JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION"), + JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE"), + JText::_("COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE"), + JText::_("COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY"), + JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION"), + JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM"), + JText::_("COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE"), + JText::_("COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS") +]; + +// build the support button +$support_titles = $titles[random_int(0, 29)]; + +// the button names +$button_names = [ + JText::_("COM_COMPONENTBUILDER_DONATE_TO_JCB"), + JText::_("COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY"), + JText::_("COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB"), + JText::_("COM_COMPONENTBUILDER_INVEST_IN_JCB"), + JText::_("COM_COMPONENTBUILDER_GIVE_TO_JCB"), + JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_MISSION"), + JText::_("COM_COMPONENTBUILDER_HELP_JCB_GROW"), + JText::_("COM_COMPONENTBUILDER_BE_A_PART_OF_JCB"), + JText::_("COM_COMPONENTBUILDER_JCB_NEEDS_YOU"), + JText::_("COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR"), + JText::_("COM_COMPONENTBUILDER_EMPOWER_JCB"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT"), + JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY"), + JText::_("COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB"), + JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE"), + JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY"), + JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS"), + JText::_("COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB"), + JText::_("COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS"), + JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_VISION"), + JText::_("COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE"), + JText::_("COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS"), + JText::_("COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE"), + JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS"), + JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY"), + JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE"), + JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY") +]; + +// build the support button +$support_button = $button_names[random_int(0, 32)]; + +?> + +

+ +

+ + + +
diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 131fea076..fba286871 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Model\ListModel; use Joomla\Utilities\ArrayHelper; -use Joomla\Registry\Registry; use VDM\Gitea\Gitea; +use Joomla\Registry\Registry; use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; /** diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index 028fd5482..ff134f1e4 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Model\ListModel; use Joomla\Utilities\ArrayHelper; -use Joomla\Registry\Registry; use VDM\Gitea\Gitea; +use Joomla\Registry\Registry; /** * Componentbuilder List Model diff --git a/admin/views/compiler/tmpl/default.php b/admin/views/compiler/tmpl/default.php index 87af7e0c7..2f7e8f188 100644 --- a/admin/views/compiler/tmpl/default.php +++ b/admin/views/compiler/tmpl/default.php @@ -139,13 +139,8 @@ jQuery('
')

- Form): ?> - Form as $field): ?> -
-
label; ?>
-
input; ?>
-
- + form): ?> + form->renderFieldset('builder'); ?>

@@ -158,6 +153,7 @@ jQuery('
')
+
form->renderFieldset('advanced'); ?>
'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 1a6cc9be3..5c27af451 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\View\HtmlView; use Joomla\CMS\Filesystem\File; +use Joomla\CMS\Form\Form; /** * Componentbuilder Html View class for the Compiler @@ -47,7 +48,7 @@ class ComponentbuilderViewCompiler extends HtmlView $this->Components = $this->get('Components'); // get the needed form fields - $this->Form = $this->getDynamicForm(); + $this->form = $this->getDynamicForm(); // set the compiler artwork from global settings $this->builder_gif_size = $this->params->get('builder_gif_size', '480-272'); @@ -106,119 +107,378 @@ class ComponentbuilderViewCompiler extends HtmlView /** * Get the dynamic build form fields needed on the page * - * @return array|null The array of form fields + * @return Form|null The form fields * * @since 3.2.0 */ - public function getDynamicForm(): ?array + public function getDynamicForm(): ?Form { if(ComponentbuilderHelper::checkArray($this->Components)) { // start the form - $form = array(); + $form = new Form('Builder'); + + $form->load('
+
+
+
'); + // sales attributes - $attributes = array( + $attributes = [ 'type' => 'radio', 'name' => 'backup', 'label' => 'COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET', - 'default' => '0'); + 'default' => '0']; // set the sales options - $options = array( + $options = [ '1' => 'COM_COMPONENTBUILDER_YES', - '0' => 'COM_COMPONENTBUILDER_NO'); + '0' => 'COM_COMPONENTBUILDER_NO']; + // add to form - $form[] = ComponentbuilderHelper::getFieldObject($attributes, 0, $options); + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + // repository attributes - $attributes = array( + $attributes = [ 'type' => 'radio', 'name' => 'repository', 'label' => 'COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER', - 'default' => '1'); + 'default' => '1']; // start the repository options - $options = array( + $options = [ '1' => 'COM_COMPONENTBUILDER_YES', - '0' => 'COM_COMPONENTBUILDER_NO'); + '0' => 'COM_COMPONENTBUILDER_NO']; + // add to form - $form[] = ComponentbuilderHelper::getFieldObject($attributes, 1, $options); + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + // placeholders attributes - $attributes = array( + $attributes = [ 'type' => 'radio', 'name' => 'add_placeholders', 'label' => 'COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE', - 'default' => '2'); + 'default' => '2']; // start the placeholders options - $options = array( + $options = [ '2' => 'COM_COMPONENTBUILDER_GLOBAL', '1' => 'COM_COMPONENTBUILDER_YES', - '0' => 'COM_COMPONENTBUILDER_NO'); + '0' => 'COM_COMPONENTBUILDER_NO']; + // add to form - $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + // debuglinenr attributes - $attributes = array( + $attributes = [ 'type' => 'radio', 'name' => 'debug_line_nr', 'label' => 'COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING', - 'default' => '2'); - $options = array( + 'default' => '2']; + $options = [ '2' => 'COM_COMPONENTBUILDER_GLOBAL', '1' => 'COM_COMPONENTBUILDER_YES', - '0' => 'COM_COMPONENTBUILDER_NO'); + '0' => 'COM_COMPONENTBUILDER_NO']; + // add to form - $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + // minify attributes - $attributes = array( + $attributes = [ 'type' => 'radio', 'name' => 'minify', 'label' => 'COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT', - 'default' => '2'); - $options = array( + 'default' => '2']; + $options = [ '2' => 'COM_COMPONENTBUILDER_GLOBAL', '1' => 'COM_COMPONENTBUILDER_YES', - '0' => 'COM_COMPONENTBUILDER_NO'); + '0' => 'COM_COMPONENTBUILDER_NO']; + // add to form - $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + // powers attributes - $attributes = array( + $attributes = [ 'type' => 'radio', 'name' => 'powers', 'label' => 'COM_COMPONENTBUILDER_ADD_POWERS', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_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', - 'default' => '2'); - $options = array( + 'default' => '2']; + $options = [ '2' => 'COM_COMPONENTBUILDER_GLOBAL', '1' => 'COM_COMPONENTBUILDER_YES', - '0' => 'COM_COMPONENTBUILDER_NO'); + '0' => 'COM_COMPONENTBUILDER_NO']; + // add to form - $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + // component attributes - $attributes = array( + $attributes = [ 'type' => 'list', 'name' => 'component_id', 'label' => 'COM_COMPONENTBUILDER_COMPONENTS', 'class' => 'list_class', 'description' => 'COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE', - 'required' => 'true'); + 'required' => 'true']; // start the component options - $options = array(); + $options = []; $options[''] = 'COM_COMPONENTBUILDER__SELECT_COMPONENT_'; // load component options from array foreach($this->Components as $component) { $options[(int) $component->id] = $this->escape($component->name); } + // add to form - $form[] = ComponentbuilderHelper::getFieldObject($attributes, '', $options); + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Advanced Options + $attributes = [ + 'type' => 'radio', + 'name' => 'show_advanced_options', + 'label' => 'COM_COMPONENTBUILDER_SHOW_ADVANCED_OPTIONS', + 'class' => 'btn-group btn-group-yesno', + 'description' => 'COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_SEE_THE_ADVANCED_COMPILER_OPTIONS', + 'default' => '0']; + // start the advanced options switch + $options = [ + '1' => 'COM_COMPONENTBUILDER_YES', + '0' => 'COM_COMPONENTBUILDER_NO']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Advanced Options note attributes + $attributes = [ + 'type' => 'note', + 'name' => 'show_advanced_options_note', + 'label' => "COM_COMPONENTBUILDER_ADVANCED_OPTIONS", + 'heading' => 'h3', + 'showon' => 'show_advanced_options:1']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Joomla Versions attributes + $attributes = [ + 'type' => 'radio', + 'name' => 'joomla_version_donations', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION', + 'class' => 'btn-group btn-group-yesno', + 'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET', + 'default' => '3', + 'showon' => 'show_advanced_options:1']; + // start the joomla versions options + $options = [ + '3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE', + '4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Joomla Version 3 attributes + $attributes = [ + 'type' => 'note', + 'name' => 'joomla_version_note_three', + 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE', + 'class' => 'alert alert-success', + 'showon' => 'show_advanced_options:1[AND]joomla_version_donations:3']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Joomla Version 4 attributes + $attributes = [ + 'type' => 'note', + 'name' => 'joomla_version_note_four', + 'description' => 'COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB', + 'class' => 'alert alert-info', + 'showon' => 'show_advanced_options:1[AND]joomla_version_donations:4']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Indentation attributes + $attributes = [ + 'type' => 'radio', + 'name' => 'indentation_value', + 'label' => 'COM_COMPONENTBUILDER_INDENTATION_OPTIONS', + 'class' => 'btn-group btn-group-yesno', + 'description' => 'COM_COMPONENTBUILDER_WHICH_TYPE_OF_INDENTATION_WOULD_YOU_LIKE_TO_USE_PLEASE_NOTE_THAT_THIS_DOES_NOT_YET_IMPACT_THE_STATIC_TEMPLATES', + 'default' => '1', + 'showon' => 'show_advanced_options:1']; + + // start the indentation options + $options = [ + '1' => 'COM_COMPONENTBUILDER_TAB', + '2' => 'COM_COMPONENTBUILDER_TWO_SPACES', + '4' => 'COM_COMPONENTBUILDER_FOUR_SPACES']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Build date attributes + $attributes = [ + 'type' => 'radio', + 'name' => 'add_build_date', + 'label' => 'COM_COMPONENTBUILDER_BUILD_DATE', + 'class' => 'btn-group btn-group-yesno', + 'description' => 'COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_OVERRIDE_THE_BUILD_DATE', + 'default' => '1', + 'showon' => 'show_advanced_options:1']; + // start the build date options + $options = [ + '1' => 'COM_COMPONENTBUILDER_DEFAULT', + '2' => 'COM_COMPONENTBUILDER_MANUAL', + '3' => 'COM_COMPONENTBUILDER_COMPONENT']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Build date note attributes + $attributes = [ + 'type' => 'note', + 'name' => 'add_build_date_note_two', + 'description' => 'COM_COMPONENTBUILDER_ALLOWS_YOU_TO_OVERRIDE_THE_BUILD_DATE_BY_SELECTING_A_DATE_MANUALLY_FROM_THE_CALENDER', + 'class' => 'alert alert-info', + 'showon' => 'show_advanced_options:1[AND]add_build_date:2']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Build date note attributes + $attributes = [ + 'type' => 'note', + 'name' => 'add_build_date_note_three', + 'description' => "COM_COMPONENTBUILDER_THE_COMPONENTS_LAST_MODIFIED_DATE_WILL_BE_USED", + 'class' => 'alert alert-info', + 'showon' => 'show_advanced_options:1[AND]add_build_date:3']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Build date calendar attributes + $attributes = [ + 'type' => 'calendar', + 'name' => 'build_date', + 'label' => 'COM_COMPONENTBUILDER_SELECT_BUILD_DATE', + 'format' => '%Y-%m-%d', + 'filter' => 'user_utc', + 'default' => 'now', + 'size' => '22', + 'showon' => 'show_advanced_options:1[AND]add_build_date:2']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Build date note attributes + $attributes = [ + 'type' => 'note', + 'name' => 'donations_note', + 'label' => "COM_COMPONENTBUILDER_DONATIONS", + 'description' => $this->getSupportMessage(), + 'class' => 'alert alert-success', + 'heading' => 'h1', + 'showon' => 'show_advanced_options:1']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } + + // Build date note line attributes + $attributes = [ + 'type' => 'note', + 'name' => 'donations_note_line', + 'description' => '
', + 'showon' => 'show_advanced_options:1']; + + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'advanced'); + } // return the form array return $form; @@ -226,6 +486,18 @@ class ComponentbuilderViewCompiler extends HtmlView return null; } + + /** + * Get the dynamic support request/gratitude message + * + * @return string The support message + * + * @since 3.2.0 + */ + protected function getSupportMessage(): string + { + return JLayoutHelper::render('jcbsupportmessage', []); + } /** diff --git a/admin/views/search/view.html.php b/admin/views/search/view.html.php index 0f787e3f3..54cebfbc1 100644 --- a/admin/views/search/view.html.php +++ b/admin/views/search/view.html.php @@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\View\HtmlView; use Joomla\CMS\Filesystem\File; -use Joomla\CMS\Form\Form; use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; +use Joomla\CMS\Form\Form; /** * Componentbuilder Html View class for the Search diff --git a/componentbuilder.xml b/componentbuilder.xml index 266a61992..799cdfa6b 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 6th February, 2023 + 12th February, 2023 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 3.1.13 + 3.1.17 Component Builder (v.3.1.13) +

Component Builder (v.3.1.17)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index a2c6c5520..0e22c1a2a 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -1112,12 +1112,13 @@ Component Builder Builds Complex Joomla Components - com_componentbuilder - component - 3.1.13 + pkg_component_builder + package + site + 3.1.17 https://dev.vdm.io - http://domain.com/demo.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.17.zip stable diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Dashboard.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Dashboard.php new file mode 100644 index 000000000..80ff344b7 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Dashboard.php @@ -0,0 +1,213 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Application\CMSApplication; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Compiler Component Dynamic Dashboard + * + * @since 3.2.0 + */ +class Dashboard +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Application object. + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * @param Component|null $component The component class. + * @param CMSApplication|null $app The app object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null, ?Component $component = null, + ?CMSApplication $app = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + $this->component = $component ?: Compiler::_('Component'); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Set the Dynamic Dashboard + * + * @return void + * @since 3.2.0 + */ + public function set() + { + // only add the dynamic dashboard if all checks out + if ($this->component->get('dashboard_type', 0) == 2 + && ($dashboard_ = $this->component->get('dashboard')) !== null + && StringHelper::check($dashboard_) + && strpos((string) $dashboard_, '_') !== false) + { + // set the default view + $getter = explode('_', (string) $dashboard_); + if (count((array) $getter) == 2 && is_numeric($getter[1])) + { + // the pointers + $t = StringHelper::safe($getter[0], 'U'); + $id = (int) $getter[1]; + + // the dynamic stuff + $targets = array('A' => 'admin_views', + 'C' => 'custom_admin_views'); + $names = array('A' => 'admin view', + 'C' => 'custom admin view'); + $types = array('A' => 'adminview', 'C' => 'customadminview'); + $keys = array('A' => 'name_list', 'C' => 'code'); + + // check the target values + if (isset($targets[$t]) && $id > 0) + { + // set the type name + $type_names = StringHelper::safe( + $targets[$t], 'w' + ); + // set the dynamic dash + if (($target_ = $this->component->get($targets[$t])) !== null + && ArrayHelper::check($target_)) + { + // search the target views + $dashboard = (array) array_filter( + $target_, + function ($view) use ($id, $t, $types) { + if (isset($view[$types[$t]]) + && $id == $view[$types[$t]]) + { + return true; + } + + return false; + } + ); + + // set dashboard + if (ArrayHelper::check($dashboard)) + { + $dashboard = array_values($dashboard)[0]; + } + + // check if view was found (this should be true) + if (isset($dashboard['settings']) + && isset($dashboard['settings']->{$keys[$t]})) + { + $this->registry->set('build.dashboard', + StringHelper::safe( + $dashboard['settings']->{$keys[$t]} + ) + ); + $this->registry->set('build.dashboard.type', + $targets[$t] + ); + } + else + { + // set massage that something is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT', + $names[$t], $dashboard_, + $type_names + ), 'Error' + ); + } + } + else + { + // set massage that something is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT', + $names[$t], $dashboard_, + $type_names + ), 'Error' + ); + } + } + else + { + // the target value is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID', + $dashboard_ + ), 'Error' + ); + } + } + else + { + // the target value is wrong + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID', + $dashboard_ + ), 'Error' + ); + } + + // if default was changed to dynamic dashboard the remove default tab and methods + if ($this->registry->get('build.dashboard')) + { + // dynamic dashboard is used + $this->component->remove('dashboard_tab'); + $this->component->remove('php_dashboard_methods'); + } + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Data.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Data.php index f6c3a871b..cfb7bc801 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Data.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Data.php @@ -482,6 +482,21 @@ class Data ); } + // build the build date + if ($this->config->get('add_build_date', 1) == 3) + { + if (empty($this->component->modified) || + $this->component->modified == '0000-00-00' || + $this->component->modified == '0000-00-00 00:00:00') + { + $this->config->set('build_date', $this->component->created); + } + else + { + $this->config->set('build_date', $this->component->modified); + } + } + // build update SQL $this->history->set($component); diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Settings.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Settings.php new file mode 100644 index 000000000..41f3f40d9 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Settings.php @@ -0,0 +1,756 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Compiler Component (Joomla Version) Settings + * + * @since 3.2.0 + */ +class Settings +{ + /** + * The standard folders + * + * @var array + * @since 3.2.0 + */ + protected array $standardFolders = [ + 'site', + 'admin', + 'media' + ]; + + /** + * The standard root files + * + * @var array + * @since 3.2.0 + */ + protected array $standardRootFiles = [ + 'access.xml', + 'config.xml', + 'controller.php', + 'index.html', + 'README.txt' + ]; + + /** + * Compiler Joomla Version Data + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $data = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Component Dynamic Path + * + * @var Dynamicpath + * @since 3.2.0 + **/ + protected Dynamicpath $dynamicpath; + + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param EventInterface|null $event The compiler event api object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Component|null $component The component class. + * @param Paths|null $paths The compiler paths object. + * @param Dynamicpath|null $dynamicpath The compiler dynamic path object. + * @param Pathfix|null $pathfix The compiler path fixing object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?EventInterface $event = null, ?Placeholder $placeholder = null, + ?Component $component = null, ?Paths $paths = null, + ?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->event = $event ?: Compiler::_('Event'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->component = $component ?: Compiler::_('Component'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath'); + $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); + + // add component endpoint file to stander list of root files + $this->standardRootFiles[] = $this->component->get('name_code') . '.php'; + } + + /** + * Check if data set is loaded + * + * @return bool + * @since 3.2.0 + */ + public function exists(): bool + { + if (!$this->isSet()) + { + // load the data + $this->data = $this->get(); + + if (!$this->isSet()) + { + return false; + } + } + + return true; + } + + /** + * Get Joomla - Folder Structure to Create + * + * @return object The version related structure + * @since 3.2.0 + */ + public function structure(): object + { + return $this->data->create; + } + + /** + * Get Joomla - Move Multiple Structure + * + * @return object The version related multiple structure + * @since 3.2.0 + */ + public function multiple(): object + { + return $this->data->move->dynamic; + } + + /** + * Get Joomla - Move Single Structure + * + * @return object The version related single structure + * @since 3.2.0 + */ + public function single(): object + { + return $this->data->move->static; + } + + /** + * Check if Folder is a Standard Folder + * + * @param string $folder The folder name + * + * @return bool true if the folder exists + * @since 3.2.0 + */ + public function standardFolder(string $folder): bool + { + return in_array($folder, $this->standardFolders); + } + + /** + * Check if File is a Standard Root File + * + * @param string $file The file name + * + * @return bool true if the file exists + * @since 3.2.0 + */ + public function standardRootFile(string $file): bool + { + return in_array($file, $this->standardRootFiles); + } + + /** + * Check if Data is Set + * + * @return bool + * @since 3.2.0 + */ + private function isSet(): bool + { + return is_object($this->data) && + isset($this->data->create) && + isset($this->data->move) && + isset($this->data->move->static) && + isset($this->data->move->dynamic); + } + + /** + * get the Joomla Version Data + * + * @return object|null The version data + * @since 3.2.0 + */ + private function get(): ?object + { + // override option + $customSettings = $this->paths->template_path . '/settings_' . + $this->config->component_code_name . '.json'; + + // get the data + $version_data = $this->readJsonFile($customSettings); + + if (is_null($version_data) || !$this->isValidData($version_data)) + { + return null; + } + + $this->loadExtraFolders(); + $this->loadExtraFiles(); + + $this->addFolders($version_data); + $this->addFiles($version_data); + + // for plugin event TODO change event api signatures + $component_context = $this->config->component_context; + + // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData + $this->event->trigger( + 'jcb_ce_onAfterSetJoomlaVersionData', + array(&$component_context, &$version_data) + ); + + return $version_data; + } + + /** + * Read the Json file data + * + * @param string $filePath + * + * @return object|null The version data + * @since 3.2.0 + */ + private function readJsonFile(string $filePath): ?object + { + if (FileHelper::exists($filePath)) + { + $jsonContent = FileHelper::getContent($filePath); + } + else + { + $jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json'); + } + + if (JsonHelper::check($jsonContent)) + { + return json_decode((string) $jsonContent); + } + + return null; + } + + /** + * Check if this is valid data + * + * @param object $versionData + * + * @return bool + * @since 3.2.0 + */ + private function isValidData(object $versionData): bool + { + return isset($versionData->create) && + isset($versionData->move) && + isset($versionData->move->static) && + isset($versionData->move->dynamic); + } + + /** + * Add Extra/Dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFolders() + { + if ($this->component->isArray('folders') || + $this->config->get('add_eximport', false) || + $this->config->get('uikit', 0) || + $this->config->get('footable', false)) + { + $this->addImportViewFolder(); + $this->addPhpSpreadsheetFolder(); + $this->addUikitFolder(); + $this->addFooTableFolder(); + } + } + + /** + * Add Import and Export Folder + * + * @return void + * @since 3.2.0 + */ + private function addImportViewFolder() + { + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folder' => 'importViews', + 'path' => 'admin/views/import', + 'rename' => 1 + ]); + } + } + + /** + * Add Php Spreadsheet Folder + * + * @return void + * @since 3.2.0 + */ + private function addPhpSpreadsheetFolder() + { + // move the phpspreadsheet Folder (TODO we must move this to a library package) + if ($this->config->get('add_eximport', false)) + { + $this->component->appendArray('folders', [ + 'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor', + 'path' => '/libraries/phpspreadsheet/', + 'rename' => 0 + ]); + } + } + + /** + * Add Uikit Folders + * + * @return void + * @since 3.2.0 + */ + private function addUikitFolder() + { + $uikit = $this->config->get('uikit', 0); + if (2 == $uikit || 1 == $uikit) + { + // move the UIKIT Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + if (2 == $uikit || 3 == $uikit) + { + // move the UIKIT-3 Folder into place + $this->component->appendArray('folders', [ + 'folder' => 'uikit-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Foo Table Folder + * + * @return void + * @since 3.2.0 + */ + private function addFooTableFolder() + { + if (!$this->config->get('footable', false)) + { + return; + } + + $footable_version = $this->config->get('footable_version', 2); + + if (2 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v2', + 'path' => 'media', + 'rename' => 0 + ]); + } + elseif (3 == $footable_version) + { + // move the footable folder into place + $this->component->appendArray('folders', [ + 'folder' => 'footable-v3', + 'path' => 'media', + 'rename' => 0 + ]); + } + } + + /** + * Add Extra/Dynamic files + * + * @return void + * @since 3.2.0 + */ + private function loadExtraFiles() + { + if ($this->component->isArray('files') || + $this->config->get('google_chart', false)) + { + $this->addGoogleChartFiles(); + } + } + + /** + * Add Google Chart Files + * + * @return void + * @since 3.2.0 + */ + private function addGoogleChartFiles() + { + if ($this->config->get('google_chart', false)) + { + // move the google chart files + $this->component->appendArray('files', [ + 'file' => 'google.jsapi.js', + 'path' => 'media/js', + 'rename' => 0 + ]); + $this->component->appendArray('files', [ + 'file' => 'chartbuilder.php', + 'path' => 'admin/helpers', + 'rename' => 0 + ]); + } + } + + /** + * Add Folders + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFolders(object &$versionData) + { + if (!$this->component->isArray('folders')) + { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('folders') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'folder', 'folderpath'] + ); + + // fix custom path + if (isset($custom['path']) + && StringHelper::check($custom['path'])) + { + $custom['path'] = trim((string) $custom['path'], '/'); + } + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path folder + if (!isset($custom['folder']) && isset($custom['folderpath'])) + { + // update the dynamic path + $custom['folderpath'] = $this->dynamicpath->update( + $custom['folderpath'] + ); + + // set the folder path with / if does not have a drive/windows full path + $custom['folder'] = (preg_match( + '/^[a-z]:/i', $custom['folderpath'] + )) ? trim($custom['folderpath'], '/') + : '/' . trim($custom['folderpath'], '/'); + + // remove the file path + unset($custom['folderpath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we use the correct name + $pathArray = (array) explode('/', (string) $custom['path']); + $lastFolder = end($pathArray); + + // only rename folder if last has folder name + if (isset($custom['rename']) && $custom['rename'] == 1) + { + $custom['path'] = str_replace( + '/' . $lastFolder, '', (string) $custom['path'] + ); + $rename = 'new'; + $newname = $lastFolder; + } + elseif ('full' === $customPath) + { + // make sure we use the correct name + $folderArray = (array) explode('/', (string) $custom['folder']); + $lastFolder = end($folderArray); + $rename = 'new'; + $newname = $lastFolder; + } + else + { + $rename = false; + $newname = ''; + } + + // insure we have no duplicates + $key_pointer = StringHelper::safe( + $custom['folder'] + ) . '_f' . $pointer_tracker; + + $pointer_tracker++; + + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set new folder to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']); + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = $rename; + $versionData->move->static->{$key_pointer}->newName = $newname; + $versionData->move->static->{$key_pointer}->type = 'folder'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + } + + $this->component->remove('folders'); + } + + /** + * Add Files + * + * @param object $versionData + * + * @return void + * @since 3.2.0 + */ + private function addFiles(object &$versionData) + { + if (!$this->component->isArray('files')) { + return; + } + + // pointer tracker + $pointer_tracker = 'h'; + foreach ($this->component->get('files') as $custom) + { + // check type of target type + $_target_type = 'c0mp0n3nt'; + if (isset($custom['target_type'])) + { + $_target_type = $custom['target_type']; + } + + // for good practice + $this->pathfix->set( + $custom, ['path', 'file', 'filepath'] + ); + + // by default custom path is true + $customPath = 'custom'; + + // set full path if this is a full path file + if (!isset($custom['file']) && isset($custom['filepath'])) + { + // update the dynamic path + $custom['filepath'] = $this->dynamicpath->update( + $custom['filepath'] + ); + + // set the file path with / if does not have a drive/windows full path + $custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath'])) + ? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/'); + + // remove the file path + unset($custom['filepath']); + + // triget fullpath + $customPath = 'full'; + } + + // make sure we have not duplicates + $key_pointer = StringHelper::safe( + $custom['file'] + ) . '_g' . $pointer_tracker; + + $pointer_tracker++; + + // set new file to object + $versionData->move->static->{$key_pointer} = new \stdClass(); + $versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']); + + // update the dynamic component name placholders in file names + $custom['path'] = $this->placeholder->update_( + $custom['path'] + ); + + // get the path info + $pathInfo = pathinfo((string) $custom['path']); + if (isset($pathInfo['extension']) && $pathInfo['extension']) + { + $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = $pathInfo['basename']; + } + elseif ('full' === $customPath) + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // get file array + $fileArray = (array) explode('/', (string) $custom['file']); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = end($fileArray); + } + else + { + // fix custom path + $custom['path'] = ltrim((string) $custom['path'], '/'); + + // set the info + $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = false; + } + + $versionData->move->static->{$key_pointer}->type = 'file'; + $versionData->move->static->{$key_pointer}->custom = $customPath; + + // set the target if type and id is found + if (isset($custom['target_id']) + && isset($custom['target_type'])) + { + $versionData->move->static->{$key_pointer}->_target = [ + 'key' => $custom['target_id'] . '_' . $custom['target_type'], + 'type' => $custom['target_type'] + ]; + } + + // check if file should be updated + if (!isset($custom['notnew']) || $custom['notnew'] == 0 + || $custom['notnew'] != 1) + { + $this->registry->appendArray('files.not.new', $key_pointer); + } + else + { + // update the file content + $this->registry->set('update.file.content.' . $key_pointer, true); + } + } + + $this->component->remove('files'); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structure.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structure.php new file mode 100644 index 000000000..567ca5b52 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structure.php @@ -0,0 +1,118 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Build/Create Component Structure + * + * @since 3.2.0 + */ +class Structure +{ + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Utilities Folder + * + * @var Folder + * @since 3.2.0 + */ + protected Folder $folder; + + /** + * Constructor + * + * @param Settings|null $settings The compiler component joomla version settings object. + * @param Paths|null $paths The compiler paths object. + * @param Folder|null $folder The compiler folder object. + * + * @since 3.2.0 + */ + public function __construct(?Settings $settings = null, ?Paths $paths = null, ?Folder $folder = null) + { + $this->settings = $settings ?: Compiler::_('Component.Settings'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->folder = $folder ?: Compiler::_('Utilities.Folder'); + } + + /** + * Build the Component Structure + * + * @return bool + * @since 3.2.0 + */ + public function build(): bool + { + if ($this->settings->exists()) + { + // setup the main component path + $this->folder->create($this->paths->component_path); + + // build the version structure + $this->folders( + $this->settings->structure(), + $this->paths->component_path + ); + + return true; + } + + return false; + } + + /** + * Create the folder and subfolders + * + * @param object $folders The object[] of folders + * @param string $path The path + * + * @return void + * @since 3.2.0 + */ + protected function folders(object $folders, string $path) + { + foreach ($folders as $folder => $sub_folders) + { + $new_path = $path . '/' . $folder; + $this->folder->create($new_path); + + if (ObjectHelper::check($sub_folders)) + { + $this->folders($sub_folders, $new_path); + } + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php new file mode 100644 index 000000000..7042d9793 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php @@ -0,0 +1,355 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate; +use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Structure; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; + + +/** + * Multiple Files and Folders Builder Class + * + * @since 3.2.0 + */ +class Structuremultiple +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Model Createdate + * + * @var Createdate + * @since 3.2.0 + **/ + protected Createdate $createdate; + + /** + * Compiler Model Modifieddate + * + * @var Modifieddate + * @since 3.2.0 + **/ + protected Modifieddate $modifieddate; + + /** + * Compiler Utility to Build Structure + * + * @var Structure + * @since 3.2.0 + **/ + protected Structure $structure; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Settings|null $settings The compiler component Joomla version settings object. + * @param Component|null $component The component class. + * @param Createdate|null $createdate The compiler model to get create date class. + * @param Modifieddate|null $modifieddate The compiler model to get modified date class. + * @param Structure|null $structure The compiler structure to build dynamic folder and files class. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Settings $settings = null, ?Component $component = null, + ?Createdate $createdate = null, ?Modifieddate $modifieddate = null, + ?Structure $structure = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->settings = $settings ?: Compiler::_('Component.Settings'); + $this->component = $component ?: Compiler::_('Component'); + $this->createdate = $createdate ?: Compiler::_('Model.Createdate'); + $this->modifieddate = $modifieddate ?: Compiler::_('Model.Modifieddate'); + $this->structure = $structure ?: Compiler::_('Utilities.Structure'); + } + + /** + * Build the Multiple Files & Folders + * + * @return bool + * @since 3.2.0 + */ + public function build(): bool + { + $success = false; + + if ($this->settings->exists()) + { + $success = $this->admin(); + $success = $this->site() || $success; + $success = $this->custom() || $success; + } + + return $success; + } + + /** + * Build the Dynamic Admin Files & Folders + * + * @return bool + * @since 3.2.0 + */ + protected function admin(): bool + { + if (!$this->component->isArray('admin_views')) + { + return false; + } + + // check if we have a dynamic dashboard + if (!$this->registry->get('build.dashboard')) + { + // setup the default dashboard + $target = ['admin' => $this->component->get('name_code')]; + $this->structure->build($target, 'dashboard'); + } + + $config = []; + $checkin = false; + + foreach ($this->component->get('admin_views') as $view) + { + if (!$this->isValidAdminView($view, $config)) + { + continue; + } + + $this->buildAdminView($view, $config); + + // quick set of checkin once + if (!$checkin && isset($view['checkin']) && $view['checkin'] == 1) + { + // switch to add checking to config + $checkin = true; + $this->config->set('add_checkin', $checkin); + } + } + + return true; + } + + /** + * Build the Dynamic Site Files & Folders + * + * @return bool + * @since 3.2.0 + */ + protected function site(): bool + { + if (!$this->component->isArray('site_views')) + { + return false; + } + + $config = []; + + foreach ($this->component->get('site_views') as $view) + { + if (!$this->isValidView($view, $config)) + { + continue; + } + + $this->buildView($view, $config, 'site'); + } + + return true; + } + + /** + * Build the Dynamic Custom Admin Files & Folders + * + * @return bool + * @since 3.2.0 + */ + protected function custom(): bool + { + if (!$this->component->isArray('custom_admin_views')) + { + return false; + } + + $config = []; + + foreach ($this->component->get('custom_admin_views') as $view) + { + if (!$this->isValidView($view, $config)) + { + continue; + } + + $this->buildView($view, $config, 'custom_admin'); + } + + return true; + } + + /** + * Check if the view is a valid view + * + * @param array $view + * @param array $config + * + * @return bool + * @since 3.2.0 + */ + private function isValidAdminView(array $view, array &$config): bool + { + if (!isset($view['settings']) || !ObjectHelper::check($view['settings']) + || ((!isset($view['settings']->name_list) || $view['settings']->name_list == 'null') + && (!isset($view['settings']->name_single) || $view['settings']->name_single == 'null'))) + { + return false; + } + + $created = $this->createdate->get($view); + $modified = $this->modifieddate->get($view); + + $config = [ + Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version + ]; + + return true; + } + + /** + * Check if the view is a valid view + * + * @param array $view + * @param array $config + * + * @return bool + * @since 3.2.0 + */ + private function isValidView(array $view, array &$config): bool + { + if (!isset($view['settings']) || !ObjectHelper::check($view['settings']) + || !isset($view['settings']->main_get) + || !ObjectHelper::check($view['settings']->main_get) + || !isset($view['settings']->main_get->gettype) + || ($view['settings']->main_get->gettype != 1 && $view['settings']->main_get->gettype != 2)) + { + return false; + } + + $created = $this->createdate->get($view); + $modified = $this->modifieddate->get($view); + + $config = [ + Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version + ]; + + return true; + } + + /** + * Build the admin view + * + * @param array $view + * @param array $config + * + * @return void + * @since 3.2.0 + */ + private function buildAdminView(array $view, array $config) + { + // build the admin edit view + if ($view['settings']->name_single != 'null') + { + $target = ['admin' => $view['settings']->name_single]; + $this->structure->build($target, 'single', false, $config); + + // build the site edit view (of this admin view) + if (isset($view['edit_create_site_view']) + && is_numeric($view['edit_create_site_view']) + && $view['edit_create_site_view'] > 0) + { + // setup the front site edit-view files + $target = ['site' => $view['settings']->name_single]; + $this->structure->build($target, 'edit', false, $config); + } + } + + // build the list view + if ($view['settings']->name_list != 'null') + { + $target = ['admin' => $view['settings']->name_list]; + $this->structure->build($target, 'list', false, $config); + } + } + + /** + * Build the custom view + * + * @param array $view + * @param array $config + * @param string $type + * + * @return void + * @since 3.2.0 + */ + private function buildView(array $view, array $config, string $type) + { + $target = [$type => $view['settings']->code]; + $view_type = ($view['settings']->main_get->gettype == 1) ? 'single' : 'list'; + + $this->structure->build($target, $view_type, false, $config); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuresingle.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuresingle.php new file mode 100644 index 000000000..6c9816daf --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuresingle.php @@ -0,0 +1,609 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Filesystem\Folder; +use Joomla\CMS\Filesystem\File; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Content; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Component; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; + + +/** + * Single Files and Folders Builder Class + * + * @since 3.2.0 + */ +class Structuresingle +{ + /** + * The new name + * + * @var string + * @since 3.2.0 + */ + protected string $newName; + + /** + * Current Full Path + * + * @var string + * @since 3.2.0 + */ + protected string $currentFullPath; + + /** + * Package Full Path + * + * @var string + * @since 3.2.0 + */ + protected string $packageFullPath; + + /** + * ZIP Full Path + * + * @var string + * @since 3.2.0 + */ + protected string $zipFullPath; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Component + * + * @var Component + * @since 3.2.0 + **/ + protected Component $component; + + /** + * Compiler Content + * + * @var Content + * @since 3.2.0 + **/ + protected Content $content; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Utilities Files + * + * @var Files + * @since 3.2.0 + */ + protected Files $files; + + /** + * Application object. + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param Registry|null $registry The compiler registry object. + * @param Settings|null $settings The compiler component Joomla version settings object. + * @param Component|null $component The component class. + * @param Content|null $content The compiler content object. + * @param Counter|null $counter The compiler counter object. + * @param Paths|null $paths The compiler paths object. + * @param Files|null $files The compiler files object. + * @param CMSApplication|null $app The CMS Application object. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Registry $registry = null, + ?Settings $settings = null, ?Component $component = null, + ?Content $content = null, ?Counter $counter = null, ?Paths $paths = null, + ?Files $files = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->registry = $registry ?: Compiler::_('Registry'); + $this->settings = $settings ?: Compiler::_('Component.Settings'); + $this->component = $component ?: Compiler::_('Component'); + $this->content = $content ?: Compiler::_('Content'); + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Build the Single Files & Folders + * + * @return bool + * @since 3.2.0 + */ + public function build(): bool + { + if ($this->settings->exists()) + { + // TODO needs more looking at this must be dynamic actually + $this->registry->appendArray('files.not.new', 'LICENSE.txt'); + + // do license check + $LICENSE = $this->doLicenseCheck(); + + // do README check + $README = $this->doReadmeCheck(); + + // start moving + foreach ($this->settings->single() as $target => $details) + { + // if not gnu/gpl license dont add the LICENSE.txt file + if ($details->naam === 'LICENSE.txt' && !$LICENSE) + { + continue; + } + + // if not needed do not add + if (($details->naam === 'README.md' || $details->naam === 'README.txt') + && !$README) + { + continue; + } + + // set new name + $this->setNewName($details); + + // set all paths + $this->setPaths($details); + + // check if the path exists + if ($this->pathExist($details)) + { + // set the target + $this->setTarget($target, $details); + } + + // set dynamic target as needed + $this->setDynamicTarget($details); + } + + return true; + } + + return false; + } + + /** + * Check if license must be added + * + * @return bool + * @since 3.2.0 + */ + private function doLicenseCheck(): bool + { + $licenseChecker = strtolower((string) $this->component->get('license', '')); + + if (strpos($licenseChecker, 'gnu') !== false + && strpos( + $licenseChecker, '2' + ) !== false + && (strpos($licenseChecker, 'gpl') !== false + || strpos( + $licenseChecker, 'General public license' + ) !== false)) + { + return true; + } + + return false; + } + + /** + * Check if readme must be added + * + * @return bool + * @since 3.2.0 + */ + private function doReadmeCheck(): bool + { + if ($this->component->get('addreadme', false)) + { + return true; + } + + return false; + } + + /** + * Set the new name + * + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setNewName(object $details) + { + // do the file renaming + if (isset($details->rename) && $details->rename) + { + if ($details->rename === 'new') + { + $this->newName = $details->newName; + } + else + { + $this->newName = str_replace( + $details->rename, + $this->config->component_code_name, + (string) $details->naam + ); + } + } + else + { + $this->newName = $details->naam; + } + } + + /** + * Set all needed paths + * + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setPaths(object $details) + { + // check if we have a target value + if (isset($details->_target)) + { + // set destination path + $zipPath = str_replace( + $details->_target['type'] . '/', '', (string) $details->path + ); + $path = str_replace( + $details->_target['type'] . '/', + $this->registry->get('dynamic_paths.' . $details->_target['key'], '') . '/', + (string) $details->path + ); + } + else + { + // set destination path + $zipPath = str_replace('c0mp0n3nt/', '', (string) $details->path); + $path = str_replace( + 'c0mp0n3nt/', $this->paths->component_path . '/', (string) $details->path + ); + } + + // set the template folder path + $templatePath = (isset($details->custom) && $details->custom) + ? (($details->custom !== 'full') ? $this->paths->template_path_custom + . '/' : '') : $this->paths->template_path . '/'; + + // set the final paths + $currentFullPath = (preg_match('/^[a-z]:/i', (string) $details->naam)) ? $details->naam + : $templatePath . '/' . $details->naam; + + $this->currentFullPath = str_replace('//', '/', (string) $currentFullPath); + + $this->packageFullPath = str_replace('//', '/', $path . '/' . $this->newName); + + $this->zipFullPath = str_replace( + '//', '/', $zipPath . '/' . $this->newName + ); + } + + /** + * Check if path exists + * + * @param object $details + * + * @return bool + * @since 3.2.0 + */ + private function pathExist(object $details): bool + { + // check if this has a type + if (!isset($details->type)) + { + return false; + } + // take action based on type + elseif ($details->type === 'file' && !File::exists($this->currentFullPath)) + { + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_FILE_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED', + $this->currentFullPath + ), 'Error' + ); + + return false; + } + elseif ($details->type === 'folder' && !Folder::exists($this->currentFullPath)) + { + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED', + $this->currentFullPath + ), 'Error' + ); + + return false; + } + + return true; + } + + /** + * Set the target based on target type + * + * @param string $target + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setTarget(string $target, object $details) + { + // take action based on type + if ($details->type === 'file') + { + // move the file + $this->moveFile(); + + // register the file + $this->registerFile($target, $details); + } + elseif ($details->type === 'folder') + { + // move the folder to its place + Folder::copy( + $this->currentFullPath, $this->packageFullPath, '', true + ); + + // count the folder created + $this->counter->folder++; + } + } + + /** + * Move/Copy the file into place + * + * @return void + * @since 3.2.0 + */ + private function moveFile() + { + // get base name && get the path only + $packageFullPath0nly = str_replace( + basename($this->packageFullPath), '', $this->packageFullPath + ); + + // check if path exist, if not creat it + if (!Folder::exists($packageFullPath0nly)) + { + Folder::create($packageFullPath0nly); + } + + // move the file to its place + File::copy($this->currentFullPath, $this->packageFullPath); + + // count the file created + $this->counter->file++; + } + + /** + * Register the file + * + * @param string $target + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function registerFile(string $target, object $details) + { + // store the new files + if (!in_array($target, $this->registry->get('files.not.new', []))) + { + if (isset($details->_target)) + { + $this->files->appendArray($details->_target['key'], + [ + 'path' => $this->packageFullPath, + 'name' => $this->newName, + 'zip' => $this->zipFullPath + ] + ); + } + else + { + $this->files->appendArray('static', + [ + 'path' => $this->packageFullPath, + 'name' => $this->newName, + 'zip' => $this->zipFullPath + ] + ); + } + } + + // ensure we update this file if needed + if ($this->registry->exists('update.file.content.' . $target)) + { + // remove the pointer + $this->registry->remove('update.file.content.' . $target); + + // set the full path + $this->registry->set('update.file.content.' . $this->packageFullPath, $this->packageFullPath); + } + } + + /** + * Set Dynamic Target + * + * @param object $details + * + * @return void + * @since 3.2.0 + */ + private function setDynamicTarget(object $details) + { + // only add if no target found since those belong to plugins and modules + if (!isset($details->_target)) + { + // check if we should add the dynamic folder moving script to the installer script + $checker = array_values((array) explode('/', $this->zipFullPath)); + + // TODO <-- this may not be the best way, will keep an eye on this. + // We basicly only want to check if a folder is added that is not in the stdFolders array + if (isset($checker[0]) + && StringHelper::check($checker[0]) + && !$this->settings->standardFolder($checker[0])) + { + // activate dynamic folders + $this->setDynamicFolders(); + } + elseif (count((array) $checker) == 2 + && StringHelper::check($checker[0])) + { + $add_to_extra = false; + + // set the target + $eNAME = 'FILES'; + $ename = 'filename'; + + // this should not happen and must have been caught by the above if statment + if ($details->type === 'folder') + { + // only folders outside the standard folder are added + $eNAME = 'FOLDERS'; + $ename = 'folder'; + $add_to_extra = true; + } + // if this is a file, it can only be added to the admin/site/media folders + // all other folders are moved as a whole so their files do not need to be declared + elseif ($this->settings->standardFolder($checker[0]) + && !$this->settings->standardRootFile($checker[1])) + { + $add_to_extra = true; + } + + // add if valid folder/file + if ($add_to_extra) + { + // set the tab + $eTab = Indent::_(2); + if ('admin' === $checker[0]) + { + $eTab = Indent::_(3); + } + + // set the xml file + $key_ = 'EXSTRA_' + . StringHelper::safe( + $checker[0], 'U' + ) . '_' . $eNAME; + $this->content->add($key_, + PHP_EOL . $eTab . "<" . $ename . ">" + . $checker[1] . ""); + } + } + } + } + + /** + * Add the dynamic folders + * + * @return void + * @since 3.2.0 + */ + private function setDynamicFolders() + { + // check if we should add the dynamic folder moving script to the installer script + if (!$this->registry->get('set_move_folders_install_script')) + { + // add the setDynamicF0ld3rs() method to the install scipt.php file + $this->registry->set('set_move_folders_install_script', true); + + // set message that this was done (will still add a tutorial link later) + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE'), + 'Notice' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED'), + 'Notice' + ); + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php index 5dbef0974..ee6e44a3e 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -101,6 +101,17 @@ class Config extends BaseConfig return false; // default is false } + /** + * get add checkin + * + * @return bool add checkin switch + * @since 3.2.0 + */ + protected function getAddcheckin(): bool + { + return false; // default is false + } + /** * get posted component id * @@ -169,7 +180,7 @@ class Config extends BaseConfig */ protected function getJoomlaversion(): int { - return $this->input->post->get('joomla_version', 3, 'INT'); + return 3; // $this->input->post->get('joomla_version', 3, 'INT'); } /** @@ -208,6 +219,17 @@ class Config extends BaseConfig return false; } + /** + * get show advanced options switch + * + * @return bool show advanced options + * @since 3.2.0 + */ + protected function getShowadvancedoptions(): bool + { + return (bool) $this->input->post->get('show_advanced_options', 0, 'INT'); + } + /** * get indentation value * @@ -216,7 +238,60 @@ class Config extends BaseConfig */ protected function getIndentationvalue(): string { - return "\t"; // TODO add to GUI as an Global Option? + // if advanced options is active + if ($this->show_advanced_options) + { + $indentation_value = $this->input->post->get('indentation_value', 1, 'INT'); + + switch($indentation_value) + { + case 2: + // two spaces + return " "; + break; + case 4: + // four spaces + return " "; + break; + } + } + + return "\t"; + } + + /** + * get add build date switch + * + * @return int add build date options + * @since 3.2.0 + */ + protected function getAddbuilddate(): int + { + // if advanced options is active + if ($this->show_advanced_options) + { + // 1=default 2=manual 3=component + return $this->input->post->get('add_build_date', 1, 'INT'); + } + + return 1; + } + + /** + * get build date + * + * @return string build date + * @since 3.2.0 + */ + protected function getBuilddate(): string + { + // if advanced options is active and manual date selected + if ($this->show_advanced_options && $this->add_build_date == 2) + { + return $this->input->post->get('build_date', 'now', 'STRING'); + } + + return "now"; } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Extractor.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Extractor.php index 73ed508ff..bc52c6801 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Extractor.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Extractor.php @@ -25,8 +25,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; use VDM\Joomla\Componentbuilder\Compiler\Customcode\Extractor\Paths; use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse; use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; -use VDM\Joomla\Componentbuilder\Compiler\Utilities\Path; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\ExtractorInterface; @@ -179,6 +179,14 @@ class Extractor implements ExtractorInterface **/ protected Placeholder $componentPlaceholder; + /** + * Compiler Component Pathfix + * + * @var Pathfix + * @since 3.2.0 + **/ + protected Pathfix $pathfix; + /** * Current User Object * @@ -211,6 +219,7 @@ class Extractor implements ExtractorInterface * @param Paths|null $paths The compiler customcode extractor paths object. * @param Reverse|null $reverse The compiler placeholder reverse object. * @param Placeholder|null $placeholder The compiler component placeholder object. + * @param Pathfix|null $pathfix The compiler path fixing object. * @param User|null $user The current User object. * @param \JDatabaseDriver|null $db The Database Driver object. * @param CMSApplication|null $app The CMS Application object. @@ -219,7 +228,7 @@ class Extractor implements ExtractorInterface * @since 3.2.0 */ public function __construct(?Config $config = null, ?Gui $gui = null, ?Paths $paths = null, - ?Reverse $reverse = null, ?Placeholder $placeholder = null, + ?Reverse $reverse = null, ?Placeholder $placeholder = null, ?Pathfix $pathfix = null, ?User $user = null, ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) { $this->config = $config ?: Compiler::_('Config'); @@ -227,6 +236,7 @@ class Extractor implements ExtractorInterface $this->paths = $paths ?: Compiler::_('Customcode.Extractor.Paths'); $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); $this->componentPlaceholder = $placeholder ?: Compiler::_('Component.Placeholder'); + $this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix'); $this->user = $user ?: Factory::getUser(); $this->db = $db ?: Factory::getDbo(); $this->app = $app ?: Factory::getApplication(); @@ -581,7 +591,7 @@ class Extractor implements ExtractorInterface ); // for good practice - Path::fix($path); + $this->pathfix->set($path); // all new records we can do a bulk insert if ($i === 1 || !$id) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlamodule/Builder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlamodule/Structure.php similarity index 96% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlamodule/Builder.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlamodule/Structure.php index 878b3fa56..87f9b7fff 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlamodule/Builder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlamodule/Structure.php @@ -33,11 +33,11 @@ use VDM\Joomla\Utilities\FileHelper; /** - * Joomla Module Builder Class + * Joomla Module Structure Builder Class * * @since 3.2.0 */ -class Builder +class Structure { /** * Compiler Joomla Module Data Class @@ -159,7 +159,7 @@ class Builder * @return void * @since 3.2.0 */ - public function run() + public function build() { if ($this->module->exists()) { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Builder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php similarity index 96% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Builder.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php index d20a9cad6..225010c65 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Builder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Joomlaplugin/Structure.php @@ -37,7 +37,7 @@ use VDM\Joomla\Utilities\FileHelper; * * @since 3.2.0 */ -class Builder +class Structure { /** * Compiler Joomla Plugin Data Class @@ -159,7 +159,7 @@ class Builder * @return void * @since 3.2.0 */ - public function run() + public function build() { if ($this->plugin->exists()) { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Library/Builder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Library/Structure.php similarity index 95% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Library/Builder.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Library/Structure.php index 53fa6aa0e..fecf50527 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Library/Builder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Library/Structure.php @@ -31,11 +31,11 @@ use VDM\Joomla\Utilities\FileHelper; /** - * Library Builder Class + * Library Structure Builder Class * * @since 3.2.0 */ -class Builder +class Structure { /** * Compiler Config @@ -147,7 +147,7 @@ class Builder * @return void * @since 3.2.0 */ - public function run() + public function build() { if (($libraries_ = $this->registry->get('builder.libraries')) !== null) { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Createdate.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Createdate.php new file mode 100644 index 000000000..ae7816194 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Createdate.php @@ -0,0 +1,52 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Model - Get Create Date + * + * @since 3.2.0 + */ +class Createdate +{ + /** + * Get the create date of an item + * + * @param mixed $item The item data + * + * @return string The create data + * @since 3.2.0 + */ + public function get(&$item): string + { + if (isset($item['settings']->created) + && StringHelper::check($item['settings']->created)) + { + // first set the main date + $date = strtotime((string) $item['settings']->created); + } + else + { + // first set the main date + $date = strtotime("now"); + } + + return Factory::getDate($date)->format('jS F, Y'); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Modifieddate.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Modifieddate.php new file mode 100644 index 000000000..754056ce8 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Modifieddate.php @@ -0,0 +1,155 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + + +/** + * Model - Get Modified Date + * + * @since 3.2.0 + */ +class Modifieddate +{ + /** + * The array of last modified dates + * + * @var array + * @since 3.2.0 + */ + protected array $last = []; + + /** + * Get the last modified date of an item + * + * @param array $item The item data + * + * @return string The modified date + * @since 3.2.0 + */ + public function get(array $item): string + { + $key = $this->getKey($item); + + if (!isset($this->last[$key])) + { + $date = max($this->getDate($item), $this->getModified($item)); + + $this->last[$key] = Factory::getDate($date)->format( + 'jS F, Y' + ); + } + + return $this->last[$key]; + } + + /** + * Get the last modified date of an item + * + * @param array $item The item data + * + * @return int The modified date as int + * @since 3.2.0 + */ + protected function getDate(array $item): int + { + if (isset($item['settings']) && isset($item['settings']->modified) + && StringHelper::check($item['settings']->modified) + && '0000-00-00 00:00:00' !== $item['settings']->modified) + { + return strtotime((string) $item['settings']->modified); + } + + return strtotime("now"); + } + + /** + * Get the last modified date of an item's sub items + * + * @param array $item The item data + * + * @return int The modified date as int + * @since 3.2.0 + */ + protected function getModified(array $item): int + { + $date = 0; + + // if not settings is found + if (!isset($item['settings']) || !ObjectHelper::check($item['settings'])) + { + return $date; + } + + // check if we have fields + if (isset($item['settings']->fields) && ArrayHelper::check($item['settings']->fields)) + { + foreach ($item['settings']->fields as $field) + { + if (isset($field['settings']) + && ObjectHelper::check($field['settings']) + && isset($field['settings']->modified) + && StringHelper::check($field['settings']->modified) + && '0000-00-00 00:00:00' !== $field['settings']->modified) + { + $modified = strtotime((string) $field['settings']->modified); + $date = max($date, $modified); + } + } + } + // check if we have a main dynamic get + elseif (isset($item['settings']->main_get) + && ObjectHelper::check($item['settings']->main_get) + && isset($item['settings']->main_get->modified) + && StringHelper::check($item['settings']->main_get->modified) + && '0000-00-00 00:00:00' !== $item['settings']->main_get->modified) + { + $modified = strtotime((string) $item['settings']->main_get->modified); + $date = max($date, $modified); + } + + return $date; + } + + /** + * Get the key for an item + * + * @param array $item The item data + * + * @return string The key + * @since 3.2.0 + */ + protected function getKey(array $item): string + { + if (isset($item['adminview'])) + { + return $item['adminview'] . 'admin'; + } + elseif (isset($item['siteview'])) + { + return $item['siteview'] . 'site'; + } + elseif (isset($item['customadminview'])) + { + return $item['customadminview'] . 'customadmin'; + } + + return 'error'; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Updatesql.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Updatesql.php index bd912487d..9387d151d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Updatesql.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Updatesql.php @@ -60,13 +60,13 @@ class Updatesql * @param mixed $old The old values * @param mixed $new The new values * @param string $type The type of values - * @param int|null $key The id/key where values changed + * @param mixed $key The id/key where values changed * @param array|null $ignore The ids to ignore * * @return void * @since 3.2.0 */ - public function set($old, $new, string $type, ?int $key = null, ?array $ignore = null) + public function set($old, $new, string $type, $key = null, ?array $ignore = null) { // check if there were new items added if (ArrayHelper::check($new) && ArrayHelper::check($old)) @@ -206,12 +206,12 @@ class Updatesql * * @param string $type The type of values * @param int $item The item id to add - * @param int|null $key The id/key where values changed + * @param mixed $key The id/key where values changed * * @return void * @since 3.2.0 */ - protected function add(string $type, int $item, ?int $key = null) + protected function add(string $type, int $item, $key = null) { // add key if found if ($key) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php index ca84d6e6e..99c2ed362 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php @@ -134,6 +134,7 @@ class Power implements PowerInterface * @param \JDatabaseDriver|null $db The Database Driver object. * @param CMSApplication|null $app The CMS Application object. * + * @throws \Exception * @since 3.2.0 */ public function __construct(?Config $config = null, ?Placeholder $placeholder = null, @@ -170,20 +171,20 @@ class Power implements PowerInterface /** * Get a power * - * @param string $guid The global unique id of the power - * @param int $build Force build switch (to override global switch) + * @param string $guid The global unique id of the power + * @param int $build Force build switch (to override global switch) * - * @return mixed + * @return object|null * @since 3.2.0 */ - public function get(string $guid, int $build = 0) + public function get(string $guid, int $build = 0): ?object { if (($this->config->get('add_power', true) || $build == 1) && $this->set($guid)) { return $this->active[$guid]; } - return false; + return null; } /** @@ -194,29 +195,19 @@ class Power implements PowerInterface * @return bool true on successful setting of a power * @since 3.2.0 */ - protected function set(string $guid): bool + private function set(string $guid): bool { // check if we have been here before - if (isset($this->state[$guid])) + if ($this->isPowerSet($guid)) { return $this->state[$guid]; } - elseif (GuidHelper::valid($guid)) + elseif ($this->isGuidValid($guid)) { - // Create a new query object. - $query = $this->db->getQuery(true); + // get the power data + $this->active[$guid] = $this->getPowerData($guid); - // select all values - $query->select('a.*'); - - // from this table - $query->from('#__componentbuilder_power AS a'); - $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); - - $this->db->setQuery($query); - $this->db->execute(); - - if ($this->db->getNumRows()) + if (is_object($this->active[$guid])) { // make sure that in recursion we // don't try to load this power again @@ -224,9 +215,6 @@ class Power implements PowerInterface // all powers linked to it $this->state[$guid] = true; - // get the power data - $this->active[$guid] = $this->db->loadObject(); - // make sure to add any language strings found to all language files // since we can't know where this is used at this point $tmp_lang_target = $this->config->lang_target; @@ -284,54 +272,17 @@ class Power implements PowerInterface $this->setExtend($guid, $use); // set GUI mapper - $guiMapper = array('table' => 'power', 'id' => (int) $this->active[$guid]->id, 'type' => 'php'); + $guiMapper = [ + 'table' => 'power', + 'id' => (int) $this->active[$guid]->id, + 'type' => 'php' + ]; // add the licensing template - if ($this->active[$guid]->add_licensing_template == 2 && - StringHelper::check($this->active[$guid]->licensing_template)) - { - // set GUI mapper field - $guiMapper['field'] = 'licensing_template'; - // base64 Decode code - $this->active[$guid]->licensing_template = $this->gui->set( - $this->placeholder->update_( - $this->customcode->update( - base64_decode( - (string) $this->active[$guid]->licensing_template - ) - ) - ), - $guiMapper - ); - } - else - { - $this->active[$guid]->add_licensing_template = 1; - $this->active[$guid]->licensing_template = ''; - } + $this->setLicensingTemplate($guid, $guiMapper); // add the header script - if ($this->active[$guid]->add_head == 1) - { - // set GUI mapper field - $guiMapper['field'] = 'head'; - - // base64 Decode code - $this->active[$guid]->head = $this->gui->set( - $this->placeholder->update_( - $this->customcode->update( - base64_decode( - (string) $this->active[$guid]->head - ) - ) - ), - $guiMapper - ) . PHP_EOL; - } - else - { - $this->active[$guid]->head = ''; - } + $this->setHeader($guid, $guiMapper); // set composer $this->setComposer($guid); @@ -342,22 +293,7 @@ class Power implements PowerInterface ) : ''; // add the main code if set - if (StringHelper::check($this->active[$guid]->main_class_code)) - { - // set GUI mapper field - $guiMapper['field'] = 'main_class_code'; - // base64 Decode code - $this->active[$guid]->main_class_code = $this->gui->set( - $this->placeholder->update_( - $this->customcode->update( - base64_decode( - (string) $this->active[$guid]->main_class_code - ) - ) - ), - $guiMapper - ); - } + $this->setMainClassCode($guid, $guiMapper); // load the use classes $this->setUseAs($guid, $use, $as); @@ -372,7 +308,7 @@ class Power implements PowerInterface // we failed to get the power, // so we raise an error message // only if guid is valid - if (GuidHelper::valid($guid)) + if ($this->isGuidValid($guid)) { $this->app->enqueueMessage( Text::sprintf('COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP', $guid), @@ -386,6 +322,58 @@ class Power implements PowerInterface return false; } + /** + * Check if the power is already set + * + * @param string $guid The global unique id of the power + * + * @return bool true if the power is already set + * @since 3.2.0 + */ + private function isPowerSet(string $guid): bool + { + return isset($this->state[$guid]); + } + + /** + * Validate the GUID + * + * @param string $guid The global unique id of the power + * + * @return bool true if the GUID is valid + * @since 3.2.0 + */ + private function isGuidValid(string $guid): bool + { + return GuidHelper::valid($guid); + } + + /** + * Get the power data from the database + * + * @param string $guid The global unique id of the power + * + * @return object|null The power data + * @since 3.2.0 + */ + private function getPowerData(string $guid): ?object + { + $query = $this->db->getQuery(true); + $query->select('a.*'); + $query->from('#__componentbuilder_power AS a'); + $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); + + $this->db->setQuery($query); + $this->db->execute(); + + if ($this->db->getNumRows()) + { + return $this->db->loadObject(); + } + + return null; + } + /** * Set the namespace for this power * @@ -394,7 +382,7 @@ class Power implements PowerInterface * @return bool * @since 3.2.0 */ - protected function setNamespace(string $guid): bool + private function setNamespace(string $guid): bool { // set namespace $this->active[$guid]->namespace = $this->placeholder->update_( @@ -534,7 +522,7 @@ class Power implements PowerInterface * @return void * @since 3.2.0 */ - protected function setUseSelection(string $guid, array &$use, array &$as) + private function setUseSelection(string $guid, array &$use, array &$as) { // check if we have use selection $this->active[$guid]->use_selection = (isset($this->active[$guid]->use_selection) @@ -565,7 +553,7 @@ class Power implements PowerInterface * @return void * @since 3.2.0 */ - protected function setLoadSelection(string $guid) + private function setLoadSelection(string $guid) { // check if we have load selection $this->active[$guid]->load_selection = (isset($this->active[$guid]->load_selection) @@ -592,12 +580,11 @@ class Power implements PowerInterface * Set Composer Linked Use and Access Point * * @param string $guid The global unique id of the power - * @param array $use The use array * * @return void * @since 3.2.0 */ - protected function setComposer(string $guid) + private function setComposer(string $guid) { // does this have composer powers $_composer = (isset($this->active[$guid]->composer) @@ -665,7 +652,7 @@ class Power implements PowerInterface * @return void * @since 3.2.0 */ - protected function setImplements(string $guid, array &$use) + private function setImplements(string $guid, array &$use) { // see if we have implements $this->active[$guid]->implement_names = []; @@ -714,7 +701,7 @@ class Power implements PowerInterface * @return void * @since 3.2.0 */ - protected function setExtend(string $guid, array &$use) + private function setExtend(string $guid, array &$use) { // does this extend something $this->active[$guid]->extends_name = null; @@ -748,11 +735,12 @@ class Power implements PowerInterface * * @param string $guid The global unique id of the power * @param array $use The use array + * @param array $as The use as array * * @return void * @since 3.2.0 */ - protected function setUseAs($guid, $use, $as) + private function setUseAs(string $guid, array $use, array $as) { // now add all the extra use statements if (ArrayHelper::check($use)) @@ -784,12 +772,12 @@ class Power implements PowerInterface * Get Clean Namespace without use or ; as part of the name space * * @param string $namespace The actual name space - * @input bool $removeNumbers The switch to remove numers + * @param bool $removeNumbers The switch to remove numbers * * @return string * @since 3.2.0 */ - protected function getCleanNamespace(string $namespace, bool $removeNumbers = true): string + private function getCleanNamespace(string $namespace, bool $removeNumbers = true): string { // trim possible (use) or (;) or (starting or ending \) added to the namespace return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace), $removeNumbers); @@ -804,7 +792,7 @@ class Power implements PowerInterface * @return string * @since 3.2.0 */ - protected function getUseNamespace(string $namespace, string $as = 'default'): string + private function getUseNamespace(string $namespace, string $as = 'default'): string { // check if it has an AS option if ($as !== 'default') @@ -823,7 +811,7 @@ class Power implements PowerInterface * @return void * @since 3.2.0 */ - protected function addToHeader(string $guid, string $string) + private function addToHeader(string $guid, string $string) { // check if it is already added manually if (isset($this->active[$guid]->head) && @@ -832,6 +820,106 @@ class Power implements PowerInterface $this->active[$guid]->head .= $string . PHP_EOL; } } + + /** + * Set the power licensing template + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setLicensingTemplate(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_licensing_template == 2 && + StringHelper::check($this->active[$guid]->licensing_template)) + { + // set GUI mapper field + $guiMapper['field'] = 'licensing_template'; + + // base64 Decode code + $this->active[$guid]->licensing_template = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $this->active[$guid]->licensing_template + ) + ) + ), + $guiMapper + ); + } + else + { + $this->active[$guid]->add_licensing_template = 1; + $this->active[$guid]->licensing_template = ''; + } + } + + /** + * Set the power header script + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setHeader(string $guid, array $guiMapper): void + { + if ($this->active[$guid]->add_head == 1) + { + // set GUI mapper field + $guiMapper['field'] = 'head'; + + // base64 Decode code + $this->active[$guid]->head = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $this->active[$guid]->head + ) + ) + ), + $guiMapper + ) . PHP_EOL; + } + else + { + $this->active[$guid]->head = ''; + } + } + + /** + * Set the power main class code + * + * @param string $guid The global unique id of the power + * @param array $guiMapper The gui mapper array + * + * @return void + * @since 3.2.0 + */ + private function setMainClassCode(string $guid, array $guiMapper): void + { + if (StringHelper::check($this->active[$guid]->main_class_code)) + { + // set GUI mapper field + $guiMapper['field'] = 'main_class_code'; + + // base64 Decode code + $this->active[$guid]->main_class_code = $this->gui->set( + $this->placeholder->update_( + $this->customcode->update( + base64_decode( + (string) $this->active[$guid]->main_class_code + ) + ) + ), + $guiMapper + ); + } + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php index e3d3278b0..b27af38c0 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php @@ -52,6 +52,14 @@ class Autoloader **/ protected Content $content; + /** + * Helper Class Autoloader + * + * @var string + * @since 3.2.0 + **/ + protected string $helper = ''; + /** * Constructor. * @@ -81,57 +89,205 @@ class Autoloader */ public function set() { - if (($size = ArrayHelper::check($this->power->namespace)) > 0) + if (ArrayHelper::check($this->power->namespace)) { - // set if we should load the autoloader on the site area - $loadSite = (!$this->config->remove_site_folder || !$this->config->remove_site_edit_folder); + /************************* IMPORTANT SORT NOTICE *********************************************** + * make sure the name space values are sorted from the longest string to the shortest + * so that the search do not mistakenly match a shorter namespace before a longer one + * that has the same short namespace for example: + * NameSpace\SubName\Sub <- will always match first + * NameSpace\SubName\SubSubName + * Should the shorter namespace be listed [first] it will match both of these: + * NameSpace\SubName\Sub\ClassName + * ^^^^^^^^^^^^^^^^^^^^^^ + * NameSpace\SubName\SubSubName\ClassName + * ^^^^^^^^^^^^^^^^^^^^^^ + ***********************************************************************************************/ + uksort($this->power->namespace, fn($a, $b) => strlen((string) $b) - strlen((string) $a)); // check if we are using a plugin - $use_plugin = $this->content->exist('PLUGIN_POWER_AUTOLOADER'); - - // build the methods - $autoload_not_site_method = []; - $autoload_method = []; - - // add only if we are not using a plugin - $tab_space = 2; - if (!$use_plugin) + if ($this->loadPluginAutoloader()) { - $autoload_not_site_method[] = PHP_EOL . PHP_EOL; - $tab_space = 0; - } - elseif (!$loadSite) - { - // we add code to prevent this plugin from triggering on the site area - $autoload_not_site_method[] = PHP_EOL . Indent::_(2) . '//' - . Line::_(__Line__, __Class__) . ' do not run the autoloader in the site area'; - $autoload_not_site_method[] = Indent::_(2) . 'if ($this->app->isClient(\'site\'))'; - $autoload_not_site_method[] = Indent::_(2) . '{'; - $autoload_not_site_method[] = Indent::_(3) . 'return;'; - $autoload_not_site_method[] = Indent::_(2) . '}' . PHP_EOL; + $this->content->set('PLUGIN_POWER_AUTOLOADER', $this->getPluginAutoloader()); } + // load to the helper class + if ($this->loadHelperAutoloader()) + { + // load to admin helper class + $this->content->add('ADMIN_POWER_HELPER', $this->getHelperAutoloader()); + + // load to site helper class if needed + if ($this->loadSiteAutoloader()) + { + $this->content->add('SITE_POWER_HELPER', $this->getHelperAutoloader()); + } + } + + // to add to custom files + $this->content->add('CUSTOM_POWER_AUTOLOADER', $this->getHelperAutoloader()); + } + } + + /** + * Should we load the plugin autoloader + * + * @return bool + * @since 3.2.0 + */ + private function loadPluginAutoloader(): bool + { + return $this->content->exist('PLUGIN_POWER_AUTOLOADER'); + } + + /** + * Should we load the helper class autoloader + * + * @return bool + * @since 3.2.0 + */ + private function loadHelperAutoloader(): bool + { + // for now we load it if the plugin is not loaded + // but we may want to add a switch that + // controls this behaviour. + return !$this->loadPluginAutoloader(); + } + + /** + * Should we load the autoloader in site area + * + * @return bool + * @since 3.2.0 + */ + private function loadSiteAutoloader(): bool + { + return (!$this->config->remove_site_folder || !$this->config->remove_site_edit_folder); + } + + /** + * Get helper autoloader code + * + * @return string + * @since 3.2.0 + */ + private function getPluginAutoloader(): string + { + // load the code + $code = []; + + // if we should not load in the site are + if (($script = $this->getBLockSiteLoading()) !== null) + { + $code[] = $script; + } + + // add the composer stuff here + if (($script = $this->getComposer(2)) !== null) + { + $code[] = $script; + } + + // get the helper autoloader + if (($script = $this->getAutoloader(2)) !== null) + { + $code[] = $script; + } + + // if we have any + if (!empty($code)) + { + return PHP_EOL . PHP_EOL . implode(PHP_EOL . PHP_EOL, $code); + } + + return ''; + } + + /** + * Get helper autoloader code + * + * @return string + * @since 3.2.0 + */ + private function getHelperAutoloader(): string + { + // check if it was already build + if (!empty($this->helper)) + { + return $this->helper; + } + + // load the code + $code = []; + + // add the composer stuff here + if (($script = $this->getComposer(0)) !== null) + { + $code[] = $script; + } + + // get the helper autoloader + if (($script = $this->getAutoloader(0)) !== null) + { + $code[] = $script; + } + + // if we have any + if (!empty($code)) + { + $this->helper = PHP_EOL . PHP_EOL . implode(PHP_EOL . PHP_EOL, $code); + } + + return $this->helper; + } + + /** + * Get code that will block the plugin from loading + * the autoloader in the site area + * + * @return string|null + * @since 3.2.0 + */ + private function getBLockSiteLoading(): ?string + { + // if we should not load in the site are + if (!$this->loadSiteAutoloader()) + { + // we add code to prevent this plugin from triggering on the site area + $not_site = []; + $not_site[] = Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' do not run the autoloader in the site area'; + $not_site[] = Indent::_(2) . 'if ($this->app->isClient(\'site\'))'; + $not_site[] = Indent::_(2) . '{'; + $not_site[] = Indent::_(3) . 'return;'; + $not_site[] = Indent::_(2) . '}'; + + return implode(PHP_EOL, $not_site); + } + + return null; + } + + /** + * Get autoloader code + * + * @param int $tabSpace The dynamic tab spacer + * + * @return string|null + * @since 3.2.0 + */ + private function getAutoloader(int $tabSpace): ?string + { + if (($size = ArrayHelper::check($this->power->namespace)) > 0) + { // we start building the spl_autoload_register function call - $autoload_method[] = Indent::_($tab_space) . '//' + $autoload_method = []; + $autoload_method[] = Indent::_($tabSpace) . '//' . Line::_(__Line__, __Class__) . ' register this component namespace'; - $autoload_method[] = Indent::_($tab_space) . 'spl_autoload_register(function ($class) {'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '//' + $autoload_method[] = Indent::_($tabSpace) . 'spl_autoload_register(function ($class) {'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '$search = ['; - - // ==== IMPORTANT NOTICE ===== - // make sure the name space values are sorted from the longest string to the shortest - // so that the search do not mistakenly match a shorter namespace before a longer one - // that has the same short namespace for example: - // NameSpace\SubName\Sub <- will always match first - // NameSpace\SubName\SubSubName - // Should the shorter namespace be listed [first] it will match both of these: - // NameSpace\SubName\Sub\ClassName - // ^^^^^^^^^^^^^^^^^^^^^ - // NameSpace\SubName\SubSubName\ClassName - // ^^^^^^^^^^^^^^^^^^^^^ - - uksort($this->power->namespace, fn($a, $b) => strlen((string) $b) - strlen((string) $a)); + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$search = ['; // counter to manage the comma in the actual array $counter = 1; @@ -140,137 +296,118 @@ class Autoloader // don't add the ending comma on last value if ($size == $counter) { - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; } else { - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; } $counter++; } - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '];'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '// Start the search and load if found'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '$found = false;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '$found_base_dir = "";'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '$found_len = 0;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '{'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '];'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// Start the search and load if found'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found = false;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found_base_dir = "";'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$found_len = 0;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '//' . Line::_(__Line__, __Class__) . ' does the class use the namespace prefix?'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . '$len = strlen($prefix);'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . '{'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(3) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '$len = strlen($prefix);'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '{'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '//' . Line::_(__Line__, __Class__) . ' we have a match so load the values'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(3) . '$found = true;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(3) . '$found_base_dir = $base_dir;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(3) . '$found_len = $len;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(3) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found = true;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found_base_dir = $base_dir;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '$found_len = $len;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . '//' . Line::_(__Line__, __Class__) . ' done here'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(3) . 'break;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . '}'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(3) . 'break;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '}'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' check if we found a match'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . 'if (!$found)'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '{'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'if (!$found)'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . '//' . Line::_(__Line__, __Class__) . ' not found so move to the next registered autoloader'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . 'return;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'return;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' get the relative class name'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '$relative_class = substr($class, $found_len);'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$relative_class = substr($class, $found_len);'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' replace the namespace prefix with the base directory, replace namespace'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '// separators with directory separators in the relative class name, append'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '// with .php'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '//' + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// separators with directory separators in the relative class name, append'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '// with .php'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' if the file exists, require it'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . 'if (file_exists($file))'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '{'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(2) . 'require $file;'; - $autoload_method[] = Indent::_($tab_space) . Indent::_(1) . '}'; - $autoload_method[] = Indent::_($tab_space) . '});'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . 'if (file_exists($file))'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '{'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(2) . 'require $file;'; + $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '}'; + $autoload_method[] = Indent::_($tabSpace) . '});'; - // add the composer stuff here - $autoload_composer = ''; - if (ArrayHelper::check($this->power->composer)) - { - $autoload_composer = $this->getComposer($tab_space); - } - - // create the method string - $autoloader = $autoload_composer . implode(PHP_EOL, $autoload_not_site_method) . implode(PHP_EOL, $autoload_method); - - // check if we are using a plugin - if ($use_plugin) - { - $this->content->set('PLUGIN_POWER_AUTOLOADER', PHP_EOL . $autoloader); - } - else - { - // load to events placeholders - $this->content->add('ADMIN_POWER_HELPER', $autoloader); - // load to site if needed - if ($loadSite) - { - $this->content->add('SITE_POWER_HELPER', $autoloader); - } - } - - // to add to custom files - $this->content->add('CUSTOM_POWER_AUTOLOADER', PHP_EOL . implode(PHP_EOL, $autoload_method)); + return implode(PHP_EOL, $autoload_method); } + + return null; } /** * Get the composer autoloader routine * - * @param string $tabSpace The dynamic tab spacer + * @param int $tabSpace The dynamic tab spacer * - * @return string + * @return string|null * @since 3.2.0 */ - protected function getComposer(string $tabSpace): string + private function getComposer(int $tabSpace): ?string { - // load the composer routine - $composer_routine = []; - - // counter to manage the comma in the actual array - $add_once = []; - foreach ($this->power->composer as $access_point) + if (ArrayHelper::check($this->power->composer)) { - // don't add the ending comma on last value - if (empty($add_once[$access_point])) + // load the composer routine + $composer_routine = []; + + // counter to manage the comma in the actual array + $add_once = []; + foreach ($this->power->composer as $access_point) { - $composer_routine[] = Indent::_($tabSpace) . "\$composer_autoloader = JPATH_LIBRARIES . '/$access_point';"; - $composer_routine[] = Indent::_($tabSpace) . 'if (file_exists($composer_autoloader))'; - $composer_routine[] = Indent::_($tabSpace) . "{"; - $composer_routine[] = Indent::_($tabSpace) . Indent::_(1) . 'require_once $composer_autoloader;'; - $composer_routine[] = Indent::_($tabSpace) . "}"; + // don't add the ending comma on last value + if (empty($add_once[$access_point])) + { + $composer_routine[] = Indent::_($tabSpace) . "\$composer_autoloader = JPATH_LIBRARIES . '/$access_point';"; + $composer_routine[] = Indent::_($tabSpace) . 'if (file_exists($composer_autoloader))'; + $composer_routine[] = Indent::_($tabSpace) . "{"; + $composer_routine[] = Indent::_($tabSpace) . Indent::_(1) . 'require_once $composer_autoloader;'; + $composer_routine[] = Indent::_($tabSpace) . "}"; - $add_once[$access_point] = true; + $add_once[$access_point] = true; + } } + + // this is just about the [autoloader or autoloaders] in the comment ;) + if (count($add_once) == 1) + { + array_unshift($composer_routine, Indent::_($tabSpace) . '//' + . Line::_(__Line__, __Class__) . ' add the autoloader for the composer classes'); + } + else + { + array_unshift($composer_routine, Indent::_($tabSpace) . '//' + . Line::_(__Line__, __Class__) . ' add the autoloaders for the composer classes'); + } + + return implode(PHP_EOL, $composer_routine); } - if (count($add_once) == 1) - { - array_unshift($composer_routine, PHP_EOL . PHP_EOL . Indent::_($tabSpace) . '//' - . Line::_(__Line__, __Class__) . ' add the autoloader for the composer classes'); - } - else - { - array_unshift($composer_routine, PHP_EOL . PHP_EOL . Indent::_($tabSpace) . '//' - . Line::_(__Line__, __Class__) . ' add the autoloaders for the composer classes'); - } - - return implode(PHP_EOL, $composer_routine); + return null; } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Builder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php similarity index 95% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Builder.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php index 2197ec0ba..644f21765 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Builder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php @@ -32,11 +32,11 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; /** - * Power Builder Class + * Power Structure Builder Class * * @since 3.2.0 */ -class Builder +class Structure { /** * we track the creation of htaccess files @@ -166,7 +166,7 @@ class Builder * @return void * @since 3.2.0 */ - public function run() + public function build() { if (ArrayHelper::check($this->power->active)) { @@ -315,7 +315,7 @@ class Builder * @return void * @since 3.2.0 */ - protected function setDynamicFolders() + private function setDynamicFolders() { // check if we should add the dynamic folder moving script to the installer script if (!$this->registry->get('set_move_folders_install_script')) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Compiler.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Compiler.php index de5451e6f..479a2cc18 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Compiler.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Compiler.php @@ -16,6 +16,7 @@ use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Table; /** @@ -40,6 +41,9 @@ class Compiler implements ServiceProviderInterface $container->alias(Registry::class, 'Registry') ->share('Registry', [$this, 'getRegistry'], true); + + $container->alias(Table::class, 'Table') + ->share('Table', [$this, 'getTable'], true); } /** @@ -67,6 +71,20 @@ class Compiler implements ServiceProviderInterface { return new Registry(); } + + /** + * Get the Table + * + * @param Container $container The DI container. + * + * @return Table + * @since 3.2.0 + */ + public function getTable(Container $container): Table + { + return new Table(); + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php index 070f7dae4..737c4206d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php @@ -14,9 +14,14 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Component as ComponentObject; -use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as ComponentPlaceholder; -use VDM\Joomla\Componentbuilder\Compiler\Component\Data as ComponentData; +use VDM\Joomla\Componentbuilder\Compiler\Component as CompilerComponent; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\Dashboard; +use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Component\Data; +use VDM\Joomla\Componentbuilder\Compiler\Component\Structure; +use VDM\Joomla\Componentbuilder\Compiler\Component\Structuresingle; +use VDM\Joomla\Componentbuilder\Compiler\Component\Structuremultiple; /** @@ -36,14 +41,29 @@ class Component implements ServiceProviderInterface */ public function register(Container $container) { - $container->alias(ComponentObject::class, 'Component') + $container->alias(CompilerComponent::class, 'Component') ->share('Component', [$this, 'getComponent'], true); - $container->alias(ComponentPlaceholder::class, 'Component.Placeholder') - ->share('Component.Placeholder', [$this, 'getComponentPlaceholder'], true); + $container->alias(Settings::class, 'Component.Settings') + ->share('Component.Settings', [$this, 'getSettings'], true); - $container->alias(ComponentData::class, 'Component.Data') - ->share('Component.Data', [$this, 'getComponentData'], true); + $container->alias(Dashboard::class, 'Component.Dashboard') + ->share('Component.Dashboard', [$this, 'getDashboard'], true); + + $container->alias(Placeholder::class, 'Component.Placeholder') + ->share('Component.Placeholder', [$this, 'getPlaceholder'], true); + + $container->alias(Data::class, 'Component.Data') + ->share('Component.Data', [$this, 'getData'], true); + + $container->alias(Structure::class, 'Component.Structure') + ->share('Component.Structure', [$this, 'getStructure'], true); + + $container->alias(Structuresingle::class, 'Component.Structure.Single') + ->share('Component.Structure.Single', [$this, 'getStructuresingle'], true); + + $container->alias(Structuremultiple::class, 'Component.Structure.Multiple') + ->share('Component.Structure.Multiple', [$this, 'getStructuremultiple'], true); } /** @@ -51,27 +71,65 @@ class Component implements ServiceProviderInterface * * @param Container $container The DI container. * - * @return ComponentObject + * @return CompilerComponent * @since 3.2.0 */ - public function getComponent(Container $container): ComponentObject + public function getComponent(Container $container): CompilerComponent { - return new ComponentObject( + return new CompilerComponent( $container->get('Component.Data') ); } + /** + * Get the Compiler Component (version) Settings + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + return new Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + + /** + * Get the Compiler Component Dynamic Dashboard + * + * @param Container $container The DI container. + * + * @return Dashboard + * @since 3.2.0 + */ + public function getDashboard(Container $container): Dashboard + { + return new Dashboard( + $container->get('Registry'), + $container->get('Component') + ); + } + /** * Get the Component Placeholders * * @param Container $container The DI container. * - * @return ComponentPlaceholder + * @return Placeholder * @since 3.2.0 */ - public function getComponentPlaceholder(Container $container): ComponentPlaceholder + public function getPlaceholder(Container $container): Placeholder { - return new ComponentPlaceholder( + return new Placeholder( $container->get('Config') ); } @@ -81,12 +139,12 @@ class Component implements ServiceProviderInterface * * @param Container $container The DI container. * - * @return ComponentData + * @return Data * @since 3.2.0 */ - public function getComponentData(Container $container): ComponentData + public function getData(Container $container): Data { - return new ComponentData( + return new Data( $container->get('Config'), $container->get('Event'), $container->get('Placeholder'), @@ -107,6 +165,67 @@ class Component implements ServiceProviderInterface $container->get('Model.Joomlamodules'), $container->get('Model.Joomlaplugins') ); - } + } + + /** + * Get the Compiler Structure + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Component.Settings'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Folder') + ); + } + + /** + * Get the Compiler Structure Single + * + * @param Container $container The DI container. + * + * @return Structuresingle + * @since 3.2.0 + */ + public function getStructuresingle(Container $container): Structuresingle + { + return new Structuresingle( + $container->get('Config'), + $container->get('Registry'), + $container->get('Component.Settings'), + $container->get('Component'), + $container->get('Content'), + $container->get('Utilities.Counter'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Files') + ); + } + + /** + * Get the Compiler Structure Multiple + * + * @param Container $container The DI container. + * + * @return Structuremultiple + * @since 3.2.0 + */ + public function getStructuremultiple(Container $container): Structuremultiple + { + return new Structuremultiple( + $container->get('Config'), + $container->get('Registry'), + $container->get('Component.Settings'), + $container->get('Component'), + $container->get('Model.Createdate'), + $container->get('Model.Modifieddate'), + $container->get('Utilities.Structure') + ); + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php index 152fc59a6..1f9cd2181 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php @@ -199,7 +199,8 @@ class Customcode implements ServiceProviderInterface $container->get('Customcode.Gui'), $container->get('Customcode.Extractor.Paths'), $container->get('Placeholder.Reverse'), - $container->get('Component.Placeholder') + $container->get('Component.Placeholder'), + $container->get('Utilities.Pathfix') ); } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlamodule.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlamodule.php index c3c08ef6f..dc1091663 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlamodule.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlamodule.php @@ -14,8 +14,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Data as JoomlaModuleData; -use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Builder as JoomlaModuleBuilder; +use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Data; +use VDM\Joomla\Componentbuilder\Compiler\Joomlamodule\Structure; /** @@ -35,11 +35,11 @@ class Joomlamodule implements ServiceProviderInterface */ public function register(Container $container) { - $container->alias(JoomlaModuleData::class, 'Joomlamodule.Data') - ->share('Joomlamodule.Data', [$this, 'getJoomlaModuleData'], true); + $container->alias(Data::class, 'Joomlamodule.Data') + ->share('Joomlamodule.Data', [$this, 'getData'], true); - $container->alias(JoomlaModuleBuilder::class, 'Joomlamodule.Builder') - ->share('Joomlamodule.Builder', [$this, 'getJoomlaModuleBuilder'], true); + $container->alias(Structure::class, 'Joomlamodule.Structure') + ->share('Joomlamodule.Structure', [$this, 'getStructure'], true); } /** @@ -47,12 +47,12 @@ class Joomlamodule implements ServiceProviderInterface * * @param Container $container The DI container. * - * @return JoomlaModuleData + * @return Data * @since 3.2.0 */ - public function getJoomlaModuleData(Container $container): JoomlaModuleData + public function getData(Container $container): Data { - return new JoomlaModuleData( + return new Data( $container->get('Config'), $container->get('Customcode'), $container->get('Customcode.Gui'), @@ -67,16 +67,16 @@ class Joomlamodule implements ServiceProviderInterface } /** - * Get the Joomla Module Builder + * Get the Joomla Module Structure Builder * * @param Container $container The DI container. * - * @return JoomlaModuleBuilder + * @return Structure * @since 3.2.0 */ - public function getJoomlaModuleBuilder(Container $container): JoomlaModuleBuilder + public function getStructure(Container $container): Structure { - return new JoomlaModuleBuilder( + return new Structure( $container->get('Joomlamodule.Data'), $container->get('Component'), $container->get('Config'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlaplugin.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlaplugin.php index 1e2d2162a..a8343f1c3 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlaplugin.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Joomlaplugin.php @@ -14,8 +14,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Data as JoomlaPluginData; -use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Builder as JoomlaPluginBuilder; +use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Data; +use VDM\Joomla\Componentbuilder\Compiler\Joomlaplugin\Structure; /** @@ -35,11 +35,11 @@ class Joomlaplugin implements ServiceProviderInterface */ public function register(Container $container) { - $container->alias(JoomlaPluginData::class, 'Joomlaplugin.Data') - ->share('Joomlaplugin.Data', [$this, 'getJoomlaPluginData'], true); + $container->alias(Data::class, 'Joomlaplugin.Data') + ->share('Joomlaplugin.Data', [$this, 'getData'], true); - $container->alias(JoomlaPluginBuilder::class, 'Joomlaplugin.Builder') - ->share('Joomlaplugin.Builder', [$this, 'getJoomlaPluginBuilder'], true); + $container->alias(Structure::class, 'Joomlaplugin.Structure') + ->share('Joomlaplugin.Structure', [$this, 'getStructure'], true); } /** @@ -47,12 +47,12 @@ class Joomlaplugin implements ServiceProviderInterface * * @param Container $container The DI container. * - * @return JoomlaPluginData + * @return Data * @since 3.2.0 */ - public function getJoomlaPluginData(Container $container): JoomlaPluginData + public function getData(Container $container): Data { - return new JoomlaPluginData( + return new Data( $container->get('Config'), $container->get('Customcode'), $container->get('Customcode.Gui'), @@ -65,16 +65,16 @@ class Joomlaplugin implements ServiceProviderInterface } /** - * Get the Joomla Plugin Builder + * Get the Joomla Plugin Structure Builder * * @param Container $container The DI container. * - * @return JoomlaPluginBuilder + * @return Structure * @since 3.2.0 */ - public function getJoomlaPluginBuilder(Container $container): JoomlaPluginBuilder + public function getStructure(Container $container): Structure { - return new JoomlaPluginBuilder( + return new Structure( $container->get('Joomlaplugin.Data'), $container->get('Component'), $container->get('Config'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Library.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Library.php index f6f624fc5..3055b6feb 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Library.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Library.php @@ -15,7 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Library\Data; -use VDM\Joomla\Componentbuilder\Compiler\Library\Builder; +use VDM\Joomla\Componentbuilder\Compiler\Library\Structure; /** @@ -38,8 +38,8 @@ class Library implements ServiceProviderInterface $container->alias(Data::class, 'Library.Data') ->share('Library.Data', [$this, 'getData'], true); - $container->alias(Builder::class, 'Library.Builder') - ->share('Library.Builder', [$this, 'getBuilder'], true); + $container->alias(Structure::class, 'Library.Structure') + ->share('Library.Structure', [$this, 'getStructure'], true); } /** @@ -63,16 +63,16 @@ class Library implements ServiceProviderInterface } /** - * Get the Compiler Library Builder + * Get the Compiler Library Structure Builder * * @param Container $container The DI container. * - * @return Builder + * @return Structure * @since 3.2.0 */ - public function getBuilder(Container $container): Builder + public function getStructure(Container $container): Structure { - return new Builder( + return new Structure( $container->get('Config'), $container->get('Registry'), $container->get('Event'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php index b7533da6e..e8fae64f2 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php @@ -50,6 +50,8 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking; use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump; use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs; use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; +use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate; +use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate; /** @@ -174,6 +176,12 @@ class Model implements ServiceProviderInterface $container->alias(Filesfolders::class, 'Model.Filesfolders') ->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true); + $container->alias(Modifieddate::class, 'Model.Modifieddate') + ->share('Model.Modifieddate', [$this, 'getModifieddate'], true); + + $container->alias(Createdate::class, 'Model.Createdate') + ->share('Model.Createdate', [$this, 'getCreatedate'], true); + $container->alias(ServerLoad::class, 'Model.Server.Load') ->share('Model.Server.Load', [$this, 'getServerLoad'], true); } @@ -724,6 +732,32 @@ class Model implements ServiceProviderInterface return new Whmcs(); } + /** + * Get the modified date Model + * + * @param Container $container The DI container. + * + * @return Modifieddate + * @since 3.2.0 + */ + public function getModifieddate(Container $container): Modifieddate + { + return new Modifieddate(); + } + + /** + * Get the create date Model + * + * @param Container $container The DI container. + * + * @return Createdate + * @since 3.2.0 + */ + public function getCreatedate(Container $container): Createdate + { + return new Createdate(); + } + /** * Get the files folders Model * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php index 835aa3ac0..7f39613be 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php @@ -17,7 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Power as Powers; use VDM\Joomla\Componentbuilder\Compiler\Power\Infusion; use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader; -use VDM\Joomla\Componentbuilder\Compiler\Power\Builder; +use VDM\Joomla\Componentbuilder\Compiler\Power\Structure; /** @@ -46,8 +46,8 @@ class Power implements ServiceProviderInterface $container->alias(Infusion::class, 'Power.Infusion') ->share('Power.Infusion', [$this, 'getInfusion'], true); - $container->alias(Builder::class, 'Power.Builder') - ->share('Power.Builder', [$this, 'getBuilder'], true); + $container->alias(Structure::class, 'Power.Structure') + ->share('Power.Structure', [$this, 'getStructure'], true); } /** @@ -106,16 +106,16 @@ class Power implements ServiceProviderInterface } /** - * Get the Compiler Power Builder + * Get the Compiler Power Structure Builder * * @param Container $container The DI container. * - * @return Builder + * @return Structure * @since 3.2.0 */ - public function getBuilder(Container $container): Builder + public function getStructure(Container $container): Structure { - return new Builder( + return new Structure( $container->get('Power'), $container->get('Config'), $container->get('Registry'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php index dd4ee7468..169c44750 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php @@ -20,6 +20,10 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Componentbuilder\Utilities\Constantpaths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Structure; /** @@ -53,6 +57,18 @@ class Utilities implements ServiceProviderInterface $container->alias(Files::class, 'Utilities.Files') ->share('Utilities.Files', [$this, 'getFiles'], true); + + $container->alias(Constantpaths::class, 'Utilities.Constantpaths') + ->share('Utilities.Constantpaths', [$this, 'getConstantpaths'], true); + + $container->alias(Dynamicpath::class, 'Utilities.Dynamicpath') + ->share('Utilities.Dynamicpath', [$this, 'getDynamicpath'], true); + + $container->alias(Pathfix::class, 'Utilities.Pathfix') + ->share('Utilities.Pathfix', [$this, 'getPathfix'], true); + + $container->alias(Structure::class, 'Utilities.Structure') + ->share('Utilities.Structure', [$this, 'getStructure'], true); } /** @@ -129,6 +145,67 @@ class Utilities implements ServiceProviderInterface { return new Files(); } + + /** + * Get the Constant Paths + * + * @param Container $container The DI container. + * + * @return Constantpaths + * @since 3.2.0 + */ + public function getConstantpaths(Container $container): Constantpaths + { + return new Constantpaths(); + } + + /** + * Get the Compiler Dynamic Path + * + * @param Container $container The DI container. + * + * @return Dynamicpath + * @since 3.2.0 + */ + public function getDynamicpath(Container $container): Dynamicpath + { + return new Dynamicpath( + $container->get('Placeholder'), + $container->get('Utilities.Constantpaths') + ); + } + + /** + * Get the Compiler Path Fixer + * + * @param Container $container The DI container. + * + * @return Pathfix + * @since 3.2.0 + */ + public function getPathfix(Container $container): Pathfix + { + return new Pathfix(); + } + + /** + * Get the Compiler Structure Dynamic Builder + * + * @param Container $container The DI container. + * + * @return Structure + * @since 3.2.0 + */ + public function getStructure(Container $container): Structure + { + return new Structure( + $container->get('Component.Settings'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Counter'), + $container->get('Utilities.File'), + $container->get('Utilities.Files') + ); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Dynamicpath.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Dynamicpath.php new file mode 100644 index 000000000..0a56aaf07 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Dynamicpath.php @@ -0,0 +1,78 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Utilities\Constantpaths; + + +/** + * Compiler Utilities Dynamic Path + * + * @since 3.2.0 + */ +class Dynamicpath +{ + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Constant Paths + * + * @var array + * @since 3.2.0 + **/ + protected array $paths; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The Compiler Placeholder object. + * @param Constantpaths|null $paths The Constant Paths object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null, ?Constantpaths $paths = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $paths = $paths ?: Compiler::_('Utilities.Constantpaths'); + + // load the constant paths + $this->paths = $paths->get(); + } + + /** + * Update path with dynamic value + * + * @param string $path The path to update + * + * @return string The updated path + * @since 3.2.0 + */ + public function update(string $path): string + { + return $this->placeholder->update_( + $this->placeholder->update( + $path, $this->paths + ) + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Pathfix.php similarity index 90% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Pathfix.php index c66c8dc7f..e2208f7ec 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Pathfix.php @@ -21,7 +21,7 @@ use VDM\Joomla\Utilities\StringHelper; * * @since 3.2.0 */ -abstract class Path +class Pathfix { /** * Fix the path to work in the JCB script <-- (main issue here) @@ -37,7 +37,7 @@ abstract class Path * @return void * @since 3.2.0 */ - public static function fix(&$values, $targets = []) + public function set(&$values, array $targets = []) { // if multiple to gets searched and fixed if (ArrayHelper::check($values) && ArrayHelper::check($targets)) @@ -46,7 +46,7 @@ abstract class Path { if (isset($values[$target])) { - self::fix($values[$target], $targets); + $this->set($values[$target], $targets); } } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Paths.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Paths.php index 51ea35cb3..9104dda23 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Paths.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Paths.php @@ -56,43 +56,22 @@ class Paths extends MapperSingle implements Mappersingleinterface $this->component = $component ?: Compiler::_('Component'); // set the template path - $this->set('template_path', - $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_' - . $this->config->joomla_versions[$this->config->joomla_version]['folder_key'] - ); + $this->setTemplatePath(); // set component sales name - $this->set('component_sales_name', - 'com_' . $this->component->get('sales_name') . '__J' - . $this->config->joomla_version - ); + $this->setComponentSalesName(); // set component backup name - $this->set('component_backup_name', - 'com_' . $this->component->get('sales_name') . '_v' . str_replace( - '.', '_', (string) $this->component->get('component_version') - ) . '__J' . $this->config->joomla_version - ); + $this->setComponentBackupName(); // set component folder name - $this->set('component_folder_name', - 'com_' . $this->component->get('name_code') . '_v' . str_replace( - '.', '_', (string) $this->component->get('component_version') - ) . '__J' . $this->config->joomla_version - ); + $this->setComponentFolderName(); // set component path - $this->set('component_path', - $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' - . $this->get('component_folder_name') - ); + $this->setComponentPath(); - // set the template path for custom TODO: just use custom_folder_path in config - $this->set('template_path_custom', - $this->config->get( - 'custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/custom' - ) - ); + // set the template path for custom + $this->setTemplatePathCustom(); } /** @@ -127,6 +106,99 @@ class Paths extends MapperSingle implements Mappersingleinterface { return $key; } + + /** + * Set the template path + * + * @return void + * + * @since 3.2.0 + */ + private function setTemplatePath(): void + { + $this->set('template_path', + $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_' + . $this->config->joomla_versions[$this->config->joomla_version]['folder_key'] + ); + } + + /** + * Set component sales name + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentSalesName(): void + { + $this->set('component_sales_name', + 'com_' . $this->component->get('sales_name') . '__J' + . $this->config->joomla_version + ); + } + + /** + * Set component backup name + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentBackupName(): void + { + $this->set('component_backup_name', + 'com_' . $this->component->get('sales_name') . '_v' . str_replace( + '.', '_', (string) $this->component->get('component_version') + ) . '__J' . $this->config->joomla_version + ); + } + + /** + * Set component folder name + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentFolderName(): void + { + $this->set('component_folder_name', + 'com_' . $this->component->get('name_code') . '_v' . str_replace( + '.', '_', (string) $this->component->get('component_version') + ) . '__J' . $this->config->joomla_version + ); + } + + /** + * Set component path + * + * @return void + * + * @since 3.2.0 + */ + private function setComponentPath(): void + { + $this->set('component_path', + $this->config->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' + . $this->get('component_folder_name') + ); + } + + /** + * set the template path for custom TODO: just use custom_folder_path in config + * + * @return void + * + * @since 3.2.0 + */ + private function setTemplatePathCustom(): void + { + $this->set('template_path_custom', + $this->config->get( + 'custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/custom' + ) + ); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php new file mode 100644 index 000000000..ccef5d633 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php @@ -0,0 +1,313 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Filesystem\File as JoomlaFile; +use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Compiler Utilities To Build Structure + * + * @since 3.2.0 + */ +class Structure +{ + /** + * Compiler Component Joomla Version Settings + * + * @var Settings + * @since 3.2.0 + */ + protected Settings $settings; + + /** + * Compiler Utilities Paths + * + * @var Paths + * @since 3.2.0 + */ + protected Paths $paths; + + /** + * Compiler Counter + * + * @var Counter + * @since 3.2.0 + */ + protected Counter $counter; + + /** + * Compiler Utilities File + * + * @var File + * @since 3.2.0 + */ + protected File $file; + + /** + * Compiler Utilities Files + * + * @var Files + * @since 3.2.0 + */ + protected Files $files; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Settings|null $settings The compiler component joomla version settings object. + * @param Paths|null $paths The compiler paths object. + * @param Counter|null $counter The compiler counter object. + * @param File|null $file The compiler file object. + * @param Files|null $files The compiler files object. + * @param CMSApplication|null $app The CMS Application object. + * + * @since 3.2.0 + * @throws \Exception + */ + public function __construct(?Settings $settings = null, ?Paths $paths = null, + ?Counter $counter = null, ?File $file = null, ?Files $files = null, + ?CMSApplication $app = null) + { + $this->settings = $settings ?: Compiler::_('Component.Settings'); + $this->paths = $paths ?: Compiler::_('Utilities.Paths'); + $this->counter = $counter ?: Compiler::_('Utilities.Counter'); + $this->file = $file ?: Compiler::_('Utilities.File'); + $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Build Structural Needed Files & Folders + * + * @param array $target The main target and name + * @param string $type The type in the target + * @param string|null $fileName The custom file name + * @param array|null $config To add more data to the files info + * + * @return bool true on success + * @since 3.2.0 + */ + public function build(array $target, string $type, + ?string $fileName = null, ?array $config = null): bool + { + // did we build the files (any number) + $build_status = false; + + // check that we have the target values + if (ArrayHelper::check($target)) + { + // search the target + foreach ($target as $main => $name) + { + // make sure it is lower case + $name = StringHelper::safe($name); + + // setup the files + foreach ($this->settings->multiple()->{$main} as $item => $details) + { + if ($details->type === $type) + { + $file_details = $this->getFileDetails( + $details, + (string) $item, + $name, + $fileName, + $config + ); + + if (is_array($file_details)) + { + // store the new files + $this->files->appendArray('dynamic.' . $file_details['view'], + $file_details); + + // we have build at least one + $build_status = true; + } + } + } + } + } + + return $build_status; + } + + /** + * Get the details + * + * @param object $details The item details + * @param string $item The item name + * @param string $name The given name + * @param string|null $fileName The custom file name + * @param array|null $config To add more data to the files info + * + * @return array|null The details + * @since 3.2.0 + */ + private function getFileDetails(object $details, string $item, + string $name, ?string $fileName = null, ?array $config = null): ?array + { + $zip_path = ''; + if (($path = $this->getPath($details, $zip_path, $name)) === null) + { + return null; + } + + // setup the folder + if (!Folder::exists($path)) + { + Folder::create($path); + $this->file->html($zip_path); + + // count the folder created + $this->counter->folder++; + } + + $new_name = $this->getNewName($details, $item, $name, $fileName); + + if (!JoomlaFile::exists($path . '/' . $new_name)) + { + // move the file to its place + JoomlaFile::copy( + $this->paths->template_path . '/' . $item, + $path . '/' . $new_name + ); + + // count the file created + $this->counter->file++; + } + + // we can't have dots in a view name + if (strpos($name, '.') !== false) + { + $name = preg_replace('/[\.]+/', '_', (string) $name); + } + + // setup array for new file + $file = [ + 'path' => $path . '/' . $new_name, + 'name' => $new_name, + 'view' => $name, + 'zip' => $zip_path . '/' . $new_name + ]; + + if (ArrayHelper::check($config)) + { + $file['config'] = $config; + } + + return $file; + } + + /** + * Get the path + * + * @param object $details The item details + * @param string $zipPath The zip path + * @param string $name The name + * + * @return string|null The path + * @since 3.2.0 + */ + private function getPath(object $details, string &$zipPath, string $name): ?string + { + // set destination path + if (strpos((string) $details->path, 'VIEW') !== false) + { + $path = str_replace('VIEW', $name, (string) $details->path); + } + else + { + $path = $details->path; + } + + // make sure we have component to replace + if (strpos((string) $path, 'c0mp0n3nt') !== false) + { + $zipPath = str_replace('c0mp0n3nt/', '', (string) $path); + + return str_replace( + 'c0mp0n3nt/', $this->paths->component_path . '/', (string) $path + ); + } + + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP', + $path + ), 'Error' + ); + + return null; + } + + /** + * Get the new name + * + * @param object $details The item details + * @param string $item The item name + * @param string $name The name + * @param string|null $fileName The custom file name + * + * @return string The new name + * @since 3.2.0 + */ + private function getNewName(object $details, string $item, + string &$name, ?string $fileName = null): string + { + // do the file need renaming + if ($details->rename) + { + if (!empty($fileName)) + { + $name = $name . '_' . $fileName; + + return str_replace( + $details->rename, $fileName, $item + ); + } + elseif ($details->rename === 'new') + { + return $details->newName; + } + + return str_replace( + $details->rename, $name, $item + ); + } + + return $item; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server.php index 3e9d8c616..46220dc08 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server.php @@ -142,6 +142,24 @@ class Server return false; } + + /** + * Move File to Server (Legacy Signature) + * + * @param string $localPath The local path to the file + * @param string $fileName The actual file name + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return bool true on success + * @since 3.2.0 + * @deprecated 4.0 + */ + public function legacyMove($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export'): bool + { + return $this->move($serverID, $localPath, $fileName, $protocol, $permission); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Ftp.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Ftp.php index ea4422e7a..038356148 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Ftp.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Ftp.php @@ -28,10 +28,10 @@ class Ftp implements Serverinterface /** * The client object * - * @var FtpClient + * @var FtpClient|null * @since 3.2.0 **/ - protected FtpClient $client; + protected ?FtpClient $client = null; /** * The server details @@ -82,11 +82,17 @@ class Ftp implements Serverinterface * @return bool * @since 3.2.0 **/ - protected function connected(): bool + private function connected(): bool { // check if we have a connection - return ($this->client instanceof FtpClient && $this->client->isConnected()) || - ($this->client = $this->getClient()) !== null; + if ($this->client instanceof FtpClient && $this->client->isConnected()) + { + return true; + } + + $this->client = $this->getClient(); + + return $this->client instanceof FtpClient; } /** @@ -95,7 +101,7 @@ class Ftp implements Serverinterface * @return FtpClient|null * @since 3.2.0 **/ - protected function getClient(): ?FtpClient + private function getClient(): ?FtpClient { // make sure we have a string and it is not default or empty if (StringHelper::check($this->details->signature)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Load.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Load.php index 91b622cbc..fa1a93ac1 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Load.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Load.php @@ -61,10 +61,10 @@ class Load * @param int $id The item ID * @param string $field The table field * - * @return object|null + * @return mixed|null * @since 3.2.0 */ - public function value(int $id, string $field): ?object + public function value(int $id, string $field) { if ($id > 0 && ($value = $this->db->value( $this->setDatabaseFields([$field]), ['a' => 'server'], ['a.id' => $id] diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Model/Load.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Model/Load.php index 2e7d54d41..305e72340 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Model/Load.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Model/Load.php @@ -16,6 +16,8 @@ use Joomla\Registry\Registry; use VDM\Joomla\Componentbuilder\Compiler\Factory; use VDM\Joomla\Componentbuilder\Crypt; use VDM\Joomla\Componentbuilder\Table; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Componentbuilder\Interfaces\ModelInterface; use VDM\Joomla\Componentbuilder\Abstraction\Model; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Sftp.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Sftp.php index 116a1417c..cfef0137f 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Sftp.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Sftp.php @@ -37,10 +37,10 @@ class Sftp implements Serverinterface /** * The client object * - * @var SftpClient + * @var SftpClient|null * @since 3.2.0 **/ - protected SftpClient $client; + protected ?SftpClient $client = null; /** * The server details @@ -107,13 +107,32 @@ class Sftp implements Serverinterface return false; } + /** + * Make sure we are connected + * + * @return bool + * @since 3.2.0 + **/ + private function connected(): bool + { + // check if we have a connection + if ($this->client instanceof SftpClient && ($this->client->isConnected() || $this->client->ping())) + { + return true; + } + + $this->client = $this->getClient(); + + return $this->client instanceof SftpClient; + } + /** * get the SftpClient object * * @return SftpClient|null * @since 3.2.0 **/ - protected function getClient(): ?SftpClient + private function getClient(): ?SftpClient { // make sure we have a host value set if (isset($this->details->host) && StringHelper::check($this->details->host) && @@ -167,19 +186,6 @@ class Sftp implements Serverinterface return null; } - - /** - * Make sure we are connected - * - * @return bool - * @since 3.2.0 - **/ - protected function connected(): bool - { - // check if we have a connection - return ($this->client instanceof SftpClient && ($this->client->isConnected() || $this->client->ping())) || - ($this->client = $this->getClient()) !== null; - } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/Constantpaths.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/Constantpaths.php new file mode 100644 index 000000000..3773d873d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/Constantpaths.php @@ -0,0 +1,93 @@ + + * @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 + */ + +namespace VDM\Joomla\Componentbuilder\Utilities; + + +/** + * Utilities Constant Paths + * + * @since 3.2.0 + */ +class Constantpaths +{ + /** + * The array of constant paths + * + * JPATH_SITE is meant to represent the root path of the JSite application, + * just as JPATH_ADMINISTRATOR is mean to represent the root path of the JAdministrator application. + * + * JPATH_BASE is the root path for the current requested application.... so if you are in the administrator application: + * + * JPATH_BASE == JPATH_ADMINISTRATOR + * + * If you are in the site application: + * + * JPATH_BASE == JPATH_SITE + * + * If you are in the installation application: + * + * JPATH_BASE == JPATH_INSTALLATION. + * + * JPATH_ROOT is the root path for the Joomla install and does not depend upon any application. + * + * @var array + * @since 3.2.0 + */ + protected array $paths = [ + // The path to the administrator folder. + 'JPATH_ADMINISTRATOR' => JPATH_ADMINISTRATOR, + // The path to the installed Joomla! site, or JPATH_ROOT/administrator if executed from the backend. + 'JPATH_BASE' => JPATH_BASE, + // The path to the cache folder. + 'JPATH_CACHE' => JPATH_CACHE, + // The path to the administration folder of the current component being executed. + 'JPATH_COMPONENT_ADMINISTRATOR' => JPATH_COMPONENT_ADMINISTRATOR, + // The path to the site folder of the current component being executed. + 'JPATH_COMPONENT_SITE' => JPATH_COMPONENT_SITE, + // The path to the current component being executed. + 'JPATH_COMPONENT' => JPATH_COMPONENT, + // The path to folder containing the configuration.php file. + 'JPATH_CONFIGURATION' => JPATH_CONFIGURATION, + // The path to the installation folder. + 'JPATH_INSTALLATION' => JPATH_INSTALLATION, + // The path to the libraries folder. + 'JPATH_LIBRARIES' => JPATH_LIBRARIES, + // The path to the plugins folder. + 'JPATH_PLUGINS' => JPATH_PLUGINS, + // The path to the installed Joomla! site. + 'JPATH_ROOT' => JPATH_ROOT, + // The path to the installed Joomla! site. + 'JPATH_SITE' => JPATH_SITE, + // The path to the templates folder. + 'JPATH_THEMES' => JPATH_THEMES + ]; + + /** + * get array of constant paths or just one constant path + * + * @param string|null $path The path to get + * + * @return array|string|null + * @since 3.2.0 + */ + public function get(?string $path = null) + { + if (is_null($path)) + { + return $this->paths; + } + + return $this->paths[$path] ?? null; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Utilities/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/script.php b/script.php index ab034009c..ec2f4b889 100644 --- a/script.php +++ b/script.php @@ -9422,7 +9422,7 @@ class com_componentbuilderInstallerScript echo ' -

Upgrade to Version 3.1.13 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 3.1.17 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db)) diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index bd3b49350..a2607db63 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -70,10 +70,10 @@ use Joomla\CMS\Language\Language; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities; use Joomla\Archive\Archive; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\Path; -use VDM\Joomla\Utilities; /** * Componentbuilder component helper diff --git a/site/language/en-GB/en-GB.com_componentbuilder.ini b/site/language/en-GB/en-GB.com_componentbuilder.ini index b77d528f4..7ddca56da 100644 --- a/site/language/en-GB/en-GB.com_componentbuilder.ini +++ b/site/language/en-GB/en-GB.com_componentbuilder.ini @@ -44,11 +44,15 @@ COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder w COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERCOPYRIGHTHFOURPSP="

%s

" COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERLICENSEHFOURPSP="

%s

" COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE="

Custom Codes Warning

" +COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP="

c0mp0n3nt issue found

The path (%s) could not be used.

" +COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE="

Dashboard Error

" COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE="

Dynamic folder(s) were detected.

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="

External Code Error

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="

External Code Notice

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE="

External Code Warning

" COM_COMPONENTBUILDER_HR_HTHREEFIELD_NOTICEHTHREE="

Field Notice

" +COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE="

File Path Error

" +COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE="

Folder Path Error

" COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

%s namespace error (%s)

You must at-least have two sections in your namespace, you just have one (%s). This is an unacceptable action, please see psr-4 for more info.

This %s was therefore removed, click here to fix this issue.

" COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

%s namespace error (%s)

You must at-least have two sections in your namespace, you just have one. This is an unacceptable action, please see psr-4 for more info.

This %s was therefore removed, click here to fix this issue.

" COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP="

Curl Not Found!

Please setup curl on your system, or componentbuilder will not function correctly!

" @@ -91,14 +95,18 @@ COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMIS COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key." COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key." COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The phpseclib\NET\SFTP library\class is not available! This library\class should have been added to your libraries/vdm_io/vendor folder. Please contact your system administrator for more info" +COM_COMPONENTBUILDER_THE_BSB_BSB_IS_NOT_AVAILABLE_IN_YOUR_COMPONENT_PLEASE_INSURE_TO_ONLY_USED_S_FOR_A_DYNAMIC_DASHBOARD_THAT_ARE_STILL_LINKED_TO_YOUR_COMPONENT="The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component." COM_COMPONENTBUILDER_THE_BSB_CUT_SEQUENCE_FAILED_ON_THE_RETURNED_EXTERNAL_CODESTRING_AS_MORE_LINES_HAS_TO_BE_CUT_THEN_WAS_FOUND_IN_THE_CODESTRING_WE_HAVE_COMPLETELY_REMOVED_THE_CODE_PLEASE_CHECK_THIS_CODESTRING="The %s cut sequence failed on the returned external code/string as more lines has to be cut then was found in the code/string. We have completely removed the code. Please check this code/string!" COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The %s file could not be moved to %s path on %s server." COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The %s file could not be moved to %s server." COM_COMPONENTBUILDER_THE_BSB_IS_NOT_A_VALID_URLPATH="The %s is not a valid url/path!" COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The %s library\class is not available! This library\class should have been added to your libraries/phpseclib/vendor folder. Please contact your system administrator for more info!" COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING="The %s returned an invalid string!" +COM_COMPONENTBUILDER_THE_BSB_VALUE_FOR_THE_DYNAMIC_DASHBOARD_IS_INVALID="The %s value for the dynamic dashboard is invalid." COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been added for the first time. Please investigate to ensure the correct code/string was used! Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention! Do not ignore this warning as it will only show once." COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been changed since the last compilation. Please investigate to ensure the changes are safe! Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention! Do not ignore this warning as it will only show once." +COM_COMPONENTBUILDER_THE_FILE_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The file path: %s does not exist, and was not added!" +COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The folder path: %s does not exist, and was not added!" COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for %s could not be made. Please check your signature details!" COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for %s was not well formed, please check your signature details!" COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to %s has failed, please check that your details are correct!"