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] . "" . $ename . ">");
+ }
+ }
+ }
+ }
+
+ /**
+ * 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!"