From f8ac24737799f63a8358a967a4c0b1982cd98394 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 21 Aug 2022 19:21:03 +0200 Subject: [PATCH] Initial move of configuration to its own class and factory. #951 --- README.md | 6 +- admin/README.txt | 6 +- admin/helpers/compiler.php | 19 +- admin/helpers/compiler/a_Get.php | 520 +++++++++--------- admin/helpers/compiler/b_Structure.php | 37 +- admin/helpers/compiler/c_Fields.php | 41 +- admin/helpers/compiler/e_Interpretation.php | 186 +++---- admin/helpers/compiler/f_Infusion.php | 72 +-- admin/models/forms/power.xml | 4 +- admin/sql/install.mysql.utf8.sql | 2 +- componentbuilder.xml | 2 +- .../src/Componentbuilder/Compiler/Config.php | 178 ++++++ .../{ => Compiler}/index.html | 0 .../Extension/InstallScript.php | 8 +- .../Factory/Compiler/Config.php | 257 +++++++++ .../Factory/Compiler}/index.html | 0 .../VDM.Joomla/src/Componentbuilder/Line.php | 13 +- 17 files changed, 885 insertions(+), 466 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/{ => Compiler}/index.html (100%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php rename libraries/jcb_powers/VDM.Joomla/src/{Utilities => Componentbuilder/Factory/Compiler}/index.html (100%) diff --git a/README.md b/README.md index 2f5431f5c..680ab3df8 100644 --- a/README.md +++ b/README.md @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th August, 2022 ++ *Last Build*: 21st August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311846** ++ *Line count*: **312270** + *Field count*: **2002** -+ *File count*: **2055** ++ *File count*: **2057** + *Folder count*: **351** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 2f5431f5c..680ab3df8 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th August, 2022 ++ *Last Build*: 21st August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311846** ++ *Line count*: **312270** + *Field count*: **2002** -+ *File count*: **2055** ++ *File count*: **2057** + *Folder count*: **351** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 41aadbf30..e4760daf5 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -20,6 +20,7 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\MathHelper; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; // Use the component builder autoloader ComponentbuilderHelper::autoLoader(); @@ -183,7 +184,7 @@ class Compiler extends Infusion 'because more then %s% of the strings have been translated.', $this->percentageLanguageAdd ); - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { $whyAddedLang = JText::_( 'because the debugging mode is on. (debug line numbers)' @@ -214,12 +215,12 @@ class Compiler extends Infusion 'The SQL fix updates the #__assets table\'s column size on installation of the component and reverses it back to the Joomla default on uninstall of the component.' ); // set assets table rules column notice - if ($this->addAssetsTableFix) + if (Config::get('add_assets_table_fix')) { $this->app->enqueueMessage( JText::_('

Assets Table Notice

'), 'Notice' ); - $asset_table_fix_type = ($this->addAssetsTableFix == 2) + $asset_table_fix_type = (Config::get('add_assets_table_fix') == 2) ? 'intelligent' : 'sql'; $this->app->enqueueMessage( JText::sprintf( @@ -244,7 +245,7 @@ class Compiler extends Infusion ); } // set assets table name column warning if not set - if (!$this->addAssetsTableFix && $this->addAssetsTableNameFix) + if (!Config::get('add_assets_table_fix') && $this->addAssetsTableNameFix) { // only add if not already added if ($this->accessSize < 30) @@ -322,7 +323,7 @@ class Compiler extends Infusion // add the mismatching issues foreach ($mismatch as $string) { - $constant = $this->langPrefix . '_' + $constant = Config::get('lang_prefix') . '_' . StringHelper::safe($string, 'U'); $this->app->enqueueMessage( JText::sprintf( @@ -374,7 +375,7 @@ class Compiler extends Infusion */ private function setLine($nr) { - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { return ' [Compiler ' . $nr . ']'; } @@ -994,7 +995,7 @@ class Compiler extends Infusion // set the repo path $repoFullPath = $this->repoPath . '/com_' . $this->componentData->sales_name . '__joomla_' - . $this->joomlaVersion; + . Config::get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo $this->triggerEvent( 'jcb_ce_onBeforeUpdateRepo', @@ -1025,7 +1026,7 @@ class Compiler extends Infusion // set the repo path $repoFullPath = $this->repoPath . '/' . $module->folder_name . '__joomla_' - . $this->joomlaVersion; + . Config::get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo $this->triggerEvent( 'jcb_ce_onBeforeUpdateRepo', @@ -1062,7 +1063,7 @@ class Compiler extends Infusion // set the repo path $repoFullPath = $this->repoPath . '/' . $plugin->folder_name . '__joomla_' - . $this->joomlaVersion; + . Config::get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo $this->triggerEvent( 'jcb_ce_onBeforeUpdateRepo', diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index b2323aba4..fe7727f3d 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -27,6 +27,7 @@ use VDM\Joomla\Utilities\String\TypeHelper; use VDM\Joomla\Utilities\String\ClassfunctionHelper; use VDM\Joomla\Utilities\String\NamespaceHelper; use VDM\Joomla\Utilities\String\PluginHelper; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; /** * Get class as the main compilers class @@ -38,6 +39,7 @@ class Get * The Joomla Version * * @var string + * @deprecated 4.0 Use Config::get('version'); */ public $joomlaVersion; @@ -118,6 +120,7 @@ class Get * The Compiler Path * * @var object + * @deprecated 4.0 Use Config::get('compiler_path'); */ public $compilerPath; @@ -125,6 +128,7 @@ class Get * The JCB Powers Path * * @var object + * @deprecated 4.0 Use Config::get('jcb_powers_path'); */ public $jcbPowersPath; @@ -132,6 +136,7 @@ class Get * Switch to add assets table fix * * @var int + * @deprecated 4.0 Use Config::get('add_assets_table_fix'); */ public $addAssetsTableFix = 1; @@ -153,6 +158,7 @@ class Get * Switch to add custom code placeholders * * @var bool + * @deprecated 4.0 Use Config::get('add_placeholders'); */ public $addPlaceholders = false; @@ -160,6 +166,7 @@ class Get * Switch to remove line breaks from language strings * * @var bool + * @deprecated 4.0 Use Config::get('remove_line_breaks'); */ public $removeLineBreaks = false; @@ -188,6 +195,7 @@ class Get * The Switch to add Powers data * * @var boolean + * @deprecated 4.0 Use Config::get('add_power'); */ public $addPower; @@ -334,6 +342,7 @@ class Get * The line numbers Switch * * @var boolean + * @deprecated 4.0 Use Config::get('debug_line_nr'); */ public $debugLinenr = false; @@ -348,6 +357,7 @@ class Get * The Placholder Language prefix * * @var string + * @deprecated 4.0 Use Config::get('lang_prefix'); */ public $langPrefix; @@ -371,6 +381,7 @@ class Get * The Main Languages * * @var string + * @deprecated 4.0 Use Config::get('lang_tag'); */ public $langTag = 'en-GB'; @@ -427,13 +438,23 @@ class Get * The Component Code Name * * @var string + * @deprecated 4.0 Use Config::get('component_code_name'); */ public $componentCodeName; + /** + * The Component Context + * + * @var string + * @deprecated 4.0 Use Config::get('component_context'); + */ + public $componentContext; + /** * The Component Code Name Length * * @var int + * @deprecated 4.0 Use Config::get('component_code_name_length'); */ public $componentCodeNameLength; @@ -441,6 +462,7 @@ class Get * The Component ID * * @var int + * @deprecated 4.0 Use Config::get('component_id'); */ public $componentID; @@ -668,6 +690,7 @@ class Get * 2 = SimpleXMLElement * * @var int + * @deprecated 4.0 Use Config::get('field_builder_type'); */ public $fieldBuilderType; @@ -880,6 +903,7 @@ class Get * Is minify Enabled * * @var int + * @deprecated 4.0 Use Config::get('minify'); */ public $minify = 0; @@ -887,6 +911,7 @@ class Get * Is Tidy Enabled * * @var bool + * @deprecated 4.0 Use Config::get('tidy'); */ public $tidy = false; @@ -929,210 +954,156 @@ class Get */ public function __construct($config = array()) { - if (isset($config) && count($config)) + // we do not yet have this set as an option + $config['remove_line_breaks'] + = 2; // 2 is global (use the components value) + // load application + $this->app = JFactory::getApplication(); + // Set the params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // get active plugins + if (($plugins = $this->params->get('compiler_plugin', false)) + !== false) { - // we do not yet have this set as an option - $config['remove_line_breaks'] - = 2; // 2 is global (use the components value) - // load application - $this->app = JFactory::getApplication(); - // Set the params - $this->params = JComponentHelper::getParams('com_componentbuilder'); - // get active plugins - if (($plugins = $this->params->get('compiler_plugin', false)) - !== false) + foreach ($plugins as $plugin) { - foreach ($plugins as $plugin) + // get possible plugins + if (\JPluginHelper::isEnabled('extension', $plugin)) { - // get possible plugins - if (\JPluginHelper::isEnabled('extension', $plugin)) - { - // Import the appropriate plugin group. - \JPluginHelper::importPlugin('extension', $plugin); - // activate events - $this->active_plugins = true; - } + // Import the appropriate plugin group. + \JPluginHelper::importPlugin('extension', $plugin); + // activate events + $this->active_plugins = true; } } - // Trigger Event: jcb_ce_onBeforeGet - $this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, &$this)); - // set the Joomla version - $this->joomlaVersion = $config['version']; - // set the minfy switch of the JavaScript - $this->minify = (isset($config['minify']) && $config['minify'] != 2) - ? $config['minify'] : $this->params->get('minify', 0); - // set the global language - $this->langTag = $this->params->get('language', $this->langTag); - // also set the helper class langTag (for safeStrings) - ComponentbuilderHelper::$langTag = $this->langTag; - // setup the main language array - $this->languages['components'][$this->langTag] = array(); - // check if we have Tidy enabled - $this->tidy = extension_loaded('Tidy'); - // set the field type builder - $this->fieldBuilderType = $this->params->get( - 'compiler_field_builder_type', 2 - ); - // check the field builder type logic - if (!$this->tidy && $this->fieldBuilderType == 2) - { - // we do not have the tidy extension set fall back to StringManipulation - $this->fieldBuilderType = 1; - // load the sugestion to use string manipulation - $this->app->enqueueMessage( - JText::_('

Field Notice

'), 'Notice' - ); - $this->app->enqueueMessage( - JText::_( - 'Since you do not have Tidy extentsion setup on your system, we could not use the SimpleXMLElement class. We instead used string manipulation to build all your fields, this is a faster method, you must inspect the xml files in your component package to see if you are satisfied with the result.
You can make this method your default by opening the global options of JCB and under the Global tab set the Field Builder Type to string manipulation.' - ), 'Notice' - ); - } - // load the compiler path - $this->compilerPath = $this->params->get( - 'compiler_folder_path', - JPATH_COMPONENT_ADMINISTRATOR . '/compiler' - ); - // load the jcb powers path - $this->jcbPowersPath = $this->params->get( - 'jcb_powers_path', - 'libraries/jcb_powers'); - // set the component ID - $this->componentID = (int) $config['component']; - // set this components code name - if ($name_code = GetHelper::var( - 'joomla_component', $this->componentID, 'id', 'name_code' - )) - { - // set lang prefix - $this->langPrefix = 'COM_' . StringHelper::safe( - $name_code, 'U' - ); - // set component code name - $this->componentCodeName = StringHelper::safe( - $name_code - ); - // set component context - $this->componentContext = $this->componentCodeName . '.' - . $this->componentID; - // set the component name length - $this->componentCodeNameLength = strlen( - $this->componentCodeName - ); - // add assets table fix - $global = (int) $this->params->get( - 'assets_table_fix', 1 - ); - $this->addAssetsTableFix = (($add_assets_table_fix - = (int) GetHelper::var( - 'joomla_component', $this->componentID, 'id', - 'assets_table_fix' - )) == 3) ? $global : $add_assets_table_fix; - // set if language strings line breaks should be removed - $global = ((int) GetHelper::var( - 'joomla_component', $this->componentID, 'id', - 'remove_line_breaks' - ) == 1) ? true : false; - $this->removeLineBreaks = ((int) $config['remove_line_breaks'] - == 0) - ? false - : (((int) $config['remove_line_breaks'] == 1) ? true - : $global); - // set if placeholders should be added to customcode - $global = ((int) GetHelper::var( - 'joomla_component', $this->componentID, 'id', - 'add_placeholders' - ) == 1) ? true : false; - $this->addPlaceholders = ((int) $config['placeholders'] == 0) - ? false - : (((int) $config['placeholders'] == 1) ? true : $global); - // set if line numbers should be added to comments - $global = ((int) GetHelper::var( - 'joomla_component', $this->componentID, 'id', - 'debug_linenr' - ) == 1) ? true : false; - $this->debugLinenr = ((int) $config['debuglinenr'] == 0) ? false - : (((int) $config['debuglinenr'] == 1) ? true : $global); - // set if powers should be added to component (default is true) - $global = ((int) GetHelper::var( - 'joomla_component', $this->componentID, 'id', - 'add_powers' - ) == 1) ? true : false; - $this->addPower = (isset($config['powers']) && (int) $config['powers'] == 0) - ? false : ((isset($config['powers']) && (int) $config['powers'] == 1) ? true : $global); - // set the current user - $this->user = JFactory::getUser(); - // Get a db connection. - $this->db = JFactory::getDbo(); - // get global placeholders - $this->globalPlaceholders = $this->getGlobalPlaceholders(); - // check if this component is installed on the current website - if ($paths = $this->getLocalInstallPaths()) - { - // start Automatic import of custom code - $today = JFactory::getDate()->toSql(); - // get the custom code from installed files - $this->customCodeFactory($paths, $today); - } - // Trigger Event: jcb_ce_onBeforeGetComponentData - $this->triggerEvent( - 'jcb_ce_onBeforeGetComponentData', - array(&$this->componentContext, &$this) - ); - // get the component data - $this->componentData = $this->getComponentData(); - // Trigger Event: jcb_ce_onAfterGetComponentData - $this->triggerEvent( - 'jcb_ce_onAfterGetComponentData', - array(&$this->componentContext, &$this) - ); - // make sure we have a version - if (strpos($this->componentData->component_version, '.') - === false) - { - $this->componentData->component_version = '1.0.0'; - } - // update the version - if (!isset($this->componentData->old_component_version) - && (ArrayHelper::check($this->addSQL) - || ArrayHelper::check( - $this->updateSQL - ))) - { - // set the new version - $version = (array) explode( - '.', $this->componentData->component_version - ); - // get last key - end($version); - $key = key($version); - // just increment the last - $version[$key]++; - // set the old version - $this->componentData->old_component_version - = $this->componentData->component_version; - // set the new version, and set update switch - $this->componentData->component_version = implode( - '.', $version - ); - } - // get powers *+*+*+*+*+*+*+*PRO - $this->getPowers($this->linkedPowers); - // set the percentage when a language can be added - $this->percentageLanguageAdd = (int) $this->params->get( - 'percentagelanguageadd', 50 - ); - - // Trigger Event: jcb_ce_onBeforeGet - $this->triggerEvent( - 'jcb_ce_onAfterGet', array(&$this->componentContext, &$this) - ); - - return true; - } } + // Trigger Event: jcb_ce_onBeforeGet + $this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, &$this)); + // load the global config + Config::init($config); + // set the Joomla version @deprecated + $this->joomlaVersion = Config::get('version', 3); + // set the minfy switch of the JavaScript @deprecated + $this->minify = Config::get('minify', 0); + // set the global language @deprecated @deprecated + $this->langTag = Config::get('lang_tag', 'en-GB'); + // also set the helper class langTag (for safeStrings) + ComponentbuilderHelper::$langTag = Config::get('lang_tag', 'en-GB'); + // setup the main language array + $this->languages['components'][Config::get('lang_tag', 'en-GB')] = array(); + // check if we have Tidy enabled @deprecated + $this->tidy = Config::get('tidy', false); + // set the field type builder @deprecated + $this->fieldBuilderType = Config::get('field_builder_type', 2); + // check the field builder type logic + if (!Config::get('tidy', false) && Config::get('field_builder_type', 2) == 2) + { + // we do not have the tidy extension set fall back to StringManipulation + $this->fieldBuilderType = 1; + // load the sugestion to use string manipulation + $this->app->enqueueMessage( + JText::_('

Field Notice

'), 'Notice' + ); + $this->app->enqueueMessage( + JText::_( + 'Since you do not have Tidy extentsion setup on your system, we could not use the SimpleXMLElement class. We instead used string manipulation to build all your fields, this is a faster method, you must inspect the xml files in your component package to see if you are satisfied with the result.
You can make this method your default by opening the global options of JCB and under the Global tab set the Field Builder Type to string manipulation.' + ), 'Notice' + ); + } + Config::set('field_builder_type', $this->fieldBuilderType); + // load the compiler path @deprecated + $this->compilerPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler'); + // load the jcb powers path @deprecated + $this->jcbPowersPath = Config::get('jcb_powers_path', 'libraries/jcb_powers'); + // set the component ID @deprecated + $this->componentID = Config::get('component_id'); + // set lang prefix @deprecated + $this->langPrefix = Config::get('lang_prefix'); + // set component code name @deprecated + $this->componentCodeName = Config::get('component_code_name'); + // set component context @deprecated + $this->componentContext = Config::get('component_context'); + // set the component name length @deprecated + $this->componentCodeNameLength = Config::get('component_code_name_length'); + // add assets table fix @deprecated + $this->addAssetsTableFix = Config::get('add_assets_table_fix'); + // set if language strings line breaks should be removed @deprecated + $this->removeLineBreaks = Config::get('remove_line_breaks'); + // set if placeholders should be added to customcode @deprecated + $this->addPlaceholders = Config::get('add_placeholders', false); + // set if line numbers should be added to comments @deprecated + $this->debugLinenr = Config::get('debug_line_nr', false); + // set if powers should be added to component (default is true) @deprecated + $this->addPower = Config::get('add_power', true); + // set the current user + $this->user = JFactory::getUser(); + // Get a db connection. + $this->db = JFactory::getDbo(); + // get global placeholders + $this->globalPlaceholders = $this->getGlobalPlaceholders(); + // check if this component is installed on the current website + if ($paths = $this->getLocalInstallPaths()) + { + // start Automatic import of custom code + $today = JFactory::getDate()->toSql(); + // get the custom code from installed files + $this->customCodeFactory($paths, $today); + } + // Trigger Event: jcb_ce_onBeforeGetComponentData + $this->triggerEvent( + 'jcb_ce_onBeforeGetComponentData', + array(&$this->componentContext, &$this) + ); + // get the component data + $this->componentData = $this->getComponentData(); + // Trigger Event: jcb_ce_onAfterGetComponentData + $this->triggerEvent( + 'jcb_ce_onAfterGetComponentData', + array(&$this->componentContext, &$this) + ); + // make sure we have a version + if (strpos($this->componentData->component_version, '.') + === false) + { + $this->componentData->component_version = '1.0.0'; + } + // update the version + if (!isset($this->componentData->old_component_version) + && (ArrayHelper::check($this->addSQL) + || ArrayHelper::check( + $this->updateSQL + ))) + { + // set the new version + $version = (array) explode( + '.', $this->componentData->component_version + ); + // get last key + end($version); + $key = key($version); + // just increment the last + $version[$key]++; + // set the old version + $this->componentData->old_component_version + = $this->componentData->component_version; + // set the new version, and set update switch + $this->componentData->component_version = implode( + '.', $version + ); + } + // get powers *+*+*+*+*+*+*+*PRO + $this->getPowers($this->linkedPowers); + // set the percentage when a language can be added + $this->percentageLanguageAdd = (int) $this->params->get( + 'percentagelanguageadd', 50 + ); - return false; + // Trigger Event: jcb_ce_onBeforeGet + $this->triggerEvent( + 'jcb_ce_onAfterGet', array(&$this->componentContext, &$this) + ); + + return true; } /** @@ -1159,7 +1130,7 @@ class Get */ private function setLine($nr) { - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { return ' [Get ' . $nr . ']'; } @@ -1231,14 +1202,14 @@ class Get } // set component place holders $bucket[$this->hhh . 'component' . $this->hhh] - = $this->componentCodeName; + = Config::get('component_code_name'); $bucket[$this->hhh . 'Component' . $this->hhh] = StringHelper::safe( - $this->componentCodeName, 'F' + Config::get('component_code_name'), 'F' ); $bucket[$this->hhh . 'COMPONENT' . $this->hhh] = StringHelper::safe( - $this->componentCodeName, 'U' + Config::get('component_code_name'), 'U' ); $bucket[$this->bbb . 'component' . $this->ddd] = $bucket[$this->hhh . 'component' . $this->hhh]; @@ -1246,12 +1217,12 @@ class Get . 'Component' . $this->hhh]; $bucket[$this->bbb . 'COMPONENT' . $this->ddd] = $bucket[$this->hhh . 'COMPONENT' . $this->hhh]; - $bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh] = $this->langPrefix; + $bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh] = Config::get('lang_prefix'); $bucket[$this->bbb . 'LANG_PREFIX' . $this->ddd] = $bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh]; // get the current components overides if (($_placeholders = GetHelper::var( - 'component_placeholders', $this->componentID, + 'component_placeholders', Config::get('component_id'), 'joomla_component', 'addplaceholders' )) !== false && JsonHelper::check($_placeholders)) @@ -1336,7 +1307,7 @@ class Get ); } $query->where( - $this->db->quoteName('a.id') . ' = ' . (int) $this->componentID + $this->db->quoteName('a.id') . ' = ' . (int) Config::get('component_id') ); // Trigger Event: jcb_ce_onBeforeQueryComponentData @@ -1365,36 +1336,36 @@ class Get 'val' => (int) $component->addadmin_views_id, 'key' => 'id'), 'addconfig' => array('table' => 'component_config', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'addcustom_admin_views' => array('table' => 'component_custom_admin_views', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'addcustommenus' => array('table' => 'component_custom_admin_menus', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'addfiles' => array('table' => 'component_files_folders', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'addfolders' => array('table' => 'component_files_folders', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'addsite_views' => array('table' => 'component_site_views', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'dashboard_tab' => array('table' => 'component_dashboard', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'sql_tweak' => array('table' => 'component_mysql_tweaks', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component'), 'version_update' => array('table' => 'component_updates', - 'val' => (int) $this->componentID, + 'val' => (int) Config::get('component_id'), 'key' => 'joomla_component') ), 'table' => 'joomla_component', 'key' => 'id', - 'val' => (int) $this->componentID + 'val' => (int) Config::get('component_id') ); // repeatable fields to update $searchRepeatables = array( @@ -1793,7 +1764,7 @@ class Get 'component_admin_views', $component->addadmin_views_id ); $old_component = $this->getHistoryWatch( - 'joomla_component', $this->componentID + 'joomla_component', Config::get('component_id') ); if ($old_component || $old_admin_views) { @@ -1834,7 +1805,7 @@ class Get // set GUI mapper $guiMapper = array('table' => 'joomla_component', - 'id' => (int) $this->componentID, + 'id' => (int) Config::get('component_id'), 'field' => 'javascript', 'type' => 'js'); // add_javascript @@ -2044,11 +2015,11 @@ class Get // bom if (StringHelper::check($component->bom)) { - $this->bomPath = $this->compilerPath . '/' . $component->bom; + $this->bomPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $component->bom; } else { - $this->bomPath = $this->compilerPath . '/default.txt'; + $this->bomPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/default.txt'; } unset($component->bom); // README @@ -2228,10 +2199,10 @@ class Get { if ($addPrefix && !isset( - $this->langContent[$target][$this->langPrefix . '_' . $language] + $this->langContent[$target][Config::get('lang_prefix') . '_' . $language] )) { - $this->langContent[$target][$this->langPrefix . '_' . $language] + $this->langContent[$target][Config::get('lang_prefix') . '_' . $language] = $this->fixLangString($string); } elseif (!isset($this->langContent[$target][$language])) @@ -2252,7 +2223,7 @@ class Get */ public function fixLangString(&$string) { - if ($this->removeLineBreaks) + if (Config::get('remove_line_breaks')) { return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string)); } @@ -2353,7 +2324,7 @@ class Get } // check the length of the view name (+5 for com_ and _) - $name_length = $this->componentCodeNameLength + strlen( + $name_length = Config::get('component_code_name_length') + strlen( $view->name_single_code ) + 5; // when the name is larger then 49 we need to add the assets table name fix @@ -2475,7 +2446,7 @@ class Get $tab['name'] )) ? $tab['name'] : 'Tab'; // set lang - $tab['lang'] = $this->langPrefix . '_' + $tab['lang'] = Config::get('lang_prefix') . '_' . StringHelper::safe( $tab['view'], 'U' ) . '_' . StringHelper::safe( @@ -3013,7 +2984,7 @@ class Get // confirm it should really make the over ride if ('default' !== $check_column_name) { - $column_name_lang = $this->langPrefix . '_' + $column_name_lang = Config::get('lang_prefix') . '_' . StringHelper::safe( $view->name_list_code, 'U' ) . '_' @@ -5843,7 +5814,7 @@ class Get // remove watch if (isset($version_note['component']) && ($key = array_search( - $this->componentID, $version_note['component'] + Config::get('component_id'), $version_note['component'] )) !== false) { // last version that was used to build/compile @@ -5859,9 +5830,9 @@ class Get break; case 1: // add watch - if (!in_array($this->componentID, $version_note['component'])) + if (!in_array(Config::get('component_id'), $version_note['component'])) { - $version_note['component'][] = $this->componentID; + $version_note['component'][] = Config::get('component_id'); } else { @@ -6713,7 +6684,7 @@ class Get return false; } // build lang key - $keyLang = $this->langPrefix . '_' . StringHelper::safe( + $keyLang = Config::get('lang_prefix') . '_' . StringHelper::safe( $string, 'U' ); // set the language string @@ -6751,7 +6722,7 @@ class Get elseif ('view' === $type) { $view = $this->getViewTableName($asset); - $table = '#__' . $this->componentCodeName . '_' . $view; + $table = '#__' . Config::get('component_code_name') . '_' . $view; $queryName = $view; } // just get all values from table if * is found @@ -8027,7 +7998,7 @@ class Get $counterUpdate = 0; $today = JFactory::getDate()->toSql(); foreach ( - $this->languages[$target][$this->langTag] as $area => $placeholders + $this->languages[$target][Config::get('lang_tag', 'en-GB')] as $area => $placeholders ) { foreach ($placeholders as $placeholder => $string) @@ -8638,7 +8609,7 @@ class Get */ public function getPower($guid, $build = 0) { - if (($this->addPower || $build == 1) && $this->setPower($guid)) + if ((Config::get('add_power', true) || $build == 1) && $this->setPower($guid)) { return $this->powers[$guid]; } @@ -8799,7 +8770,7 @@ class Get }, $src_array)); } // now we set the paths - $power->path_jcb = $this->jcbPowersPath; + $power->path_jcb = Config::get('jcb_powers_path', 'libraries/jcb_powers'); $power->path_parent = $power->path_jcb . '/' . $prefix_folder; $power->path = $power->path_parent . '/src' . $sub_folder; } @@ -8815,7 +8786,14 @@ class Get { $use = array_values(array_map(function ($u) use(&$as) { // track the AS options - $as[$u['use']] = (string) $u['as']; + if (empty($u['as'])) + { + $as[$u['use']] = 'default'; + } + else + { + $as[$u['use']] = (string) $u['as']; + } // return the guid return $u['use']; }, $power->use_selection)); @@ -9056,7 +9034,7 @@ class Get protected function getModuleIDs() { if (($addjoomla_modules = GetHelper::var( - 'component_modules', $this->componentID, 'joomla_component', + 'component_modules', Config::get('component_id'), 'joomla_component', 'addjoomla_modules' )) !== false) { @@ -9156,7 +9134,7 @@ class Get // tweak system to set stuff to the module domain $_backup_target = $this->target; $_backup_lang = $this->lang; - $_backup_langPrefix = $this->langPrefix; + $_backup_langPrefix = Config::get('lang_prefix'); // set some keys $module->target_type = 'M0dU|3'; $module->key = $module->id . '_' . $module->target_type; @@ -9178,7 +9156,6 @@ class Get // default is site area $module->target_client = 'site'; } - unset($module->target); // set GUI mapper $guiMapper = array('table' => 'joomla_module', 'id' => (int) $id, 'type' => 'php'); @@ -9191,14 +9168,17 @@ class Get = ClassfunctionHelper::safe( $module->name ); + // alias of code name + $module->class_name = $module->code_name; // set official name $module->official_name = StringHelper::safe( $module->name, 'W' ); // set langPrefix $this->langPrefix = 'MOD_' . strtoupper($module->code_name); + Config::set('lang_prefix', $this->langPrefix); // set lang prefix - $module->lang_prefix = $this->langPrefix; + $module->lang_prefix = Config::get('lang_prefix'); // set module class name $module->class_helper_name = 'Mod' . ucfirst($module->code_name) . 'Helper'; @@ -9213,14 +9193,14 @@ class Get // set the zip name $module->zip_name = $module->folder_name . '_v' . str_replace( '.', '_', $module->module_version - ) . '__J' . $this->joomlaVersion; + ) . '__J' . Config::get('version', 3); // set module file name $module->file_name = $module->folder_name; // set module context $module->context = $module->file_name . '.' . $module->id; // set official_name lang strings $this->setLangContent( - $module->key, $this->langPrefix, $module->official_name + $module->key, Config::get('lang_prefix'), $module->official_name ); // set some placeholder for this module $this->placeholders[$this->bbb . 'Module_name' . $this->ddd] @@ -9860,6 +9840,7 @@ class Get $this->target = $_backup_target; $this->lang = $_backup_lang; $this->langPrefix = $_backup_langPrefix; + Config::set('lang_prefix', $_backup_langPrefix); unset( $this->placeholders[$this->bbb . 'Module_name' . $this->ddd] @@ -9894,7 +9875,7 @@ class Get { $xml = ''; $xml .= PHP_EOL . ''; $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix . ''; @@ -9969,7 +9950,7 @@ class Get protected function getPluginIDs() { if (($addjoomla_plugins = GetHelper::var( - 'component_plugins', $this->componentID, 'joomla_component', + 'component_plugins', Config::get('component_id'), 'joomla_component', 'addjoomla_plugins' )) !== false) { @@ -10159,7 +10140,7 @@ class Get // tweak system to set stuff to the plugin domain $_backup_target = $this->target; $_backup_lang = $this->lang; - $_backup_langPrefix = $this->langPrefix; + $_backup_langPrefix = Config::get('lang_prefix'); // set some keys $plugin->target_type = 'P|uG!n'; $plugin->key = $plugin->id . '_' . $plugin->target_type; @@ -10193,8 +10174,9 @@ class Get $plugin->code_name, $plugin->group ); + Config::set('lang_prefix', $this->langPrefix); // set lang prefix - $plugin->lang_prefix = $this->langPrefix; + $plugin->lang_prefix = Config::get('lang_prefix'); // set plugin class name $plugin->class_name = PluginHelper::safeClassName( @@ -10216,14 +10198,14 @@ class Get // set the zip name $plugin->zip_name = $plugin->folder_name . '_v' . str_replace( '.', '_', $plugin->plugin_version - ) . '__J' . $this->joomlaVersion; + ) . '__J' . Config::get('version', 3); // set plugin file name $plugin->file_name = strtolower($plugin->code_name); // set plugin context $plugin->context = $plugin->folder_name . '.' . $plugin->id; // set official_name lang strings $this->setLangContent( - $plugin->key, $this->langPrefix, $plugin->official_name + $plugin->key, Config::get('lang_prefix'), $plugin->official_name ); // set some placeholder for this plugin $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] @@ -10764,6 +10746,7 @@ class Get $this->target = $_backup_target; $this->lang = $_backup_lang; $this->langPrefix = $_backup_langPrefix; + Config::set('lang_prefix', $_backup_langPrefix); unset( $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] @@ -10818,7 +10801,7 @@ class Get { $xml = ''; $xml .= PHP_EOL . ''; $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix . ''; @@ -10971,16 +10954,16 @@ class Get $this->globalPlaceholders ); $placeholders[StringHelper::safe( - $this->componentCodeName, 'F' + Config::get('component_code_name'), 'F' ) . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::'; $placeholders['COM_' . StringHelper::safe( - $this->componentCodeName, 'U' + Config::get('component_code_name'), 'U' )] = 'COM_' . $this->bbb . 'COMPONENT' . $this->ddd; - $placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb + $placeholders['com_' . Config::get('component_code_name')] = 'com_' . $this->bbb . 'component' . $this->ddd; // putt the last first $placeholders = array_reverse($placeholders, true); @@ -11326,7 +11309,7 @@ class Get ); // 'comment_type' $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote( - (int) $this->componentID + (int) Config::get('component_id') ); // 'component' $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote( @@ -11383,7 +11366,7 @@ class Get . $this->db->quote($commentType); $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('component') . ' = ' - . $this->db->quote($this->componentID); + . $this->db->quote(Config::get('component_id')); $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('from_line') . ' = ' . $this->db->quote($lineNumber); @@ -11557,7 +11540,7 @@ class Get { if (StringHelper::check($string)) { - if ($this->addPlaceholders + if (Config::get('add_placeholders', false) && $this->canAddGuiCodePlaceholder( $string ) @@ -11893,15 +11876,16 @@ class Get if (strpos($target, 'module') !== false) { // backup lang prefix - $_tmp_lang_prefix = $this->langPrefix; + $_tmp_lang_prefix = Config::get('lang_prefix'); // set the new lang prefix $this->langPrefix = strtoupper( str_replace('module', 'mod', $target) ); + Config::set('lang_prefix', $this->langPrefix); // now set the lang - if (isset($this->langKeys[$this->langPrefix])) + if (isset($this->langKeys[Config::get('lang_prefix')])) { - $this->lang = $this->langKeys[$this->langPrefix]; + $this->lang = $this->langKeys[Config::get('lang_prefix')]; } else { @@ -11911,15 +11895,16 @@ class Get elseif (strpos($target, 'plugin') !== false) { // backup lang prefix - $_tmp_lang_prefix = $this->langPrefix; + $_tmp_lang_prefix = Config::get('lang_prefix'); // set the new lang prefix $this->langPrefix = strtoupper( str_replace('plugin', 'plg', $target) ); + Config::set('lang_prefix', $this->langPrefix); // now set the lang - if (isset($this->langKeys[$this->langPrefix])) + if (isset($this->langKeys[Config::get('lang_prefix')])) { - $this->lang = $this->langKeys[$this->langPrefix]; + $this->lang = $this->langKeys[Config::get('lang_prefix')]; } else { @@ -11956,7 +11941,7 @@ class Get continue; } // build lang key - $keyLang = $this->langPrefix . '_' . $_keyLang; + $keyLang = Config::get('lang_prefix') . '_' . $_keyLang; // set lang content string $this->setLangContent($this->lang, $keyLang, $lang); // reverse the placeholders @@ -11979,6 +11964,7 @@ class Get if (isset($_tmp_lang_prefix)) { $this->langPrefix = $_tmp_lang_prefix; + Config::set('lang_prefix', $_tmp_lang_prefix); } } @@ -12072,7 +12058,7 @@ class Get { case 11: //***[REPLACED$$$$]***//**1**/ - if ($this->addPlaceholders === true) + if (Config::get('add_placeholders', false) === true) { return array( 'start' => '/***[REPLACED$$$$]***//**' . $id . '**/', @@ -12087,7 +12073,7 @@ class Get break; case 12: //***[INSERTED$$$$]***//**1**/ - if ($this->addPlaceholders === true) + if (Config::get('add_placeholders', false) === true) { return array( 'start' => '/***[INSERTED$$$$]***//**' . $id . '**/', @@ -12102,7 +12088,7 @@ class Get break; case 21: // - if ($this->addPlaceholders === true) + if (Config::get('add_placeholders', false) === true) { return array( 'start' => '', @@ -12117,7 +12103,7 @@ class Get break; case 22: // - if ($this->addPlaceholders === true) + if (Config::get('add_placeholders', false) === true) { return array( 'start' => '', @@ -12152,15 +12138,15 @@ class Get $localPaths = array(); // admin path $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' - . $this->componentCodeName; + . Config::get('component_code_name'); // site path $localPaths['site'] = JPATH_ROOT . '/components/com_' - . $this->componentCodeName; + . Config::get('component_code_name'); // media path $localPaths['media'] = JPATH_ROOT . '/media/com_' - . $this->componentCodeName; + . Config::get('component_code_name'); // power path - $localPaths['power'] = JPATH_ROOT . '/' . $this->jcbPowersPath; + $localPaths['power'] = JPATH_ROOT . '/' . Config::get('jcb_powers_path', 'libraries/jcb_powers'); // lets also go over the REPOS (TODO) // Painfull but we need to folder paths for the linked modules if (($module_ids = $this->getModuleIDs()) !== false) diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 5d4a2b0fa..6c9e1f0ac 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -20,6 +20,7 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; /** @@ -403,22 +404,22 @@ class Structure extends Get // run global updater ComponentbuilderHelper::runGlobalUpdater(); // set the template path - $this->templatePath = $this->compilerPath . '/joomla_' - . $this->joomlaVersions[$this->joomlaVersion]['folder_key']; + $this->templatePath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_' + . $this->joomlaVersions[Config::get('version', 3)]['folder_key']; // set some default names $this->componentSalesName = 'com_' . $this->componentData->sales_name . '__J' - . $this->joomlaVersion; + . Config::get('version', 3); $this->componentBackupName = 'com_' . $this->componentData->sales_name . '_v' . str_replace( '.', '_', $this->componentData->component_version - ) . '__J' . $this->joomlaVersion; + ) . '__J' . Config::get('version', 3); $this->componentFolderName = 'com_' . $this->componentData->name_code . '_v' . str_replace( '.', '_', $this->componentData->component_version - ) . '__J' . $this->joomlaVersion; + ) . '__J' . Config::get('version', 3); // set component folder path - $this->componentPath = $this->compilerPath . '/' + $this->componentPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $this->componentFolderName; // set the template path for custom $this->templatePathCustom = $this->params->get( @@ -475,7 +476,7 @@ class Structure extends Get */ private function setLine($nr) { - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { return ' [Structure ' . $nr . ']'; } @@ -618,7 +619,7 @@ class Structure extends Get )) { // module path - $module->folder_path = $this->compilerPath . '/' + $module->folder_path = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $module->folder_name; // set the module paths $this->dynamicPaths[$module->key] = $module->folder_path; @@ -920,11 +921,11 @@ class Structure extends Get $xml .= PHP_EOL . '_t(1) . 'addrulepath="/administrator/components/com_' - . $this->componentCodeName + . Config::get('component_code_name') . '/models/rules"'; $xml .= PHP_EOL . $this->_t(1) . 'addfieldpath="/administrator/components/com_' - . $this->componentCodeName + . Config::get('component_code_name') . '/models/fields"'; $xml .= PHP_EOL . '>'; } @@ -1095,7 +1096,7 @@ class Structure extends Get $this->createFolder($module->folder_path . '/language'); // also create the lang tag folder $this->createFolder( - $module->folder_path . '/language/' . $this->langTag + $module->folder_path . '/language/' . Config::get('lang_tag', 'en-GB') ); // check if this lib has files if (isset($module->files) @@ -1199,7 +1200,7 @@ class Structure extends Get )) { // plugin path - $plugin->folder_path = $this->compilerPath . '/' + $plugin->folder_path = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $plugin->folder_name; // set the plugin paths $this->dynamicPaths[$plugin->key] = $plugin->folder_path; @@ -1300,7 +1301,7 @@ class Structure extends Get $xml = ''; $xml .= PHP_EOL . ''; // search if we must add the component path $add_component_path = false; @@ -1329,11 +1330,11 @@ class Structure extends Get $xml .= PHP_EOL . '_t(1) . 'addrulepath="/administrator/components/com_' - . $this->componentCodeName + . Config::get('component_code_name') . '/models/rules"'; $xml .= PHP_EOL . $this->_t(1) . 'addfieldpath="/administrator/components/com_' - . $this->componentCodeName + . Config::get('component_code_name') . '/models/fields"'; $xml .= PHP_EOL . '>'; } @@ -1486,7 +1487,7 @@ class Structure extends Get $this->createFolder($plugin->folder_path . '/language'); // also creat the lang tag folder path $this->createFolder( - $plugin->folder_path . '/language/' . $this->langTag + $plugin->folder_path . '/language/' . Config::get('lang_tag', 'en-GB') ); // check if this lib has files if (isset($plugin->files) @@ -2071,7 +2072,7 @@ class Structure extends Get $this->joomlaVersionData->move->static )) { - $codeName = $this->componentCodeName; + $codeName = Config::get('component_code_name'); // TODO needs more looking at this must be dynamic actually $this->notNew[] = 'LICENSE.txt'; // do license check @@ -2879,7 +2880,7 @@ class Structure extends Get private function setJoomlaVersionData() { // option to load other settings - $custom_settings = $this->templatePath . '/settings_' . $this->componentCodeName . '.json'; + $custom_settings = $this->templatePath . '/settings_' . Config::get('component_code_name') . '.json'; // set the version data if (File::exists($custom_settings)) { diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 3a4787e77..88ab4163b 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -18,6 +18,7 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; /** * Compiler class @@ -378,7 +379,7 @@ class Fields extends Structure */ private function setLine($nr) { - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { return ' [Fields ' . $nr . ']'; } @@ -415,9 +416,9 @@ class Fields extends Structure $this->accessBuilder[$nameSingleCode] = $nameListCode; } // main lang prefix - $langView = $this->langPrefix . '_' + $langView = Config::get('lang_prefix') . '_' . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; - $langViews = $this->langPrefix . '_' + $langViews = Config::get('lang_prefix') . '_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; // set default lang $this->setLangContent( @@ -570,7 +571,7 @@ class Fields extends Structure . $view['settings']->name_single . " to customise the alias." ); // check what type of field builder to use - if ($this->fieldBuilderType == 1) + if (Config::get('field_builder_type', 2) == 1) { // build field set using string manipulation return $this->stringFieldSet( @@ -1586,7 +1587,7 @@ class Fields extends Structure &$nameSingleCode, &$nameListCode, &$placeholders, &$dbkey, $build ) { // set default return - if ($this->fieldBuilderType == 1) + if (Config::get('field_builder_type', 2) == 1) { // string manipulation $dynamicField = ''; @@ -1831,7 +1832,7 @@ class Fields extends Structure ) { // check the field builder type $xmlField = ''; - if ($this->fieldBuilderType == 1) + if (Config::get('field_builder_type', 2) == 1) { // string manipulation $xmlField = $this->setDynamicField( @@ -1891,7 +1892,7 @@ class Fields extends Structure // count the dynamic fields created $this->fieldCount++; // check what type of field builder to use - if ($this->fieldBuilderType == 1) + if (Config::get('field_builder_type', 2) == 1) { // build field set using string manipulation return $this->stringSetField( @@ -4962,7 +4963,7 @@ class Fields extends Structure // if they left out the extension for some reason if (!StringHelper::check($_extension)) { - $_extension = 'com_' . $this->componentCodeName . '.' + $_extension = 'com_' . Config::get('component_code_name') . '.' . $otherView; } // check the context (does our target match) @@ -5168,7 +5169,7 @@ class Fields extends Structure = $options; } // main lang filter prefix - $lang_filter_ = $this->langPrefix . '_FILTER_'; + $lang_filter_ = Config::get('lang_prefix') . '_FILTER_'; // build the sort values if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1) && ($listSwitch || $listJoin) @@ -5359,10 +5360,10 @@ class Fields extends Structure $data['custom']['component'] )) ? StringHelper::safe( $data['custom']['component'] - ) : 'com_' . $this->componentCodeName, + ) : 'com_' . Config::get('component_code_name'), // set the generic values $this->bbb . 'component' - . $this->ddd => $this->componentCodeName, + . $this->ddd => Config::get('component_code_name'), $this->bbb . 'Component' . $this->ddd => $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], @@ -5622,7 +5623,7 @@ class Fields extends Structure // temp holder for name $tempName = $data['custom']['label'] . ' Group'; // set lang - $groupLangName = $this->langPrefix . '_' + $groupLangName = Config::get('lang_prefix') . '_' . FieldHelper::safe( $tempName, true ); @@ -5751,14 +5752,14 @@ class Fields extends Structure $target, 'filter' ); // the search language string - $lang_search = $this->langPrefix . '_FILTER_SEARCH'; + $lang_search = Config::get('lang_prefix') . '_FILTER_SEARCH'; // and to translation $this->setLangContent( $this->lang, $lang_search, 'Search' . StringHelper::safe($nameListCode, 'w') ); // the search description language string - $lang_search_desc = $this->langPrefix . '_FILTER_SEARCH_' + $lang_search_desc = Config::get('lang_prefix') . '_FILTER_SEARCH_' . strtoupper($nameListCode); // and to translation $this->setLangContent( @@ -5784,13 +5785,13 @@ class Fields extends Structure if (!isset($this->fieldsNames[$nameSingleCode]['published'])) { // the published language string - $lang_published = $this->langPrefix . '_FILTER_PUBLISHED'; + $lang_published = Config::get('lang_prefix') . '_FILTER_PUBLISHED'; // and to translation $this->setLangContent( $this->lang, $lang_published, 'Status' ); // the published description language string - $lang_published_desc = $this->langPrefix . '_FILTER_PUBLISHED_' + $lang_published_desc = Config::get('lang_prefix') . '_FILTER_PUBLISHED_' . strtoupper($nameListCode); // and to translation $this->setLangContent( @@ -6134,7 +6135,7 @@ class Fields extends Structure && StringHelper::check($fieldData['views'])) { // set local component - $local_component = "com_" . $this->componentCodeName; + $local_component = "com_" . Config::get('component_code_name'); // check that the component value is set if (!isset($fieldData['component']) || !StringHelper::check( @@ -6316,7 +6317,7 @@ class Fields extends Structure . " build Create button"; $addButton[] = $this->_t(4) . "\$button[] = 'langPrefix + . ":sprintf('" . Config::get('lang_prefix') . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; $addButton[] = $this->_t(5) . "href=\"index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['view'] @@ -6352,7 +6353,7 @@ class Fields extends Structure . " build edit button"; $addButton[] = $this->_t(4) . "\$button[] = 'langPrefix + . ":sprintf('" . Config::get('lang_prefix') . "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; $addButton[] = $this->_t(5) . "';"; @@ -6443,7 +6444,7 @@ class Fields extends Structure $dom->getElementsByTagName($nodename)->item(0) ); // make sure Tidy is enabled - if ($this->tidy) + if (Config::get('tidy', false)) { $tidy = new Tidy(); $tidy->parseString( diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 95ba6ef24..8c3f378ff 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -21,6 +21,7 @@ use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\MathHelper; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; /** * Compiler class @@ -265,7 +266,7 @@ class Interpretation extends Fields */ private function setLine($nr) { - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { return ' [Interpretation ' . $nr . ']'; } @@ -282,7 +283,7 @@ class Interpretation extends Fields && $this->componentData->add_email_helper) { // set email helper in place with component name - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; $target = array('admin' => 'emailer'); @@ -455,7 +456,7 @@ class Interpretation extends Fields $bool[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params"; $bool[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" - . $this->componentCodeName . "', true);"; + . Config::get('component_code_name') . "', true);"; $bool[] = $this->_t(2) . "\$whmcs_key = \$params->get('whmcs_key', null);"; $bool[] = $this->_t(2) . "if (\$whmcs_key)"; @@ -464,7 +465,7 @@ class Interpretation extends Fields . " load the file"; $bool[] = $this->_t(3) . "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_" - . $this->componentCodeName . "');"; + . Config::get('component_code_name') . "');"; $bool[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);"; $bool[] = $this->_t(3) . "\$this->" . $globalbool . " = \$the->_is;"; $bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";"; @@ -495,7 +496,7 @@ class Interpretation extends Fields . " Get the global params"; $helper[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" - . $this->componentCodeName . "', true);"; + . Config::get('component_code_name') . "', true);"; $helper[] = $this->_t(2) . "\$whmcs_key = \$params->get('whmcs_key', null);"; $helper[] = $this->_t(2) . "if (\$whmcs_key)"; @@ -504,7 +505,7 @@ class Interpretation extends Fields . " load the file"; $helper[] = $this->_t(3) . "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_" - . $this->componentCodeName . "');"; + . Config::get('component_code_name') . "');"; $helper[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);"; $helper[] = $this->_t(3) . "return \$the->_is;"; $helper[] = $this->_t(2) . "}"; @@ -884,7 +885,7 @@ class Interpretation extends Fields = PHP_EOL . $this->_t(3) . "whmcs.php"; } // get component name - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); // set the getCryptKey function to the helper class $function = array(); // start building the getCryptKey function/class method @@ -1191,7 +1192,7 @@ class Interpretation extends Fields $updateServer[] = PHP_EOL . $this->_t(1) . ""; $updateServer[] = $this->_t(2) . '' . $this->componentData->update_server_url . ''; @@ -1220,14 +1221,14 @@ class Interpretation extends Fields } // update the joomla component table $newJ = array(); - $newJ['id'] = (int) $this->componentID; + $newJ['id'] = (int) Config::get('component_id'); $newJ['component_version'] = $this->componentData->component_version; // update the component with the new dynamic SQL $modelJ = ComponentbuilderHelper::getModel('joomla_component'); $modelJ->save($newJ); // <-- to insure the history is also updated // reset the watch here - $this->getHistoryWatch('joomla_component', $this->componentID); + $this->getHistoryWatch('joomla_component', Config::get('component_id')); // update the component update table $newU = array(); @@ -1238,7 +1239,7 @@ class Interpretation extends Fields } else { - $newU['joomla_component'] = (int) $this->componentID; + $newU['joomla_component'] = (int) Config::get('component_id'); } $newU['version_update'] = json_encode($buket); // update the component with the new dynamic SQL @@ -1378,7 +1379,7 @@ class Interpretation extends Fields && $this->componentData->update_server_target != 3) { // we set the defaults - $u_element = 'com_' . $this->componentCodeName; + $u_element = 'com_' . Config::get('component_code_name'); $u_server_type = 'component'; $u_state = 'stable'; $u_target_version = '3.*'; @@ -1515,7 +1516,7 @@ class Interpretation extends Fields $help[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; $help[] = $this->_t(2) . "\$query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url'));"; - $help[] = $this->_t(2) . "\$query->from('#__" . $this->componentCodeName + $help[] = $this->_t(2) . "\$query->from('#__" . Config::get('component_code_name') . "_help_document AS a');"; $help[] = $this->_t(2) . "\$query->where('a." . $target . " = '.\$db->quote(\$view));"; @@ -1586,7 +1587,7 @@ class Interpretation extends Fields $help[] = $this->_t(1) . "{"; $help[] = $this->_t(2) . "\$token = JSession::getFormToken();"; $help[] = $this->_t(2) . "return 'index.php?option=com_" - . $this->componentCodeName + . Config::get('component_code_name') . "&task=help.getText&id=' . (int) \$id . '&token=' . \$token;"; $help[] = $this->_t(1) . "}"; @@ -1938,7 +1939,7 @@ class Interpretation extends Fields $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();"; $method[] = $this->_t(2) . "\$extension = 'com_users';"; $method[] = $this->_t(2) . "\$base_dir = JPATH_SITE;"; - $method[] = $this->_t(2) . "\$language_tag = '" . $this->langTag + $method[] = $this->_t(2) . "\$language_tag = '" . Config::get('lang_tag', 'en-GB') . "';"; $method[] = $this->_t(2) . "\$reload = true;"; $method[] = $this->_t(2) @@ -2157,7 +2158,7 @@ class Interpretation extends Fields $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();"; $method[] = $this->_t(2) . "\$extension = 'com_users';"; $method[] = $this->_t(2) . "\$base_dir = JPATH_ADMINISTRATOR;"; - $method[] = $this->_t(2) . "\$language_tag = '" . $this->langTag + $method[] = $this->_t(2) . "\$language_tag = '" . Config::get('lang_tag', 'en-GB') . "';"; $method[] = $this->_t(2) . "\$reload = true;"; $method[] = $this->_t(2) @@ -2224,7 +2225,7 @@ class Interpretation extends Fields { // set the lang $lang = StringHelper::safe( - 'com_' . $this->componentCodeName . '_menu_' + 'com_' . Config::get('component_code_name') . '_menu_' . $nameSingleCode, 'U' ); @@ -2274,7 +2275,7 @@ class Interpretation extends Fields { // set the lang $lang = StringHelper::safe( - 'com_' . $this->componentCodeName . '_menu_' + 'com_' . Config::get('component_code_name') . '_menu_' . $view['settings']->code, 'U' ); $this->setLangContent( @@ -2306,10 +2307,10 @@ class Interpretation extends Fields $xml .= PHP_EOL . $this->_t(2) . '
_t(3) . 'addrulepath="/administrator/components/com_' - . $this->componentCodeName . '/models/rules"'; + . Config::get('component_code_name') . '/models/rules"'; $xml .= PHP_EOL . $this->_t(3) . 'addfieldpath="/administrator/components/com_' - . $this->componentCodeName . '/models/fields">'; + . Config::get('component_code_name') . '/models/fields">'; if (isset($this->hasIdRequest[$view['settings']->code]) && ArrayHelper::check( $this->hasIdRequest[$view['settings']->code] @@ -2360,10 +2361,10 @@ class Interpretation extends Fields . $this->hhh] . '"'; $xml .= PHP_EOL . $this->_t(3) . 'addrulepath="/administrator/components/com_' - . $this->componentCodeName . '/models/rules"'; + . Config::get('component_code_name') . '/models/rules"'; $xml .= PHP_EOL . $this->_t(3) . 'addfieldpath="/administrator/components/com_' - . $this->componentCodeName . '/models/fields">'; + . Config::get('component_code_name') . '/models/fields">'; $xml .= implode($this->_t(3), $params); $xml .= PHP_EOL . $this->_t(2) . '
'; $xml .= PHP_EOL . $this->_t(1) . ''; @@ -2921,7 +2922,7 @@ class Interpretation extends Fields . $this->hhh]; // set context $context = (isset($get['context'])) ? $get['context'] : $code; - $context = 'com_' . $this->componentCodeName . '.' . $context; + $context = 'com_' . Config::get('component_code_name') . '.' . $context; // load parms builder only once $params = false; foreach ($checker as $field => $array) @@ -3595,7 +3596,7 @@ class Interpretation extends Fields ) . " redirect away to the default view if no access allowed."; $redirectString = "JRoute::_('index.php?option=com_" - . $this->componentCodeName . "&view=" + . Config::get('component_code_name') . "&view=" . $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] . "')"; } @@ -3611,7 +3612,7 @@ class Interpretation extends Fields ) . " check if this user has permission to access item"; $accessCheck[] = $this->_t(2) . "if (!" . $userString . "->authorise('site." . $view['settings']->code - . ".access', 'com_" . $this->componentCodeName . "'))"; + . ".access', 'com_" . Config::get('component_code_name') . "'))"; $accessCheck[] = $this->_t(2) . "{"; $accessCheck[] = $this->_t(3) . "\$app = JFactory::getApplication();"; @@ -3779,7 +3780,7 @@ class Interpretation extends Fields . 'SITE_DEFAULT_VIEW' . $this->hhh] != $code) { $redirectString = "JRoute::_('index.php?option=com_" - . $this->componentCodeName . "&view=" + . Config::get('component_code_name') . "&view=" . $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] . "')"; } @@ -3794,7 +3795,7 @@ class Interpretation extends Fields { $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "\$app->redirect('index.php?option=com_" - . $this->componentCodeName . "');"; + . Config::get('component_code_name') . "');"; } $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "return false;"; @@ -4078,7 +4079,7 @@ class Interpretation extends Fields . $this->setLine(__LINE__) . " Get the global params"; $main .= PHP_EOL . $this->_t(2) . "\$globalParams = JComponentHelper::getParams('com_" - . $this->componentCodeName . "', true);"; + . Config::get('component_code_name') . "', true);"; // set php before listquery if (isset($view->add_php_getlistquery) && $view->add_php_getlistquery == 1 @@ -5291,7 +5292,7 @@ class Interpretation extends Fields { // TODO the onContentPrepare already gets triggered on the fields of its relation // $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " onContentPrepare Event Trigger."; - // $method .= PHP_EOL . $this->_t(2) . "\$dispatcher->trigger('onContentPrepare', array ('com_" . $this->componentCodeName . ".article', &\$this->item, &\$this->params, 0));"; + // $method .= PHP_EOL . $this->_t(2) . "\$dispatcher->trigger('onContentPrepare', array ('com_" . Config::get('component_code_name') . ".article', &\$this->item, &\$this->params, 0));"; } else { @@ -5301,7 +5302,7 @@ class Interpretation extends Fields $method .= PHP_EOL . $this->_t(3) . "\$results = \$dispatcher->trigger('" . $plugin_event . "', array('com_" - . $this->componentCodeName . "." + . Config::get('component_code_name') . "." . $view['settings']->context . "', &\$this->item, &\$params, 0));"; $method .= PHP_EOL . $this->_t(3) @@ -5675,7 +5676,7 @@ class Interpretation extends Fields . "if (\$this->user->authorise('" . $viewCodeName . "." . $keyCode . "', 'com_" - . $this->componentCodeName . "'))"; + . Config::get('component_code_name') . "'))"; } else { @@ -5714,7 +5715,7 @@ class Interpretation extends Fields 1 ) . $tab . "if (\$this->user->authorise('" . $viewCodeName . "." . $keyCode . "', 'com_" - . $this->componentCodeName . "'))"; + . Config::get('component_code_name') . "'))"; $this->onlyFunctionButton[$viewsCodeName][] = $this->_t( 1 @@ -5748,7 +5749,7 @@ class Interpretation extends Fields . "if (\$this->user->authorise('" . $viewCodeName . "." . $keyCode . "', 'com_" - . $this->componentCodeName . "'))"; + . Config::get('component_code_name') . "'))"; $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{"; $buttons[] = $this->_t(1) . $tab . $this->_t(2) @@ -5984,13 +5985,13 @@ class Interpretation extends Fields // set path if ('site' === $this->target) { - $path = '/components/com_' . $this->componentCodeName + $path = '/components/com_' . Config::get('component_code_name') . '/assets/js/' . $view['settings']->code . '.js'; } else { $path = '/administrator/components/com_' - . $this->componentCodeName . '/assets/js/' + . Config::get('component_code_name') . '/assets/js/' . $view['settings']->code . '.js'; } // add script to file @@ -6218,7 +6219,7 @@ class Interpretation extends Fields . " load the google chart js."; $chart[] = $this->_t(2) . "JHtml::_('script', 'media/com_" - . $this->componentCodeName . "/js/google.jsapi.js', ['version' => 'auto']);"; + . Config::get('component_code_name') . "/js/google.jsapi.js', ['version' => 'auto']);"; $chart[] = $this->_t(2) . "\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/rgbcolor.js', ['version' => 'auto']);"; $chart[] = $this->_t(2) @@ -6267,7 +6268,7 @@ class Interpretation extends Fields $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Initialize the header checker."; $setter .= PHP_EOL . $this->_t(2) . "\$HeaderCheck = new " - . $this->componentCodeName . "HeaderCheck;"; + . Config::get('component_code_name') . "HeaderCheck;"; } // check if this view should get libraries if (isset($this->libManager[$this->target][$code]) @@ -6553,7 +6554,7 @@ class Interpretation extends Fields && strpos($root, '/site/') === false) { return str_replace( - '/media/', '/media/com_' . $this->componentCodeName . '/', $root + '/media/', '/media/com_' . Config::get('component_code_name') . '/', $root ); } elseif (strpos($root, '/media/') === false @@ -6562,7 +6563,7 @@ class Interpretation extends Fields { return str_replace( '/admin/', - '/administrator/components/com_' . $this->componentCodeName + '/administrator/components/com_' . Config::get('component_code_name') . '/', $root ); } @@ -6571,7 +6572,7 @@ class Interpretation extends Fields && strpos($root, '/site/') !== false) { return str_replace( - '/site/', '/components/com_' . $this->componentCodeName . '/', + '/site/', '/components/com_' . Config::get('component_code_name') . '/', $root ); } @@ -6627,7 +6628,7 @@ class Interpretation extends Fields $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "JHtml::_('stylesheet', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/css/uikit'.\$style.\$size.'.css', ['version' => 'auto']);"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( @@ -6638,7 +6639,7 @@ class Interpretation extends Fields $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "JHtml::_('script', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/js/uikit'.\$size.'.js', ['version' => 'auto']);"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; } @@ -6726,7 +6727,7 @@ class Interpretation extends Fields ) . " check if the CSS file exists."; $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( @@ -6734,7 +6735,7 @@ class Interpretation extends Fields ) . " load the css."; $setter .= PHP_EOL . $tabV . $this->_t(6) . "JHtml::_('stylesheet', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', ['version' => 'auto']);"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( @@ -6742,7 +6743,7 @@ class Interpretation extends Fields ) . " check if the JavaScript file exists."; $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( @@ -6750,7 +6751,7 @@ class Interpretation extends Fields ) . " load the js."; $setter .= PHP_EOL . $tabV . $this->_t(6) . "JHtml::_('script', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/js/components/'.\$name.\$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; @@ -6788,7 +6789,7 @@ class Interpretation extends Fields ) . " check if the CSS file exists."; $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( @@ -6796,7 +6797,7 @@ class Interpretation extends Fields ) . " load the css."; $setter .= PHP_EOL . $tabV . $this->_t(6) . "JHtml::_('stylesheet', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', ['version' => 'auto']);"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( @@ -6804,7 +6805,7 @@ class Interpretation extends Fields ) . " check if the JavaScript file exists."; $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( @@ -6812,7 +6813,7 @@ class Interpretation extends Fields ) . " load the js."; $setter .= PHP_EOL . $tabV . $this->_t(6) . "JHtml::_('script', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v2/js/components/'.\$name.\$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; @@ -6841,7 +6842,7 @@ class Interpretation extends Fields $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "JHtml::_('stylesheet', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v3/css/uikit'.\$size.'.css', ['version' => 'auto']);"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( @@ -6852,11 +6853,11 @@ class Interpretation extends Fields $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "JHtml::_('script', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v3/js/uikit'.\$size.'.js', ['version' => 'auto']);"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "JHtml::_('script', 'media/com_" - . $this->componentCodeName + . Config::get('component_code_name') . "/uikit-v3/js/uikit-icons'.\$size.'.js', ['version' => 'auto']);"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; if (2 == $this->uikit) @@ -7066,7 +7067,7 @@ class Interpretation extends Fields if ('site' === $this->target) { return '
' . PHP_EOL; } @@ -7075,14 +7076,14 @@ class Interpretation extends Fields if ($gettype == 2) { return '' . PHP_EOL; } else { return '' . PHP_EOL; } @@ -7557,7 +7558,7 @@ class Interpretation extends Fields // get component name $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); // check if there was script added before modeling of data $script .= $this->getCustomScriptBuilder( 'php_before_save', $view, PHP_EOL . PHP_EOL @@ -7756,7 +7757,7 @@ class Interpretation extends Fields // reset $oserver = ""; // set component name - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); // add the tags observer if (isset($this->tagsBuilder[$view]) && StringHelper::check($this->tagsBuilder[$view])) @@ -7805,7 +7806,7 @@ class Interpretation extends Fields )) { // set component name - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); // reset $dbStuff = array(); // start loading the content type data @@ -7932,7 +7933,7 @@ class Interpretation extends Fields $script = $this->setComponentToContentTypes('install'); // set the component name - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); // add the assets table update for permissions rules if (isset($this->assetsRules) @@ -8064,7 +8065,7 @@ class Interpretation extends Fields . $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] . '">'; $script .= PHP_EOL . $this->_t(4) . ''; $script .= PHP_EOL . $this->_t(4) . ''; $script .= PHP_EOL . $this->_t(4) . "

Upgrade to Version " @@ -8091,7 +8092,7 @@ class Interpretation extends Fields $this->uninstallScriptBuilder )) { - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); // start loading the data to delet $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get Application object"; @@ -8574,7 +8575,7 @@ class Interpretation extends Fields // column size is varchar(5120) // check if we should add the intelligent fix treatment for the assets table - if ($this->addAssetsTableFix == 2) + if (Config::get('add_assets_table_fix') == 2) { // get the type we will convert to $data_type = ($this->accessWorseCase > 64000) ? "MEDIUMTEXT" @@ -8621,7 +8622,7 @@ class Interpretation extends Fields protected function getAssetsTableIntelligentUninstall() { // check if we should add the intelligent uninstall treatment for the assets table - if ($this->addAssetsTableFix == 2) + if (Config::get('add_assets_table_fix') == 2) { // the if statement about $rule_length $codeIF = "\$rule_length < 5120"; @@ -9000,7 +9001,7 @@ class Interpretation extends Fields $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the link"; $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" - . $this->componentCodeName . "&view=" . $nameSingleCode + . Config::get('component_code_name') . "&view=" . $nameSingleCode . "&id='. \$id;"; $routeHelper[] = $this->_t(2) . "}"; $routeHelper[] = $this->_t(2) . "else"; @@ -9014,7 +9015,7 @@ class Interpretation extends Fields $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the link but don't add the id."; $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" - . $this->componentCodeName . "&view=" . $nameSingleCode + . Config::get('component_code_name') . "&view=" . $nameSingleCode . "';"; $routeHelper[] = $this->_t(2) . "}"; if ('category' != $nameSingleCode @@ -9024,7 +9025,7 @@ class Interpretation extends Fields $routeHelper[] = $this->_t(2) . "{"; $routeHelper[] = $this->_t(3) . "\$categories = JCategories::getInstance('" - . $this->componentCodeName . "." . $nameListCode . "');"; + . Config::get('component_code_name') . "." . $nameListCode . "');"; $routeHelper[] = $this->_t(3) . "\$category = \$categories->get(\$catid);"; $routeHelper[] = $this->_t(3) . "if (\$category)"; @@ -9120,7 +9121,7 @@ class Interpretation extends Fields if (isset($get['selection']['table'])) { $viewTable = str_replace( - '#__' . $this->componentCodeName . '_', '', + '#__' . Config::get('component_code_name') . '_', '', $get['selection']['table'] ); } @@ -9977,7 +9978,7 @@ class Interpretation extends Fields $fixUnique[] = $this->_t(4) . "}"; $fixUnique[] = PHP_EOL . $this->_t(4) . "\$table = JTable::getInstance('" . $nameSingleCode . "', '" - . $this->componentCodeName . "Table');"; + . Config::get('component_code_name') . "Table');"; if ($setCategory && count($titles) == 1) { $fixUnique[] = PHP_EOL . $this->_t(4) @@ -10701,7 +10702,7 @@ class Interpretation extends Fields // also check if the developer will allow this // the access actions length must be checked before this // only add this option if set to SQL fix - if ($this->addAssetsTableFix == 1) + if (Config::get('add_assets_table_fix') == 1) { // 400 actions worse case is larger the 65535 characters if ($this->accessSize > 400) @@ -10718,7 +10719,7 @@ class Interpretation extends Fields . "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; } // smaller then 400 makes TEXT large enough - elseif ($this->addAssetsTableFix == 1) + elseif (Config::get('add_assets_table_fix') == 1) { $db .= PHP_EOL; $db .= PHP_EOL . '--'; @@ -10737,7 +10738,7 @@ class Interpretation extends Fields // also check if the developer will allow this // the config length must be checked before this // only add this option if set to SQL fix - if ($this->addAssetsTableFix && $this->addAssetsTableNameFix) + if (Config::get('add_assets_table_fix') && $this->addAssetsTableNameFix) { $db .= PHP_EOL; $db .= PHP_EOL . '--'; @@ -10786,7 +10787,7 @@ class Interpretation extends Fields // check if this component used larger rules // now revert them back on uninstall // only add this option if set to SQL fix - if ($this->addAssetsTableFix == 1) + if (Config::get('add_assets_table_fix') == 1) { // https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L22 // Checked 1st December 2020 (let us know if this changes) @@ -10805,7 +10806,7 @@ class Interpretation extends Fields // check if this component used larger names // now revert them back on uninstall // only add this option if set to SQL fix - if ($this->addAssetsTableFix == 1 && $this->addAssetsTableNameFix) + if (Config::get('add_assets_table_fix') == 1 && $this->addAssetsTableNameFix) { // https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L20 // Checked 1st December 2020 (let us know if this changes) @@ -11102,7 +11103,7 @@ class Interpretation extends Fields // sort the strings ksort($this->langContent['admin']); // load to global languages - $this->languages['components'][$this->langTag]['admin'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] = $this->langContent['admin']; // remove tmp array unset($this->langContent['admin']); @@ -11197,7 +11198,7 @@ class Interpretation extends Fields // sort the strings ksort($this->langContent['site']); // load to global languages - $this->languages['components'][$this->langTag]['site'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] = $this->langContent['site']; // remove tmp array unset($this->langContent['site']); @@ -11254,7 +11255,7 @@ class Interpretation extends Fields // sort strings ksort($this->langContent['sitesys']); // load to global languages - $this->languages['components'][$this->langTag]['sitesys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] = $this->langContent['sitesys']; // remove tmp array unset($this->langContent['sitesys']); @@ -11300,7 +11301,7 @@ class Interpretation extends Fields // sort strings ksort($this->langContent['adminsys']); // load to global languages - $this->languages['components'][$this->langTag]['adminsys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] = $this->langContent['adminsys']; // remove tmp array unset($this->langContent['adminsys']); @@ -16972,7 +16973,7 @@ class Interpretation extends Fields = ''; } // minfy the script - if ($this->minify && isset($list_fileScript) + if (Config::get('minify', 0) && isset($list_fileScript) && StringHelper::check($list_fileScript)) { // minify the fielScript javscript @@ -16981,7 +16982,7 @@ class Interpretation extends Fields $list_fileScript = $minifier->minify(); } // minfy the script - if ($this->minify && isset($fileScript) + if (Config::get('minify', 0) && isset($fileScript) && StringHelper::check($fileScript)) { // minify the fielScript javscript @@ -16990,7 +16991,7 @@ class Interpretation extends Fields $fileScript = $minifier->minify(); } // minfy the script - if ($this->minify && isset($footerScript) + if (Config::get('minify', 0) && isset($footerScript) && StringHelper::check($footerScript)) { // minify the footerScript javscript @@ -27688,6 +27689,7 @@ function vdm_dkim() { // since we have less than 30 actions // we do not need the fix for this component $this->addAssetsTableFix = 0; + Config::set('add_assets_table_fix', $this->addAssetsTableFix); } else { @@ -28389,8 +28391,8 @@ function vdm_dkim() { $this->multiLangString = $this->getMultiLangStrings($values); // start the modules language bucket (must rest every time) $this->languages['modules'] = array(); - $this->languages['modules'][$this->langTag] = array(); - $this->languages['modules'][$this->langTag]['all'] + $this->languages['modules'][Config::get('lang_tag', 'en-GB')] = array(); + $this->languages['modules'][Config::get('lang_tag', 'en-GB')]['all'] = $this->langContent[$module->key]; unset($this->langContent[$module->key]); // update insert the current lang in to DB @@ -28774,8 +28776,8 @@ function vdm_dkim() { $this->multiLangString = $this->getMultiLangStrings($values); // start the plugins language bucket (must rest every time) $this->languages['plugins'] = array(); - $this->languages['plugins'][$this->langTag] = array(); - $this->languages['plugins'][$this->langTag]['all'] + $this->languages['plugins'][Config::get('lang_tag', 'en-GB')] = array(); + $this->languages['plugins'][Config::get('lang_tag', 'en-GB')]['all'] = $this->langContent[$plugin->key]; unset($this->langContent[$plugin->key]); // update insert the current lang in to DB @@ -29176,11 +29178,11 @@ function vdm_dkim() { // don't add the ending comma on last value if ($size == $counter) { - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'$this->jcbPowersPath/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'" . Config::get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; } else { - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'$this->jcbPowersPath/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'" . Config::get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; } $counter++; } @@ -29281,8 +29283,8 @@ function vdm_dkim() { &$file_name ) { - // only log messages for none $this->langTag translations - if ($this->langTag !== $tag) + // only log messages for none Config::get('lang_tag', 'en-GB') translations + if (Config::get('lang_tag', 'en-GB') !== $tag) { $langStringNr = count($languageStrings); $langStringSum = MathHelper::bc( @@ -29295,7 +29297,7 @@ function vdm_dkim() { . $tag . ' translated)' : '(strings ' . $tag . ' translated)'; // force load if debug lines are added - if (!$this->debugLinenr) + if (!Config::get('debug_line_nr', false)) { // check if we should install this translation if ($percentage < $this->percentageLanguageAdd) @@ -29303,7 +29305,7 @@ function vdm_dkim() { // dont add $this->langNot[$file_name] = '' . $total . '(total ' - . $this->langTag . ' strings) only ' + . Config::get('lang_tag', 'en-GB') . ' strings) only ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; @@ -29313,7 +29315,7 @@ function vdm_dkim() { // show if it was added as well $this->langSet[$file_name] = '' . $total . '(total ' - . $this->langTag . ' strings) and ' + . Config::get('lang_tag', 'en-GB') . ' strings) and ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 4399be384..c92c44c3e 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -20,6 +20,7 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Componentbuilder\Extension\InstallScript; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; /** * Infusion class @@ -55,7 +56,7 @@ class Infusion extends Interpretation */ private function setLine($nr) { - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { return ' [Infusion ' . $nr . ']'; } @@ -189,7 +190,7 @@ class Infusion extends Interpretation // set the joomla target xml version $this->fileContentStatic[$this->hhh . 'XMLVERSION' . $this->hhh] - = $this->joomlaVersions[$this->joomlaVersion]['xml_version']; + = $this->joomlaVersions[Config::get('version', 3)]['xml_version']; // Component_name $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] @@ -440,7 +441,7 @@ class Infusion extends Interpretation $this->fileContentDynamic[$nameSingleCode][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet( - $view, $this->componentCodeName, + $view, Config::get('component_code_name'), $nameSingleCode, $nameListCode ); @@ -774,7 +775,7 @@ class Infusion extends Interpretation . 'AUTOCHECKIN' . $this->hhh] = $this->setAutoCheckin( $nameSingleCode, - $this->componentCodeName + Config::get('component_code_name') ); // CHECKINCALL <<>> $this->fileContentDynamic[$nameListCode][$this->hhh @@ -1038,7 +1039,7 @@ class Infusion extends Interpretation && StringHelper::check($footerScript)) { // only minfy if no php is added to the footer script - if ($this->minify + if (Config::get('minify', 0) && strpos($footerScript, 'setLangContent( $this->lang, - $this->langPrefix . '_' . $view['settings']->CODE, + Config::get('lang_prefix') . '_' . $view['settings']->CODE, $view['settings']->name ); $this->setLangContent( $this->lang, - $this->langPrefix . '_' . $view['settings']->CODE + Config::get('lang_prefix') . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description ); // ICOMOON <<>> @@ -1677,47 +1678,47 @@ class Infusion extends Interpretation // DASHBOARDVIEW $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] - = $this->componentCodeName; + = Config::get('component_code_name'); // DASHBOARDICONS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASHBOARDICONS' . $this->hhh] = $this->setDashboardIcons(); // DASHBOARDICONACCESS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASHBOARDICONACCESS' . $this->hhh] = $this->setDashboardIconAccess(); // DASH_MODEL_METHODS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_MODEL_METHODS' . $this->hhh] = $this->setDashboardModelMethods(); // DASH_GET_CUSTOM_DATA - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_GET_CUSTOM_DATA' . $this->hhh] = $this->setDashboardGetCustomData(); // DASH_DISPLAY_DATA - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_DISPLAY_DATA' . $this->hhh] = $this->setDashboardDisplayData(); // DASH_VIEW_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_VIEW_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.view', 'dashboard'); // DASH_VIEW_HTML_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_VIEW_HTML_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.view.html', 'dashboard'); // DASH_MODEL_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_MODEL_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.model', 'dashboard'); // DASH_CONTROLLER_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_CONTROLLER_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.controller', 'dashboard'); } @@ -2018,12 +2019,12 @@ class Infusion extends Interpretation // add to lang array $this->setLangContent( 'site', - $this->langPrefix . '_' . $view['settings']->CODE, + Config::get('lang_prefix') . '_' . $view['settings']->CODE, $view['settings']->name ); $this->setLangContent( 'site', - $this->langPrefix . '_' . $view['settings']->CODE + Config::get('lang_prefix') . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description ); // SITE_CUSTOM_METHODS <<>> @@ -2351,7 +2352,7 @@ class Infusion extends Interpretation // tweak system to set stuff to the module domain $_backup_target = $this->target; $_backup_lang = $this->lang; - $_backup_langPrefix = $this->langPrefix; + $_backup_langPrefix = Config::get('lang_prefix'); // infuse module data if set if (ArrayHelper::check($this->joomlaModules)) { @@ -2367,6 +2368,7 @@ class Infusion extends Interpretation $this->target = $module->key; $this->lang = $module->key; $this->langPrefix = $module->lang_prefix; + Config::set('lang_prefix', $module->lang_prefix); // MODCODE $this->fileContentDynamic[$module->key][$this->hhh . 'MODCODE' . $this->hhh] @@ -2394,7 +2396,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$module->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($module, ['debug' => $this->debugLinenr]))->get(); + = (new InstallScript($module))->get(); } // FIELDSET if (isset($module->form_files) @@ -2446,6 +2448,7 @@ class Infusion extends Interpretation $this->target = $plugin->key; $this->lang = $plugin->key; $this->langPrefix = $plugin->lang_prefix; + Config::set('lang_prefix', $plugin->lang_prefix); // MAINCLASS $this->fileContentDynamic[$plugin->key][$this->hhh . 'MAINCLASS' . $this->hhh] @@ -2456,7 +2459,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$plugin->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($plugin, ['debug' => $this->debugLinenr]))->get(); + = (new InstallScript($plugin))->get(); } // FIELDSET if (isset($plugin->form_files) @@ -2497,6 +2500,7 @@ class Infusion extends Interpretation $this->target = $_backup_target; $this->lang = $_backup_lang; $this->langPrefix = $_backup_langPrefix; + Config::set('lang_prefix', $_backup_langPrefix); // Trigger Event: jcb_ce_onAfterBuildFilesContent $this->triggerEvent( 'jcb_ce_onAfterBuildFilesContent', @@ -2649,20 +2653,20 @@ class Infusion extends Interpretation if ($this->setLangAdmin()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['admin'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] ); $mainLangLoader['admin'] = count( - $this->languages['components'][$this->langTag]['admin'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] ); } // check the admin system lang is set if ($this->setLangAdminSys()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['adminsys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] ); $mainLangLoader['adminsys'] = count( - $this->languages['components'][$this->langTag]['adminsys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] ); } // check the site lang is set @@ -2670,10 +2674,10 @@ class Infusion extends Interpretation && $this->setLangSite()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['site'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] ); $mainLangLoader['site'] = count( - $this->languages['components'][$this->langTag]['site'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] ); } // check the site system lang is set @@ -2681,19 +2685,19 @@ class Infusion extends Interpretation && $this->setLangSiteSys()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['sitesys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] ); $mainLangLoader['sitesys'] = count( - $this->languages['components'][$this->langTag]['sitesys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] ); } $values = array_unique(ArrayHelper::merge($values)); // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); // update insert the current lang in to DB - $this->setLangPlaceholders($values, $this->componentID); + $this->setLangPlaceholders($values, Config::get('component_id')); // remove old unused language strings - $this->purgeLanuageStrings($values, $this->componentID); + $this->purgeLanuageStrings($values, Config::get('component_id')); // path to INI file $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles @@ -2730,7 +2734,7 @@ class Infusion extends Interpretation $t = '.sys'; } // build the file name - $file_name = $tag . '.com_' . $this->componentCodeName . $t + $file_name = $tag . '.com_' . Config::get('component_code_name') . $t . '.ini'; // check if language should be added if ($this->shouldLanguageBeAdded( @@ -2796,7 +2800,7 @@ class Infusion extends Interpretation = implode(PHP_EOL . $this->_t(2), $langXML['site']); } // build xml path - $xmlPath = $this->componentPath . '/' . $this->componentCodeName + $xmlPath = $this->componentPath . '/' . Config::get('component_code_name') . '.xml'; // get the content in xml $componentXML = FileHelper::getContent( diff --git a/admin/models/forms/power.xml b/admin/models/forms/power.xml index 718caf46b..1b98c8959 100644 --- a/admin/models/forms/power.xml +++ b/admin/models/forms/power.xml @@ -297,8 +297,8 @@ type="text" name="implements_custom" label="COM_COMPONENTBUILDER_POWER_IMPLEMENTS_CUSTOM_LABEL" - size="10" - maxlength="50" + size="50" + maxlength="150" description="COM_COMPONENTBUILDER_POWER_IMPLEMENTS_CUSTOM_DESCRIPTION" class="text_area span12" filter="STRING" diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index a9422cda5..15782757b 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1967,7 +1967,7 @@ INSERT INTO `#__componentbuilder_joomla_component` (`id`, `add_license`, `licens -- INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `extends`, `extends_custom`, `guid`, `head`, `implements`, `implements_custom`, `load_selection`, `main_class_code`, `method_selection`, `name`, `namespace`, `power_version`, `property_selection`, `system_name`, `type`, `use_selection`, `params`, `published`, `created`, `modified`, `version`, `ordering`) VALUES -(1, '', 'Basic shared utilities, a legacy implementation\r\n\r\n@since 3.0.9', '', '', '79d765b3-7319-4988-9730-446c7f347020', '', '', '', '{\"load_selection0\":{\"load\":\"1d929017-a5de-4e0f-9b5a-838934857e26\"}}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIGhhdmUgYSBzdHJpbmcgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0ICAgIHN0cmluZyAgJHN0cmluZyBUaGUgc3RyaW5nIHRvIGNoZWNrDQoJICoNCgkgKiBAcmV0dXJucyBib29sIHRydWUgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBz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GxvY2FsIGNvbXBvbmVudCBvcHRpb24NCgkJaWYgKGVtcHR5KCRvcHRpb24pKQ0KCQl7DQoJCQlpZiAoZW1wdHkoSGVscGVyOjokb3B0aW9uKSAmJiBwcm9wZXJ0eV9leGlzdHMoX19DTEFTU19fLCAnQ29tcG9uZW50Q29kZU5hbWUnKSkNCgkJCXsNCgkJCQlIZWxwZXI6OiRvcHRpb24gPSAnY29tXycgLiBzZWxmOjokQ29tcG9uZW50Q29kZU5hbWU7DQoJCQl9DQoJCX0NCgkJZWxzZQ0KCQl7DQoJCQlIZWxwZXI6OiRvcHRpb24gPSAkb3B0aW9uOw0KCQl9DQoJfQ0K', '{}', 'Utilities', 'VDM\\Joomla\\Utilities', '1.0.0', '{}', 'Utilities', 'trait', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"91004529-94a9-4590-b842-e7c6b624ecf5\",\"as\":\"default\"},\"use_selection4\":{\"use\":\"152c8793-8b75-4715-996a-257b9f65451c\",\"as\":\"default\"},\"use_selection5\":{\"use\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\",\"as\":\"default\"},\"use_selection6\":{\"use\":\"9c513baf-b279-43fd-ae29-a585c8cbc4f0\",\"as\":\"default\"},\"use_selection7\":{\"use\":\"a223b31e-ea1d-4cdf-92ae-5f9becffaff0\",\"as\":\"default\"},\"use_selection8\":{\"use\":\"9ef0eb24-aae4-4f5a-99af-d724db44808f\",\"as\":\"default\"},\"use_selection9\":{\"use\":\"a8935cbe-7701-40dc-bfd5-675f2d600954\",\"as\":\"default\"},\"use_selection10\":{\"use\":\"30c5b4c2-f75f-4d15-869a-f8bfedd87358\",\"as\":\"default\"},\"use_selection11\":{\"use\":\"ce8cf834-6bac-44fb-941c-861f7e046cc0\",\"as\":\"default\"},\"use_selection12\":{\"use\":\"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6\",\"as\":\"default\"},\"use_selection13\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2021-11-06 13:25:19', '2022-08-20 15:18:05', 70, 1), +(1, '', 'Basic shared utilities, a legacy implementation\r\n\r\n@since 3.0.9', '', '', '79d765b3-7319-4988-9730-446c7f347020', '', '', '', '{\"load_selection1\":{\"load\":\"d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac\"},\"load_selection2\":{\"load\":\"1d929017-a5de-4e0f-9b5a-838934857e26\"}}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIGhhdmUgYSBzdHJpbmcgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0ICAgIHN0cmluZyAgJHN0cmluZyBUaGUgc3RyaW5nIHRvIGNoZWNrDQoJICoNCgkgKiBAcmV0dXJucyBib29sIHRydWUgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKg0KCSAqIEBkZXByZWNhdGVkICA0LjAgLSBVc2UgU3RyaW5nSGVscGVyOjpjaGVjaygkc3RyaW5nKTsNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGNoZWNrU3RyaW5nKCRzdHJpbmcpOiBib29sDQoJew0KCQlyZXR1cm4gU3RyaW5nSGVscGVyOjpjaGVjaygkc3RyaW5nKTsNCgl9DQoNCgkvKioNCgkgKiBTaG9ydGVuIGEgc3RyaW5nDQoJICoNCgkgKiBAaW5wdXQgIC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WxwZXI6OiRvcHRpb24gPSAkb3B0aW9uOw0KCQl9DQoJfQ0K', '{}', 'Utilities', 'VDM\\Joomla\\Utilities', '1.0.0', '{}', 'Utilities', 'trait', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"91004529-94a9-4590-b842-e7c6b624ecf5\",\"as\":\"default\"},\"use_selection4\":{\"use\":\"152c8793-8b75-4715-996a-257b9f65451c\",\"as\":\"default\"},\"use_selection5\":{\"use\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\",\"as\":\"default\"},\"use_selection6\":{\"use\":\"9c513baf-b279-43fd-ae29-a585c8cbc4f0\",\"as\":\"default\"},\"use_selection7\":{\"use\":\"a223b31e-ea1d-4cdf-92ae-5f9becffaff0\",\"as\":\"default\"},\"use_selection8\":{\"use\":\"9ef0eb24-aae4-4f5a-99af-d724db44808f\",\"as\":\"default\"},\"use_selection9\":{\"use\":\"a8935cbe-7701-40dc-bfd5-675f2d600954\",\"as\":\"default\"},\"use_selection10\":{\"use\":\"30c5b4c2-f75f-4d15-869a-f8bfedd87358\",\"as\":\"default\"},\"use_selection11\":{\"use\":\"ce8cf834-6bac-44fb-941c-861f7e046cc0\",\"as\":\"default\"},\"use_selection12\":{\"use\":\"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6\",\"as\":\"default\"},\"use_selection13\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2021-11-06 13:25:19', '2022-08-20 21:09:53', 71, 1), (5, 1, '', '', '', 'db4a1e4d-be59-4e87-8b4d-c40512752232', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwIGFzIEJhc2VIdHRwOw0KdXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwRmFjdG9yeTsNCnVzZSBKb29tbGFcUmVnaXN0cnlcUmVnaXN0cnk7', '', '', '{\"load_selection0\":{\"load\":\"aa253bac-f4b4-41b4-8ace-071a73fc4d96\"},\"load_selection1\":{\"load\":\"c65aaf1f-817c-49a2-8202-282e3904f5b1\"},\"load_selection2\":{\"load\":\"51195163-1e87-4251-b755-a03c376798a6\"},\"load_selection3\":{\"load\":\"ef011ee1-64f0-4048-b013-777473b727dd\"},\"load_selection4\":{\"load\":\"c4a188de-ad78-4a6d-9d5b-01866846d701\"}}', 'CS8qKg0KCSAqIE9wdGlvbnMgZm9yIHRoZSBHaXRlYSBvYmplY3QuDQoJICoNCgkgKiBAdmFyICAgIGFycmF5DQoJICogQHNpbmNlICAxLjANCgkgKi8NCglwcm90ZWN0ZWQgJG9wdGlvbnM7DQoNCgkvKioNCgkgKiBUaGUgSFRUUCBjbGllbnQgb2JqZWN0IHRvIHVzZSBpbiBzZW5kaW5nIEhUVFAgcmVxdWVzdHMuDQoJICoNCgkgKiBAdmFyICAgIEJhc2VIdHRwDQoJICogQHNpbmNlICAxLjANCgkgKi8NCglwcm90ZWN0ZWQgJGNsaWVudDsNCg0KCS8qKg0KCSAqIENvbnN0cnVjdG9yLg0KCSAqDQoJICogQHBhcmFtICAgUmVnaXN0cnkgICRvcHRpb25zICBHaXRlYSBvcHRpb25zIG9iamVjdC4NCgkgKiBAcGFyYW0gICBIdHRwICAgICAgJGNsaWVudCAgIFRoZSBIVFRQIGNsaWVudCBvYmplY3QuDQoJICoNCgkgKiBAc2luY2UgICAxLjANCgkgKi8NCglwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoUmVnaXN0cnkgJG9wdGlvbnMgPSBudWxsLCBCYXNlSHR0cCAkY2xpZW50ID0gbnVsbCkNCgl7DQoJCSR0aGlzLT5vcHRpb25zID0gJG9wdGlvbnMgPzogbmV3IFJlZ2lzdHJ5Ow0KDQoJC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Db2RlID0gMjAwKQ0KCXsNCgkJLy8gVmFsaWRhdGUgdGhlIHJlc3BvbnNlIGNvZGUuDQoJCWlmICgkcmVzcG9uc2UtPmNvZGUgIT0gJGV4cGVjdGVkQ29kZSkNCgkJew0KCQkJLy8gRGVjb2RlIHRoZSBlcnJvciByZXNwb25zZSBhbmQgdGhyb3cgYW4gZXhjZXB0aW9uLg0KCQkJJGVycm9yICAgPSBqc29uX2RlY29kZSgkcmVzcG9uc2UtPmJvZHkpOw0KCQkJJG1lc3NhZ2UgPSBpc3NldCgkZXJyb3ItPm1lc3NhZ2UpID8gJGVycm9yLT5tZXNzYWdlIDogJ0ludmFsaWQgcmVzcG9uc2UgcmVjZWl2ZWQgZnJvbSBHaXRlYS4nOw0KDQoJCQl0aHJvdyBuZXcgXERvbWFpbkV4Y2VwdGlvbigkbWVzc2FnZSwgJHJlc3BvbnNlLT5jb2RlKTsNCgkJfQ0KDQoJCWlmIChKc29uSGVscGVyOjpjaGVjaygkcmVzcG9uc2UtPmJvZHkpKQ0KCQl7DQoJCQkkYm9keSA9IGpzb25fZGVjb2RlKCRyZXNwb25zZS0+Ym9keSk7DQoNCgkJCWlmIChpc3NldCgkYm9keS0+Y29udGVudF9iYXNlNjQpKQ0KCQkJew0KCQkJCSRib2R5LT5jb250ZW50ID0gYmFzZTY0X2RlY29kZSgkYm9keS0+Y29udGVudF9iYXNlNjQpOw0KCQkJfQ0KCQl9DQoJCWVsc2UNCgkJew0KCQkJJGJvZHkgPSAkcmVzcG9uc2UtPmJvZHk7DQoJCX0NCg0KCQlyZXR1cm4gJGJvZHk7DQoJfQ0K', '{}', 'AbstractGiteaObject', 'VDM\\Gitea\\AbstractGiteaObject', '1.0.0', '{}', 'Abstract Gitea Object', 'abstract class', '{\"use_selection0\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"}}', '', 1, '2021-12-03 16:00:26', '2022-07-09 12:15:49', 20, 4), (7, 1, '', 'aa253bac-f4b4-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BfX2dldCgkbmFtZSkNCgl7DQoJCSRjbGFzcyA9ICdcXFZETVxcR2l0ZWFcXFBhY2thZ2VcXCcgLiAkdGhpcy0+cGFja2FnZSAuICdcXCcgLiB1Y2ZpcnN0KCRuYW1lKTsNCg0KCQlpZiAoY2xhc3NfZXhpc3RzKCRjbGFzcykgPT0gZmFsc2UpDQoJCXsNCgkJCXRocm93IG5ldyBcSW52YWxpZEFyZ3VtZW50RXhjZXB0aW9uKA0KCQkJCXNwcmludGYoDQoJCQkJCSdBcmd1bWVudCAlMSRzIHByb2R1Y2VkIGFuIGludmFsaWQgY2xhc3MgbmFtZTogJTIkcyBpbiBwYWNrYWdlICUzJHMnLA0KCQkJCQkkbmFtZSwgJGNsYXNzLCAkdGhpcy0+cGFja2FnZQ0KCQkJCSkNCgkJCSk7DQoJCX0NCg0KCQlpZiAoaXNzZXQoJHRoaXMtPiRuYW1lKSA9PSBmYWxzZSkNCgkJew0KCQkJJHRoaXMtPiRuYW1lID0gbmV3ICRjbGFzcygkdGhpcy0+b3B0aW9ucywgJHRoaXMtPmNsaWVudCk7DQoJCX0NCg0KCQlyZXR1cm4gJHRoaXMtPiRuYW1lOw0KCX0NCg==', '{}', 'AbstractPackage', 'VDM\\Gitea\\AbstractPackage', '1.0.0', '{}', 'Abstract Gitea Package', 'abstract class', '{}', '', 1, '2021-12-03 16:03:06', '2022-05-27 08:31:35', 15, 4), diff --git a/componentbuilder.xml b/componentbuilder.xml index 0f9ee68f5..4a6de3979 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 20th August, 2022 + 21st August, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php new file mode 100644 index 000000000..96d8cbcbb --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -0,0 +1,178 @@ + + * @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; + + +use Joomla\Registry\Registry; +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Compiler Configurations Registry + * + * @since 3.1.6 + */ +class Config extends Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable +{ + /** + * The Params + * + * @var Registry + * @since 3.1.6 + */ + protected Registry $params; + + /** + * Constructor + * + * @param array $config The data to bind to the new Config object. + * @param Registry $params The component parameters + * + * @since 3.1.6 + */ + public function __construct(array $config, ?Registry $params = null) + { + // Set the params + $this->params = $params ?: Helper::getParams('com_componentbuilder'); + + // Instantiate the internal data object. + $this->data = new \stdClass; + + // Load the config to the data object + $this->bindData($this->data, $this->modelConfig($config)); + } + + /** + * model the configuration data array + * + * @param array $config The data to bind to the new Config object. + * + * @return array + * @since 3.1.6 + */ + protected function modelConfig(array $config): array + { + // we do not yet have this set as an option + $config['remove_line_breaks'] + = 2; // 2 is global (use the components value) + + // set the minfy switch of the JavaScript + $config['minify'] = (isset($config['minify']) && $config['minify'] != 2) + ? $config['minify'] : $this->params->get('minify', 0); + + // set the global language + $config['lang_tag'] = $this->params->get('language', 'en-GB'); + + // check if we have Tidy enabled + $config['tidy'] = extension_loaded('Tidy'); + + // set the field type builder + $config['field_builder_type'] = $this->params->get( + 'compiler_field_builder_type', 2 + ); + + // load the compiler path + $config['compiler_path'] = $this->params->get( + 'compiler_folder_path', + JPATH_COMPONENT_ADMINISTRATOR . '/compiler' + ); + + // load the jcb powers path + $config['jcb_powers_path'] = $this->params->get( + 'jcb_powers_path', + 'libraries/jcb_powers'); + + // set the component ID + $config['component_id'] = (int)$config['component']; + // TODO set up stream correctly + unset($config['component']); + + // set this components code name + if ($name_code = GetHelper::var( + 'joomla_component', $config['component_id'], 'id', 'name_code' + )) { + // set lang prefix + $config['lang_prefix'] = 'COM_' . StringHelper::safe( + $name_code, 'U' + ); + + // set component code name + $config['component_code_name'] = StringHelper::safe( + $name_code + ); + + // set component context + $config['component_context'] = $config['component_code_name'] . '.' + . $config['component_id']; + + // set the component name length + $config['component_code_name_length'] = strlen( + $config['component_code_name'] + ); + + // add assets table fix + $global = (int)$this->params->get( + 'assets_table_fix', 1 + ); + $config['add_assets_table_fix'] = (($add_assets_table_fix + = (int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'assets_table_fix' + )) == 3) ? $global : $add_assets_table_fix; + + // set if language strings line breaks should be removed + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'remove_line_breaks' + ) == 1) ? true : false; + $config['remove_line_breaks'] = ((int)$config['remove_line_breaks'] + == 0) + ? false + : (((int)$config['remove_line_breaks'] == 1) ? true + : $global); + + // set if placeholders should be added to customcode + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'add_placeholders' + ) == 1) ? true : false; + $config['add_placeholders'] = ((int)$config['placeholders'] == 0) + ? false + : (((int)$config['placeholders'] == 1) ? true : $global); + // TODO set up stream correctly + unset($config['placeholders']); + + // set if line numbers should be added to comments + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'debug_linenr' + ) == 1) ? true : false; + $config['debug_line_nr'] = ((int)$config['debuglinenr'] == 0) ? false + : (((int)$config['debuglinenr'] == 1) ? true : $global); + + // set if powers should be added to component (default is true) + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'add_powers' + ) == 1) ? true : false; + $config['add_power'] = (isset($config['powers']) && (int)$config['powers'] == 0) + ? false : ((isset($config['powers']) && (int)$config['powers'] == 1) ? true : $global); + // TODO set up stream correctly + unset($config['powers']); + } + + return $config; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/index.html similarity index 100% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/index.html diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php index b4287f1c3..0c72523fd 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php @@ -131,14 +131,8 @@ class InstallScript * Constructor * @since 3.1.5 */ - public function __construct(object $extension, ?array $config = null) + public function __construct(object $extension) { - // check if we have the debug switch TODO - move to global registry - singleton - if (isset($config['debug'])) - { - $this->debug = $config['debug']; - } - // loop over methods and types foreach ($this->methods as $method) { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php new file mode 100644 index 000000000..20fdeb033 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php @@ -0,0 +1,257 @@ + + * @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\Factory\Compiler; + + +use Joomla\CMS\Factory; +use Joomla\Registry\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Config as CompilerConfig; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Factory to load the compiler config + */ +abstract class Config +{ + /** + * Global Config object + * + * @var CompilerConfig + * @since 3.1.6 + **/ + protected static $CompilerConfig = null; + + /** + * Get a value. + * + * @param string $path Registry path (e.g. version) + * @param mixed $default Optional default value, returned if the internal value is null. + * + * @return mixed Value of entry or null + * + * @since 3.1.6 + */ + public static function get(string $path, $default = null) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + // return the value or default if none is found + return self::$CompilerConfig->get($path, $default); + } + + /** + * Check if a registry path exists. + * + * @param string $path Registry path (e.g. guid.main.0.path) + * + * @return boolean + * + * @since 3.1.6 + */ + public static function exists($path) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + // check if exists + return self::$CompilerConfig->exists($path); + } + + /** + * Method to extract a sub-registry from path + * + * @param string $path Registry path (e.g. guid.main) + * + * @return Registry Registry object (empty if no data is present) + * + * @since 3.1.6 + */ + public function extract($path) + { + if (!self::exists($path)) + { + // create config registry + return new Registry(); + } + + return self::$CompilerConfig->extract($path); + } + + /** + * Gets this object represented as an ArrayIterator. + * + * This allows the data properties to be accessed via a foreach statement. + * + * @return \ArrayIterator This object represented as an ArrayIterator. + * + * @see IteratorAggregate::getIterator() + * @since 3.1.6 + */ + #[\ReturnTypeWillChange] + public static function getIterator() + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + return self::$CompilerConfig->getIterator(); + } + + /** + * Set a registry value. + * + * @param string $path Registry Path (e.g. guid.main.0.url) + * @param mixed $value Value of entry + * @param string $separator The key separator + * + * @return mixed The value of the that has been set. + * + * @since 3.1.6 + */ + public static function set($path, $value, $separator = null) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + self::$CompilerConfig->set($path, $value, $separator); + } + + /** + * Delete a registry value + * + * @param string $path Registry Path (e.g. guid.main.0.url) + * + * @return mixed The value of the removed node or null if not set + * + * @since 3.1.6 + */ + public static function remove($path) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + // remove the actual value + return self::$CompilerConfig->remove($path); + } + + /** + * Transforms a namespace to an array + * + * @return array An associative array holding the namespace data + * + * @since 3.1.6 + */ + public static function toArray() + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + return self::$CompilerConfig->toArray(); + } + + /** + * Transforms a namespace to an object + * + * @return object An an object holding the namespace data + * + * @since 3.1.6 + */ + public static function toObject() + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + return self::$CompilerConfig->toObject(); + } + + /** + * Initialize a CompilerConfig object if id does not exist. + * + * Returns the global {@link CompilerConfig} object, only creating it if it doesn't already exist. + * + * @param array $config The data to bind to the new Config object. + * + * + * @return CompilerConfig object + * + * @see Session + * @since 3.1.6 + **/ + public static function init($config = null): CompilerConfig + { + if (!self::$CompilerConfig) + { + self::$CompilerConfig = self::create($config); + } + + return self::$CompilerConfig; + } + + /** + * Create a CompilerConfig object + * + * @param array $config The data to bind to the new Config object. + * + * @return CompilerConfig object + * @since 3.1.6 + * @throws \Exception + **/ + protected static function create($config = null): CompilerConfig + { + // get the session + $session = Factory::getSession(); + + // check if we have config + if (ArrayHelper::check($config)) + { + // save for later should we call this out of scope + $session->set('Componentbuilder.Compiler.Config', $config); + } + // if not found try loading it from the session + elseif (($config = $session->get('Componentbuilder.Compiler.Config', false)) === false) + { + throw new \Exception('Compiler configuration not found.'); + } + + return new CompilerConfig($config); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/index.html similarity index 100% rename from libraries/jcb_powers/VDM.Joomla/src/Utilities/index.html rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/index.html diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php index ee26fabef..e4ae1c346 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php @@ -12,6 +12,9 @@ namespace VDM\Joomla\Componentbuilder; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; + + /** * Add line comment * @@ -19,14 +22,6 @@ namespace VDM\Joomla\Componentbuilder; */ trait Line { - /** - * The debug switch - * - * @var bool - * @since 3.1.5 - */ - protected bool $debug = false; - /** * Set the line number in comments * @@ -37,7 +32,7 @@ trait Line */ private function setLine(int $nr): string { - if ($this->debug) + if (Config::get('debug_line_nr', false)) { return ' [' . get_called_class() . ' ' . $nr . ']'; }