From a2ec013566936b0aa09043afcdfd18847429b9ac Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 11 Dec 2022 17:06:13 +0200 Subject: [PATCH] Moved all placeholder behaviour to class function. Moved dynamic content to the content class. --- README.md | 8 +- admin/README.txt | 8 +- admin/helpers/compiler.php | 20 +- admin/helpers/compiler/a_Get.php | 306 ++--- admin/helpers/compiler/b_Structure.php | 8 +- admin/helpers/compiler/c_Fields.php | 207 ++- admin/helpers/compiler/e_Interpretation.php | 822 +++++------ admin/helpers/compiler/f_Infusion.php | 1220 +++++++---------- componentbuilder.xml | 2 +- .../src/Componentbuilder/Compiler/Config.php | 22 + .../src/Componentbuilder/Compiler/Content.php | 54 +- .../Interfaces/PlaceholderInterface.php | 168 +++ .../Componentbuilder/Compiler/Placeholder.php | 308 ++++- .../src/Componentbuilder/Compiler/Power.php | 35 +- .../Compiler/Power/Autoloader.php | 214 +++ .../Compiler/Power/index.html | 1 + .../Compiler/Service/Power.php | 38 +- 17 files changed, 1816 insertions(+), 1625 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/index.html diff --git a/README.md b/README.md index b63b621e7..b0dff3c68 100644 --- a/README.md +++ b/README.md @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 4th December, 2022 ++ *Last Build*: 11th December, 2022 + *Version*: 3.1.13 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **336766** ++ *Line count*: **337314** + *Field count*: **2009** -+ *File count*: **2204** -+ *Folder count*: **387** ++ *File count*: **2206** ++ *Folder count*: **388** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index b63b621e7..b0dff3c68 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 4th December, 2022 ++ *Last Build*: 11th December, 2022 + *Version*: 3.1.13 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **336766** ++ *Line count*: **337314** + *Field count*: **2009** -+ *File count*: **2204** -+ *Folder count*: **387** ++ *File count*: **2206** ++ *Folder count*: **388** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 7bfcb4e14..3fe409ef9 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -99,7 +99,7 @@ class Compiler extends Infusion $this->repoPath = $this->params->get('git_folder_path', null); } // remove site folder if not needed (TODO add check if custom script was moved to site folder then we must do a more complex cleanup here) - if ($this->removeSiteFolder && $this->removeSiteEditFolder) + if (CFactory::_('Config')->remove_site_folder && CFactory::_('Config')->remove_site_edit_folder) { // first remove the files and folders $this->removeFolder($this->componentPath . '/site'); @@ -397,9 +397,9 @@ class Compiler extends Infusion // now we do the dynamic files foreach ($this->newFiles['dynamic'] as $view => $files) { - if (isset($this->fileContentDynamic[$view]) + if (CFactory::_('Content')->exist_($view) && ArrayHelper::check( - $this->fileContentDynamic[$view] + CFactory::_('Content')->get_($view) )) { foreach ($files as $file) @@ -417,7 +417,7 @@ class Compiler extends Infusion } } // free up some memory - unset($this->fileContentDynamic[$view]); + CFactory::_('Content')->remove_($view); } // free up some memory unset($this->newFiles['dynamic']); @@ -498,7 +498,7 @@ class Compiler extends Infusion } // free up some memory unset($this->newFiles[$module->key]); - unset($this->fileContentDynamic[$module->key]); + CFactory::_('Content')->remove_($module->key); } } } @@ -579,7 +579,7 @@ class Compiler extends Infusion } // free up some memory unset($this->newFiles[$plugin->key]); - unset($this->fileContentDynamic[$plugin->key]); + CFactory::_('Content')->remove_($plugin->key); } } } @@ -607,7 +607,7 @@ class Compiler extends Infusion } // free up some memory unset($this->newFiles[$power->key]); - unset($this->fileContentDynamic[$power->key]); + CFactory::_('Content')->remove_($power->key); } } } @@ -661,7 +661,7 @@ class Compiler extends Infusion if ($view) { $answer = CFactory::_('Placeholder')->update( - $answer, $this->fileContentDynamic[$view], 3 + $answer, CFactory::_('Content')->get_($view), 3 ); } // check if this file needs extra care :) @@ -1421,8 +1421,8 @@ class Compiler extends Infusion $target['id'] ); $data = $placeholder['start'] . PHP_EOL - . CFactory::_('Placeholder')->update( - $target['code'], CFactory::_('Placeholder')->active + . CFactory::_('Placeholder')->update_( + $target['code'] ) . $placeholder['end'] . PHP_EOL; if ($target['type'] == 2) { diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index b8a540fed..123d7a895 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -2275,49 +2275,31 @@ class Get CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_single_code] = false; CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_list_code] = false; + // set some placeholders - CFactory::_('Placeholder')->active[Placefix::_h('view')] - = $view->name_single_code; - CFactory::_('Placeholder')->active[Placefix::_h('views')] - = $view->name_list_code; - CFactory::_('Placeholder')->active[Placefix::_h('View')] - = StringHelper::safe( + CFactory::_('Placeholder')->set('view', $view->name_single_code); + CFactory::_('Placeholder')->set('views', $view->name_list_code); + CFactory::_('Placeholder')->set('View', StringHelper::safe( $view->name_single, 'F' - ); - CFactory::_('Placeholder')->active[Placefix::_h('Views')] - = StringHelper::safe( + )); + CFactory::_('Placeholder')->set('Views', StringHelper::safe( $view->name_list, 'F' - ); - CFactory::_('Placeholder')->active[Placefix::_h('VIEW')] - = StringHelper::safe( + )); + CFactory::_('Placeholder')->set('VIEW', StringHelper::safe( $view->name_single, 'U' - ); - CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')] - = StringHelper::safe( + )); + CFactory::_('Placeholder')->set('VIEWS', StringHelper::safe( $view->name_list, 'U' - ); - CFactory::_('Placeholder')->active[Placefix::_('view')] - = CFactory::_('Placeholder')->active[Placefix::_h('view')]; - CFactory::_('Placeholder')->active[Placefix::_('views')] - = CFactory::_('Placeholder')->active[Placefix::_h('views')]; - CFactory::_('Placeholder')->active[Placefix::_('View')] - = CFactory::_('Placeholder')->active[Placefix::_h('View')]; - CFactory::_('Placeholder')->active[Placefix::_('Views')] - = CFactory::_('Placeholder')->active[Placefix::_h('Views')]; - CFactory::_('Placeholder')->active[Placefix::_('VIEW')] - = CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]; - CFactory::_('Placeholder')->active[Placefix::_('VIEWS')] - = CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]; + )); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeModelViewData CFactory::_('Event')->trigger( 'jcb_ce_onBeforeModelViewData', - array(&$this->componentContext, &$view, &$this->placeholders) + array(&$this->componentContext, &$view, &$placeholders) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; + unset($placeholders); // add the tables $view->addtables = (isset($view->addtables) @@ -2343,9 +2325,8 @@ class Get // set the view name $tab['view'] = $view->name_single_code; // load the dynamic data - $tab['html'] = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update($tab['html']), - CFactory::_('Placeholder')->active + $tab['html'] = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update($tab['html']) ); // set the tab name $tab['name'] = (isset($tab['name']) @@ -2425,7 +2406,7 @@ class Get $tab['lang_permission_desc'] = $tab['lang'] . '_TAB_PERMISSION_DESC'; $tab['lang_permission_title'] - = CFactory::_('Placeholder')->active[Placefix::_h('Views')] . ' View ' + = CFactory::_('Placeholder')->get('Views') . ' View ' . $tab['name'] . ' Tab'; CFactory::_('Language')->set( 'both', $tab['lang_permission'], @@ -2435,7 +2416,7 @@ class Get 'both', $tab['lang_permission_desc'], 'Allow the users in this group to view ' . $tab['name'] . ' Tab of ' - . CFactory::_('Placeholder')->active[Placefix::_h('views')] + . CFactory::_('Placeholder')->get('views') ); // set the sort key $tab['sortKey'] @@ -3261,28 +3242,21 @@ class Get } // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterModelViewData CFactory::_('Event')->trigger( 'jcb_ce_onAfterModelViewData', - array(&$this->componentContext, &$view, &$this->placeholders) + array(&$this->componentContext, &$view, &$placeholders) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; + unset($placeholders); // clear placeholders - unset(CFactory::_('Placeholder')->active[Placefix::_h('view')]); - unset(CFactory::_('Placeholder')->active[Placefix::_h('views')]); - unset(CFactory::_('Placeholder')->active[Placefix::_h('View')]); - unset(CFactory::_('Placeholder')->active[Placefix::_h('Views')]); - unset(CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]); - unset(CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('view')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('views')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('View')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('Views')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('VIEW')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('VIEWS')]); + CFactory::_('Placeholder')->remove('view'); + CFactory::_('Placeholder')->remove('views'); + CFactory::_('Placeholder')->remove('View'); + CFactory::_('Placeholder')->remove('Views'); + CFactory::_('Placeholder')->remove('VIEW'); + CFactory::_('Placeholder')->remove('VIEWS'); // store this view to class object $this->_adminViewData[$id] = $view; @@ -4272,10 +4246,10 @@ class Get $option2['operator'] = $operatorArray[$option2['operator']]; $option2['state_key'] - = CFactory::_('Placeholder')->update( + = CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( $option2['state_key'] - ), CFactory::_('Placeholder')->active + ) ); $option2['key'] = $result->key; } @@ -6884,8 +6858,8 @@ class Get $guiMapper = array('table' => 'joomla_module', 'id' => (int) $id, 'type' => 'php'); // update the name if it has dynamic values - $module->name = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update($module->name), CFactory::_('Placeholder')->active + $module->name = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update($module->name) ); // set safe class function name $module->code_name @@ -6927,22 +6901,17 @@ class Get $module->key, CFactory::_('Config')->lang_prefix, $module->official_name ); // set some placeholder for this module - CFactory::_('Placeholder')->active[Placefix::_('Module_name')] - = $module->official_name; - CFactory::_('Placeholder')->active[Placefix::_('Module')] - = ucfirst( + CFactory::_('Placeholder')->set('Module_name', $module->official_name); + CFactory::_('Placeholder')->set('Module', ucfirst( $module->code_name - ); - CFactory::_('Placeholder')->active[Placefix::_('module')] - = strtolower( + )); + CFactory::_('Placeholder')->set('module', strtolower( $module->code_name - ); - CFactory::_('Placeholder')->active[Placefix::_('module.version')] - = $module->module_version; - CFactory::_('Placeholder')->active[Placefix::_('module_version')] - = str_replace( + )); + CFactory::_('Placeholder')->set('module.version', $module->module_version); + CFactory::_('Placeholder')->set('module_version', str_replace( '.', '_', $module->module_version - ); + )); // set description (TODO) add description field to module if (!isset($module->description) || !StringHelper::check( @@ -6953,9 +6922,8 @@ class Get } else { - $module->description = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update($module->description), - CFactory::_('Placeholder')->active + $module->description = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update($module->description) ); CFactory::_('Language')->set( $module->key, $module->lang_prefix . '_DESCRIPTION', @@ -6982,9 +6950,8 @@ class Get // update the readme if set if ($module->addreadme == 1 && !empty($module->readme)) { - $module->readme = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update(base64_decode($module->readme)), - CFactory::_('Placeholder')->active + $module->readme = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update(base64_decode($module->readme)) ); } else @@ -7022,12 +6989,12 @@ class Get // base64 Decode code $module->class_helper_header = PHP_EOL . CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode( $module->class_helper_header ) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ) . PHP_EOL; @@ -7041,10 +7008,10 @@ class Get $guiMapper['field'] = 'class_helper_code'; // base64 Decode code $module->class_helper_code = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($module->class_helper_code) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -7071,10 +7038,10 @@ class Get // set GUI mapper field $guiMapper['field'] = 'mod_code'; $module->mod_code = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($module->mod_code) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -7099,10 +7066,10 @@ class Get // set GUI mapper field $guiMapper['field'] = 'default_header'; $module->default_header = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($module->default_header) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -7119,10 +7086,10 @@ class Get $guiMapper['field'] = 'default'; $guiMapper['type'] = 'html'; $module->default = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($module->default) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -7464,15 +7431,14 @@ class Get // set GUI mapper field $guiMapper['field'] = $scriptMethod . '_' . $scriptType; - $module->{$scriptMethod . '_' . $scriptType} - = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + $module->{$scriptMethod . '_' . $scriptType} = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode( $module->{$scriptMethod . '_' . $scriptType} ) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -7491,9 +7457,8 @@ class Get if ($module->add_sql == 1 && StringHelper::check($module->sql)) { - $module->sql = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update(base64_decode($module->sql)), - CFactory::_('Placeholder')->active + $module->sql = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update(base64_decode($module->sql)) ); } else @@ -7507,10 +7472,10 @@ class Get $module->sql_uninstall )) { - $module->sql_uninstall = CFactory::_('Placeholder')->update( + $module->sql_uninstall = CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($module->sql_uninstall) - ), CFactory::_('Placeholder')->active + ) ); } else @@ -7524,9 +7489,8 @@ class Get $module->update_server_url )) { - $module->update_server_url = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update($module->update_server_url), - CFactory::_('Placeholder')->active + $module->update_server_url = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update($module->update_server_url) ); } // add the update/sales server FTP details if that is the expected protocol @@ -7566,17 +7530,11 @@ class Get $this->langPrefix = $_backup_langPrefix; CFactory::_('Config')->lang_prefix = $_backup_langPrefix; - unset( - CFactory::_('Placeholder')->active[Placefix::_('Module_name')] - ); - unset(CFactory::_('Placeholder')->active[Placefix::_('Module')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('module')]); - unset( - CFactory::_('Placeholder')->active[Placefix::_('module.version')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('module_version')] - ); + CFactory::_('Placeholder')->remove('Module_name'); + CFactory::_('Placeholder')->remove('Module'); + CFactory::_('Placeholder')->remove('module'); + CFactory::_('Placeholder')->remove('module.version'); + CFactory::_('Placeholder')->remove('module_version'); $this->joomlaModules[$id] = $module; @@ -7801,8 +7759,8 @@ class Get $guiMapper = array('table' => 'joomla_plugin', 'id' => (int) $id, 'type' => 'php'); // update the name if it has dynamic values - $plugin->name = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update($plugin->name), CFactory::_('Placeholder')->active + $plugin->name = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update($plugin->name) ); // update the name if it has dynamic values $plugin->code_name @@ -7852,37 +7810,19 @@ class Get $plugin->key, CFactory::_('Config')->lang_prefix, $plugin->official_name ); // set some placeholder for this plugin - CFactory::_('Placeholder')->active[Placefix::_('Plugin_name')] - = $plugin->official_name; - CFactory::_('Placeholder')->active[Placefix::_h('PLUGIN_NAME')] - = $plugin->official_name; - CFactory::_('Placeholder')->active[Placefix::_('Plugin')] - = ucfirst( - $plugin->code_name - ); - CFactory::_('Placeholder')->active[Placefix::_('plugin')] - = strtolower( - $plugin->code_name - ); - CFactory::_('Placeholder')->active[Placefix::_('Plugin_group')] - = ucfirst( - $plugin->group - ); - CFactory::_('Placeholder')->active[Placefix::_('plugin_group')] - = strtolower( - $plugin->group - ); - CFactory::_('Placeholder')->active[Placefix::_('plugin.version')] - = $plugin->plugin_version; - CFactory::_('Placeholder')->active[Placefix::_h('VERSION')] - = $plugin->plugin_version; - CFactory::_('Placeholder')->active[Placefix::_('plugin_version')] - = str_replace( + CFactory::_('Placeholder')->set('Plugin_name', $plugin->official_name); + CFactory::_('Placeholder')->set('PLUGIN_NAME', $plugin->official_name); + CFactory::_('Placeholder')->set('Plugin', ucfirst($plugin->code_name)); + CFactory::_('Placeholder')->set('plugin', strtolower($plugin->code_name)); + CFactory::_('Placeholder')->set('Plugin_group', ucfirst($plugin->group)); + CFactory::_('Placeholder')->set('plugin_group', strtolower($plugin->group)); + CFactory::_('Placeholder')->set('plugin.version', $plugin->plugin_version); + CFactory::_('Placeholder')->set('VERSION', $plugin->plugin_version); + CFactory::_('Placeholder')->set('plugin_version', str_replace( '.', '_', $plugin->plugin_version - ); + )); // set description - CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')] - = ''; + CFactory::_('Placeholder')->set('DESCRIPTION', ''); if (!isset($plugin->description) || !StringHelper::check( $plugin->description @@ -7892,19 +7832,16 @@ class Get } else { - $plugin->description = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update($plugin->description), - CFactory::_('Placeholder')->active + $plugin->description = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update($plugin->description) ); CFactory::_('Language')->set( $plugin->key, $plugin->lang_prefix . '_DESCRIPTION', $plugin->description ); // set description - CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')] - = $plugin->description; - $plugin->description = '

' . $plugin->description - . '

'; + CFactory::_('Placeholder')->set('DESCRIPTION', $plugin->description); + $plugin->description = '

' . $plugin->description . '

'; } $plugin->xml_description = "

" . $plugin->official_name . " (v." . $plugin->plugin_version @@ -7924,9 +7861,8 @@ class Get // update the readme if set if ($plugin->addreadme == 1 && !empty($plugin->readme)) { - $plugin->readme = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update(base64_decode($plugin->readme)), - CFactory::_('Placeholder')->active + $plugin->readme = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update(base64_decode($plugin->readme)) ); } else @@ -7941,10 +7877,10 @@ class Get $guiMapper['field'] = 'main_class_code'; // base64 Decode main_class_code. $plugin->main_class_code = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($plugin->main_class_code) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -7956,10 +7892,10 @@ class Get $guiMapper['field'] = 'head'; // base64 Decode head. $plugin->head = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($plugin->head) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -7968,10 +7904,10 @@ class Get { // base64 Decode head. $plugin->head = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($plugin->class_head) - ), CFactory::_('Placeholder')->active + ) ), array( 'table' => 'class_extends', @@ -7986,10 +7922,10 @@ class Get { // base64 Decode comment. $plugin->comment = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($plugin->comment) - ), CFactory::_('Placeholder')->active + ) ), array( 'table' => 'class_extends', @@ -8292,13 +8228,13 @@ class Get . $scriptType; $plugin->{$scriptMethod . '_' . $scriptType} = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode( $plugin->{$scriptMethod . '_' . $scriptType} ) - ), CFactory::_('Placeholder')->active + ) ), $guiMapper ); @@ -8317,9 +8253,8 @@ class Get if ($plugin->add_sql == 1 && StringHelper::check($plugin->sql)) { - $plugin->sql = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update(base64_decode($plugin->sql)), - CFactory::_('Placeholder')->active + $plugin->sql = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update(base64_decode($plugin->sql)) ); } else @@ -8333,10 +8268,10 @@ class Get $plugin->sql_uninstall )) { - $plugin->sql_uninstall = CFactory::_('Placeholder')->update( + $plugin->sql_uninstall = CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode($plugin->sql_uninstall) - ), CFactory::_('Placeholder')->active + ) ); } else @@ -8350,9 +8285,8 @@ class Get $plugin->update_server_url )) { - $plugin->update_server_url = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update($plugin->update_server_url), - CFactory::_('Placeholder')->active + $plugin->update_server_url = CFactory::_('Placeholder')->update_( + CFactory::_('Customcode')->update($plugin->update_server_url) ); } // add the update/sales server FTP details if that is the expected protocol @@ -8392,32 +8326,16 @@ class Get $this->langPrefix = $_backup_langPrefix; CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); - unset( - CFactory::_('Placeholder')->active[Placefix::_('Plugin_name')] - ); - unset(CFactory::_('Placeholder')->active[Placefix::_('Plugin')]); - unset(CFactory::_('Placeholder')->active[Placefix::_('plugin')]); - unset( - CFactory::_('Placeholder')->active[Placefix::_('Plugin_group')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('plugin_group')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('plugin.version')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('plugin_version')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_h('VERSION')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_h('PLUGIN_NAME')] - ); + CFactory::_('Placeholder')->remove('Plugin_name'); + CFactory::_('Placeholder')->remove('Plugin'); + CFactory::_('Placeholder')->remove('plugin'); + CFactory::_('Placeholder')->remove('Plugin_group'); + CFactory::_('Placeholder')->remove('plugin_group'); + CFactory::_('Placeholder')->remove('plugin.version'); + CFactory::_('Placeholder')->remove('plugin_version'); + CFactory::_('Placeholder')->remove('VERSION'); + CFactory::_('Placeholder')->remove('DESCRIPTION'); + CFactory::_('Placeholder')->remove('PLUGIN_NAME'); $this->joomlaPlugins[$id] = $plugin; diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index b538e253e..157baebbc 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -3087,8 +3087,8 @@ class Structure extends Get '//', '/', $custom['file'] ); // update the dynamic component name placholders in file names - $custom['path'] = CFactory::_('Placeholder')->update( - $custom['path'], CFactory::_('Placeholder')->active + $custom['path'] = CFactory::_('Placeholder')->update_( + $custom['path'] ); // get the path info $pathInfo = pathinfo($custom['path']); @@ -3227,10 +3227,10 @@ class Structure extends Get */ protected function updateDynamicPath($path) { - return CFactory::_('Placeholder')->update( + return CFactory::_('Placeholder')->update_( CFactory::_('Placeholder')->update( $path, ComponentbuilderHelper::$constantPaths - ), CFactory::_('Placeholder')->active + ) ); } diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index e04d4e2cb..ffda6edd9 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -403,9 +403,9 @@ class Fields extends Structure } // main lang prefix $langView = CFactory::_('Config')->lang_prefix . '_' - . CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]; + . CFactory::_('Placeholder')->get('VIEW'); $langViews = CFactory::_('Config')->lang_prefix . '_' - . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]; + . CFactory::_('Placeholder')->get('VIEWS'); // set default lang CFactory::_('Language')->set( CFactory::_('Config')->lang_target, $langView, $view['settings']->name_single @@ -607,17 +607,16 @@ class Fields extends Structure // set the custom table key $dbkey = 'g'; // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFields CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$this->placeholders, &$langView, + &$nameListCode, &$placeholders, &$langView, &$langViews) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; + unset($placeholders); // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { @@ -628,17 +627,16 @@ class Fields extends Structure ); } // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFields CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$this->placeholders, &$langView, + &$nameListCode, &$placeholders, &$langView, &$langViews) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; + unset($placeholders); // set the default fields $fieldSet = array(); $fieldSet[] = '
'; @@ -1026,17 +1024,16 @@ class Fields extends Structure // set the custom table key $dbkey = 'g'; // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFields CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$this->placeholders, &$langView, + &$nameListCode, &$placeholders, &$langView, &$langViews) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; + unset($placeholders); // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { @@ -1047,17 +1044,16 @@ class Fields extends Structure ); } // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFields CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$nameSingleCode, - &$nameListCode, &$this->placeholders, &$langView, + &$nameListCode, &$placeholders, &$langView, &$langViews) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; + unset($placeholders); // set the default fields $XML = new simpleXMLElement(''); $fieldSetXML = $XML->addChild('fieldset'); @@ -4752,11 +4748,11 @@ class Fields extends Structure else { // get it from the field xml string - $listFieldName = (string) CFactory::_('Placeholder')->update( + $listFieldName = (string) CFactory::_('Placeholder')->update_( GetHelper::between( $field['settings']->xml, 'label="', '"' - ), CFactory::_('Placeholder')->active + ) ); } // make sure there is no html in the list field name @@ -4954,10 +4950,10 @@ class Fields extends Structure $otherView = $nameSingleCode; } // get the xml extension name - $_extension = CFactory::_('Placeholder')->update( + $_extension = CFactory::_('Placeholder')->update_( GetHelper::between( $field['settings']->xml, 'extension="', '"' - ), CFactory::_('Placeholder')->active + ) ); // if they left out the extension for some reason if (!StringHelper::check($_extension)) @@ -5332,12 +5328,11 @@ class Fields extends Structure if (isset($data['custom']) && isset($data['custom']['extends']) && ((isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1) - || !isset( - $this->fileContentDynamic['customfield_' . $data['type']] - ) + || !CFactory::_('Content')->exist_('customfield_' . $data['type']) || !ArrayHelper::check( - $this->fileContentDynamic['customfield_' . $data['type']] - ))) + CFactory::_('Content')->get_('customfield_' . $data['type']) + ) + )) { // set J prefix $jprefix = 'J'; @@ -5416,18 +5411,17 @@ class Fields extends Structure $replace[$globalPlaceholder] = $gloabalValue; } // start loading the field type - $this->fileContentDynamic['customfield_' . $data['type']] = array(); + // $this->fileContentDynamic['customfield_' . $data['type']] = array(); // JPREFIX <<>> - $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('JPREFIX')] - = $jprefix; + CFactory::_('Content')->set_('customfield_' . $data['type'], 'JPREFIX', $jprefix); // Type <<>> - $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('Type')] - = StringHelper::safe( - $data['custom']['type'], 'F' + CFactory::_('Content')->set_('customfield_' . $data['type'], 'Type', + StringHelper::safe( + $data['custom']['type'], 'F' + ) ); // type <<>> - $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('type')] - = StringHelper::safe($data['custom']['type']); + CFactory::_('Content')->set_('customfield_' . $data['type'], 'type', StringHelper::safe($data['custom']['type'])); // is this a own custom field if (isset($data['custom']['own_custom'])) { @@ -5457,28 +5451,28 @@ class Fields extends Structure ); // JFORM_TYPE_HEADER <<>> $add_default_header = true; - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] - = "//" . Line::_( + CFactory::_('Content')->set_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER', + "//" . Line::_( __LINE__,__CLASS__ ) . " Import the " . $JFORM_extends - . " field type classes needed"; + . " field type classes needed" + ); // JFORM_extens <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_extends')] - = $JFORM_extends; + CFactory::_('Content')->set_('customfield_' . $data['type'], + 'JFORM_extends', $JFORM_extends + ); // JFORM_EXTENDS <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_EXTENDS')] - = StringHelper::safe( - $data['custom']['extends'], 'F' + CFactory::_('Content')->set_('customfield_' . $data['type'], 'JFORM_EXTENDS', + StringHelper::safe( + $data['custom']['extends'], 'F' + ) ); // JFORM_TYPE_PHP <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_PHP')] - = PHP_EOL . PHP_EOL . Indent::_(1) . "//" . Line::_( + CFactory::_('Content')->set_('customfield_' . $data['type'], 'JFORM_TYPE_PHP', + PHP_EOL . PHP_EOL . Indent::_(1) . "//" . Line::_( __LINE__,__CLASS__ - ) . " A " . $data['custom']['own_custom'] . " Field"; + ) . " A " . $data['custom']['own_custom'] . " Field" + ); // load the other PHP options foreach (ComponentbuilderHelper::$phpFieldArray as $x) { @@ -5502,46 +5496,43 @@ class Fields extends Structure // check if this is header text if ('HEADER' === $x) { - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] - .= PHP_EOL . CFactory::_('Placeholder')->update( + CFactory::_('Content')->add_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER', + PHP_EOL . CFactory::_('Placeholder')->update( $phpBucket, $replace - ); + ) + ); // stop default headers from loading $add_default_header = false; } else { // JFORM_TYPE_PHP <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_PHP')] - .= PHP_EOL . CFactory::_('Placeholder')->update( + CFactory::_('Content')->add_('customfield_' . $data['type'], 'JFORM_TYPE_PHP', + PHP_EOL . CFactory::_('Placeholder')->update( $phpBucket, $replace - ); + ) + ); } } } // check if we should add default header if ($add_default_header) { - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] - .= PHP_EOL . "jimport('joomla.form.helper');"; - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] - .= PHP_EOL . "JFormHelper::loadFieldClass('" - . $JFORM_extends . "');"; + CFactory::_('Content')->add_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER', + PHP_EOL . "jimport('joomla.form.helper');" + ); + CFactory::_('Content')->add_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER', + PHP_EOL . "JFormHelper::loadFieldClass('" . $JFORM_extends . "');" + ); } // check the the JFormHelper::loadFieldClass(..) was set - elseif (strpos( - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')], 'JFormHelper::loadFieldClass(' - ) === false) + elseif (strpos(CFactory::_('Content')->get_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER'), + 'JFormHelper::loadFieldClass(') === false) { - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] - .= PHP_EOL . "JFormHelper::loadFieldClass('" - . $JFORM_extends . "');"; + CFactory::_('Content')->add_('customfield_' . $data['type'], 'JFORM_TYPE_HEADER', + PHP_EOL . "JFormHelper::loadFieldClass('" + . $JFORM_extends . "');" + ); } } else @@ -5637,25 +5628,25 @@ class Fields extends Structure // build the Group Control $this->setGroupControl[$data['type']] = $groupLangName; // JFORM_GETGROUPS_PHP <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_GETGROUPS_PHP')] - = $phpCode; + CFactory::_('Content')->set_('customfield_' . $data['type'], 'JFORM_GETGROUPS_PHP', + $phpCode + ); // JFORM_GETEXCLUDED_PHP <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_GETEXCLUDED_PHP')] - = $phpxCode; + CFactory::_('Content')->set_('customfield_' . $data['type'], 'JFORM_GETEXCLUDED_PHP', + $phpxCode + ); } else { // JFORM_GETOPTIONS_PHP <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('JFORM_GETOPTIONS_PHP')] - = $phpCode; + CFactory::_('Content')->set_('customfield_' . $data['type'], 'JFORM_GETOPTIONS_PHP', + $phpCode + ); } // type <<>> - $this->fileContentDynamic['customfield_' - . $data['type']][Placefix::_h('ADD_BUTTON')] - = $this->setAddButtonToListField($data['custom']); + CFactory::_('Content')->set_('customfield_' . $data['type'], 'ADD_BUTTON', + $this->setAddButtonToListField($data['custom']) + ); } } // if this field gets used in plugin or module we should track it so if needed we can copy it over @@ -6065,42 +6056,34 @@ class Fields extends Structure public function setFilterFieldFile($getOptions, $filter) { // make sure it is not already been build - if (!isset( - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']] - ) + if (!CFactory::_('Content')->exist_('customfilterfield_' . $filter['filter_type']) || !ArrayHelper::check( - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']] + CFactory::_('Content')->get_('customfilterfield_' . $filter['filter_type']) ) ) { // start loading the field type - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']] - = array(); + // $this->fileContentDynamic['customfilterfield_' + // . $filter['filter_type']] + // = array(); // JPREFIX <>> - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][Placefix::_h('JPREFIX')] - = 'J'; + CFactory::_('Content')->set_('customfilterfield_' . $filter['filter_type'], 'JPREFIX', 'J'); // Type <<>> - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][Placefix::_h('Type')] - = StringHelper::safe( - $filter['filter_type'], 'F' + CFactory::_('Content')->set_('customfilterfield_' . $filter['filter_type'], 'Type', + StringHelper::safe( + $filter['filter_type'], 'F' + ) ); // type <<>> - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][Placefix::_h('type')] - = StringHelper::safe($filter['filter_type']); + CFactory::_('Content')->set_('customfilterfield_' . $filter['filter_type'], 'type', + StringHelper::safe($filter['filter_type']) + ); // JFORM_GETOPTIONS_PHP <<>> - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][Placefix::_h('JFORM_GETOPTIONS_PHP')] - = $getOptions; + CFactory::_('Content')->set_('customfilterfield_' . $filter['filter_type'], 'JFORM_GETOPTIONS_PHP', + $getOptions + ); // ADD_BUTTON <<>> - $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][Placefix::_h('ADD_BUTTON')] - = ''; + CFactory::_('Content')->set_('customfilterfield_' . $filter['filter_type'], 'ADD_BUTTON', ''); // now build the custom filter field type file $target = array('admin' => 'customfilterfield'); $this->buildDynamique( @@ -6153,8 +6136,8 @@ class Fields extends Structure $fieldData['component'], Placefix::b() ) !== false) // should not be needed... but { - $fieldData['component'] = CFactory::_('Placeholder')->update( - $fieldData['component'], CFactory::_('Placeholder')->active + $fieldData['component'] = CFactory::_('Placeholder')->update_( + $fieldData['component'] ); } // get core permissions diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index f2f7c94cc..0b133b065 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -277,8 +277,7 @@ class Interpretation extends Fields if ($done) { // the text for the file BAKING - $this->fileContentDynamic['emailer_' . $component][Placefix::_h('BAKING')] - = ''; // <<-- to insure it gets updated + CFactory::_('Content')->set_('emailer_' . $component, 'BAKING', ''); // <<-- to insure it gets updated // return the code need to load the abstract class return PHP_EOL . "JLoader::register('" . $Component . "Email', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/" @@ -324,17 +323,14 @@ class Interpretation extends Fields /** * set Lock License Per * - * @param type $view - * @param type $target + * @param string $view + * @param string $target */ public function setLockLicensePer(&$view, $target) { - if ($this->componentData->add_license - && $this->componentData->license_type == 3) + if ($this->componentData->add_license && $this->componentData->license_type == 3) { - if (!isset( - $this->fileContentDynamic[$view][Placefix::_h('BOOLMETHOD')] - )) + if (!CFactory::_('Content')->exist_($view, 'BOOLMETHOD')) { $boolMethod = 'get' . StringHelper::safe( $this->uniquekey(3, false, 'ddd'), 'W' @@ -343,25 +339,21 @@ class Interpretation extends Fields $this->uniquekey(3), 'W' ); // add it to the system - $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_SET_BOOL')] - = $this->setBoolLicenseLock($boolMethod, $globalbool); - $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_CHECK')] - = $this->checkStatmentLicenseLocked($boolMethod); - $this->fileContentDynamic[$view][Placefix::_h('LICENSE_TABLE_LOCKED_CHECK')] - = $this->checkStatmentLicenseLocked($boolMethod, '$table'); - $this->fileContentDynamic[$view][Placefix::_h('BOOLMETHOD')] - = $boolMethod; + CFactory::_('Content')->set_($view, 'LICENSE_LOCKED_SET_BOOL', + $this->setBoolLicenseLock($boolMethod, $globalbool)); + CFactory::_('Content')->set_($view, 'LICENSE_LOCKED_CHECK', + $this->checkStatmentLicenseLocked($boolMethod)); + CFactory::_('Content')->set_($view, 'LICENSE_TABLE_LOCKED_CHECK', + $this->checkStatmentLicenseLocked($boolMethod, '$table')); + CFactory::_('Content')->set_($view, 'BOOLMETHOD', $boolMethod); } } else { // don't add it to the system - $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_SET_BOOL')] - = ''; - $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_CHECK')] - = ''; - $this->fileContentDynamic[$view][Placefix::_h('LICENSE_TABLE_LOCKED_CHECK')] - = ''; + CFactory::_('Content')->set_($view, 'LICENSE_LOCKED_SET_BOOL', ''); + CFactory::_('Content')->set_($view, 'LICENSE_LOCKED_CHECK', ''); + CFactory::_('Content')->set_($view, 'LICENSE_TABLE_LOCKED_CHECK', ''); } } @@ -834,8 +826,7 @@ class Interpretation extends Fields $target = array('admin' => 'whmcs'); $done = $this->buildDynamique($target, 'whmcs'); // the text for the file WHMCS_ENCRYPTION_BODY - $this->fileContentDynamic['whmcs'][Placefix::_h('WHMCS_ENCRYPTION_BODY')] - = $this->setWHMCSCryption(); + CFactory::_('Content')->set_('whmcs', 'WHMCS_ENCRYPTION_BODY', $this->setWHMCSCryption()); // ENCRYPT_FILE CFactory::_('Content')->set('WHMCS_ENCRYPT_FILE', PHP_EOL . Indent::_(3) . "whmcs.php"); } @@ -1127,8 +1118,7 @@ class Interpretation extends Fields $name = explode('.xml', $name)[0]; $target = array('admin' => $name); $this->buildDynamique($target, 'update_server'); - $this->fileContentDynamic[$name][Placefix::_h('UPDATE_SERVER_XML')] - = implode(PHP_EOL, $updateXML); + CFactory::_('Content')->set_($name, 'UPDATE_SERVER_XML', implode(PHP_EOL, $updateXML)); // set the Update server file name $this->updateServerFileName = $name; @@ -1279,8 +1269,8 @@ class Interpretation extends Fields // setup SQL if (StringHelper::check($update['mysql'])) { - $update['mysql'] = CFactory::_('Placeholder')->update( - $update['mysql'], CFactory::_('Placeholder')->active + $update['mysql'] = CFactory::_('Placeholder')->update_( + $update['mysql'] ); } // add dynamic SQL @@ -1313,9 +1303,9 @@ class Interpretation extends Fields $name = StringHelper::safe($update['version']); $target = array('admin' => $name); $this->buildDynamique($target, 'sql_update', $update['version']); - $this->fileContentDynamic[$name . '_' - . $update['version']][Placefix::_h('UPDATE_VERSION_MYSQL')] - = $update['mysql']; + CFactory::_('Content')->set_($name . '_' . $update['version'], 'UPDATE_VERSION_MYSQL', + $update['mysql'] + ); } elseif (isset($update['url']) && StringHelper::check( @@ -1428,8 +1418,7 @@ class Interpretation extends Fields // HELP_SITE CFactory::_('Content')->set('HELP_SITE', $this->setHelp(2)); // to make sure the file is updated TODO - $this->fileContentDynamic['help'][Placefix::_h('BLABLA')] - = 'blabla'; + CFactory::_('Content')->set_('help', 'BLABLA', 'blabla'); return true; } @@ -2414,9 +2403,8 @@ class Interpretation extends Fields . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " Get data"; // set the selection - $getItem .= PHP_EOL . CFactory::_('Placeholder')->update( - $the_get['selection']['select'], - CFactory::_('Placeholder')->active + $getItem .= PHP_EOL . CFactory::_('Placeholder')->update_( + $the_get['selection']['select'] ); } // load the from selection @@ -3592,8 +3580,8 @@ class Interpretation extends Fields $get->php_before_getitem )) { - $getItem .= CFactory::_('Placeholder')->update( - $get->php_before_getitem, CFactory::_('Placeholder')->active + $getItem .= CFactory::_('Placeholder')->update_( + $get->php_before_getitem ); } // start loadin the get Item @@ -3637,8 +3625,8 @@ class Interpretation extends Fields && isset($get->php_after_getitem) && StringHelper::check($get->php_after_getitem)) { - $getItem .= CFactory::_('Placeholder')->update( - $get->php_after_getitem, CFactory::_('Placeholder')->active + $getItem .= CFactory::_('Placeholder')->update_( + $get->php_after_getitem ); } // check the getItem string to see if we should still add set query to data @@ -3856,8 +3844,8 @@ class Interpretation extends Fields if ($get->addcalculation == 1) { $get->php_calculation = (array) explode( - PHP_EOL, CFactory::_('Placeholder')->update( - $get->php_calculation, CFactory::_('Placeholder')->active + PHP_EOL, CFactory::_('Placeholder')->update_( + $get->php_calculation ) ); $getItem .= PHP_EOL . Indent::_(1) . $tab @@ -4003,8 +3991,8 @@ class Interpretation extends Fields $view->php_getlistquery )) { - $main .= CFactory::_('Placeholder')->update( - $view->php_getlistquery, CFactory::_('Placeholder')->active + $main .= CFactory::_('Placeholder')->update_( + $view->php_getlistquery ); } // SITE_GET_LIST_QUERY <<>> @@ -4019,8 +4007,8 @@ class Interpretation extends Fields $view->php_before_getitems )) { - $main .= CFactory::_('Placeholder')->update( - $view->php_before_getitems, CFactory::_('Placeholder')->active + $main .= CFactory::_('Placeholder')->update_( + $view->php_before_getitems ); } // load the object list @@ -4039,8 +4027,8 @@ class Interpretation extends Fields $view->php_after_getitems )) { - $main .= CFactory::_('Placeholder')->update( - $view->php_after_getitems, CFactory::_('Placeholder')->active + $main .= CFactory::_('Placeholder')->update_( + $view->php_after_getitems ); } $main .= PHP_EOL . PHP_EOL . Indent::_(2) @@ -4940,8 +4928,8 @@ class Interpretation extends Fields $_tmp = PHP_EOL . Indent::_(4) . implode( PHP_EOL . Indent::_(4), $get->php_calculation ); - $getItem .= CFactory::_('Placeholder')->update( - $_tmp, CFactory::_('Placeholder')->active + $getItem .= CFactory::_('Placeholder')->update_( + $_tmp ); } } @@ -5117,8 +5105,8 @@ class Interpretation extends Fields PHP_EOL . Indent::_(2), $view['settings']->php_jview_display ); - $method .= CFactory::_('Placeholder')->update( - $_tmp, CFactory::_('Placeholder')->active + $method .= CFactory::_('Placeholder')->update_( + $_tmp ); } } @@ -5239,69 +5227,67 @@ class Interpretation extends Fields $TARGET = StringHelper::safe(CFactory::_('Config')->build_target, 'U'); // set libraries $TARGET.'_LIBRARIES_LOADER - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_LIBRARIES_LOADER' )] - = $this->setLibrariesLoader($view); + CFactory::_('Content')->set_($view['settings']->code,$TARGET . '_LIBRARIES_LOADER', + $this->setLibrariesLoader($view) + ); // set uikit $TARGET.'_UIKIT_LOADER - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_UIKIT_LOADER' )] - = $this->setUikitLoader($view); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_UIKIT_LOADER', + $this->setUikitLoader($view) + ); // set Google Charts $TARGET.'_GOOGLECHART_LOADER - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_GOOGLECHART_LOADER' )] - = $this->setGoogleChartLoader($view); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_GOOGLECHART_LOADER', + $this->setGoogleChartLoader($view) + ); // set Footable FOOTABLE_LOADER - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_FOOTABLE_LOADER' )] - = $this->setFootableScriptsLoader($view); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_FOOTABLE_LOADER', + $this->setFootableScriptsLoader($view) + ); // set metadata DOCUMENT_METADATA - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_DOCUMENT_METADATA' )] - = $this->setDocumentMetadata($view); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_DOCUMENT_METADATA', + $this->setDocumentMetadata($view) + ); // set custom php scripting DOCUMENT_CUSTOM_PHP - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_DOCUMENT_CUSTOM_PHP' )] - = $this->setDocumentCustomPHP($view); + CFactory::_('Content')->set_($view['settings']->code,$TARGET . '_DOCUMENT_CUSTOM_PHP', + $this->setDocumentCustomPHP($view) + ); // set custom css DOCUMENT_CUSTOM_CSS - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_DOCUMENT_CUSTOM_CSS' )] - = $this->setDocumentCustomCSS($view); + CFactory::_('Content')->set_($view['settings']->code,$TARGET . '_DOCUMENT_CUSTOM_CSS', + $this->setDocumentCustomCSS($view) + ); // set custom javascript DOCUMENT_CUSTOM_JS - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_DOCUMENT_CUSTOM_JS' )] - = $this->setDocumentCustomJS($view); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_DOCUMENT_CUSTOM_JS', + $this->setDocumentCustomJS($view) + ); // set custom css file VIEWCSS - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_VIEWCSS' )] - = $this->setCustomCSS($view); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_VIEWCSS', + $this->setCustomCSS($view) + ); // incase no buttons are found - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_JAVASCRIPT_FOR_BUTTONS')] - = ''; + CFactory::_('Content')->set_($view['settings']->code, 'SITE_JAVASCRIPT_FOR_BUTTONS', ''); // set the custom buttons CUSTOM_BUTTONS - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS' )] - = $this->setCustomButtons($view); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_CUSTOM_BUTTONS', + $this->setCustomButtons($view) + ); // see if we should add get modules to the view.html - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_GET_MODULE' )] - = $this->setGetModules($view, $TARGET); + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_GET_MODULE', + $this->setGetModules($view, $TARGET) + ); // set a JavaScript file if needed - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_LIBRARIES_LOADER' )] - .= $this->setJavaScriptFile($view, $TARGET); - + CFactory::_('Content')->add_($view['settings']->code, $TARGET . '_LIBRARIES_LOADER', + $this->setJavaScriptFile($view, $TARGET) + ); // fix just incase we missed it somewhere CFactory::_('Config')->lang_target = $tmp; } @@ -5397,15 +5383,13 @@ class Interpretation extends Fields $addModule[] = Indent::_(2) . "return false;"; $addModule[] = Indent::_(1) . "}"; - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_GET_MODULE_JIMPORT')] - = PHP_EOL . "jimport('joomla.application.module.helper');"; + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_GET_MODULE_JIMPORT', + PHP_EOL . "jimport('joomla.application.module.helper');" + ); return implode(PHP_EOL, $addModule); } - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_GET_MODULE_JIMPORT')] - = ''; + CFactory::_('Content')->set_($view['settings']->code, $TARGET . '_GET_MODULE_JIMPORT', ''); return ''; } @@ -5425,7 +5409,7 @@ class Interpretation extends Fields PHP_EOL . Indent::_(2), $view['settings']->php_document ); - return CFactory::_('Placeholder')->update($_tmp, CFactory::_('Placeholder')->active); + return CFactory::_('Placeholder')->update_($_tmp); } } @@ -5449,11 +5433,9 @@ class Interpretation extends Fields $viewCodeName = $view['settings']->name_single_code; } // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_CONTROLLER' )] = ''; + CFactory::_('Content')->set_($viewCodeName, $TARGET . '_CUSTOM_BUTTONS_CONTROLLER', ''); // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_METHOD' )] = ''; + CFactory::_('Content')->set_($viewCodeName, $TARGET . '_CUSTOM_BUTTONS_METHOD', ''); } elseif (3 == $type) { @@ -5461,13 +5443,9 @@ class Interpretation extends Fields $viewCodeName = $view['settings']->name_single_code; $viewsCodeName = $view['settings']->name_list_code; // set the custom buttons CUSTOM_BUTTONS_CONTROLLER_LIST - $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_CONTROLLER_LIST' )] - = ''; + CFactory::_('Content')->set_($viewsCodeName, $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST', ''); // set the custom buttons CUSTOM_BUTTONS_METHOD_LIST - $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_METHOD_LIST' )] - = ''; + CFactory::_('Content')->set_($viewsCodeName, $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST', ''); // validate selection $validateSelection = 'true'; } @@ -5477,38 +5455,36 @@ class Interpretation extends Fields if (CFactory::_('Config')->build_target === 'site') { // set the custom buttons SITE_TOP_BUTTON - $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')] - = ''; + CFactory::_('Content')->set_($viewCodeName, 'SITE_TOP_BUTTON', ''); // set the custom buttons SITE_BOTTOM_BUTTON - $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')] - = ''; + CFactory::_('Content')->set_($viewCodeName, 'SITE_BOTTOM_BUTTON', ''); // load into place switch ($view['settings']->button_position) { case 1: // set buttons to top right of the view - $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')] - = '
toolbar->render(); ?>
'; + CFactory::_('Content')->set_($viewCodeName, 'SITE_TOP_BUTTON', + '
toolbar->render(); ?>
' + ); break; case 2: // set buttons to top left of the view - $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')] - = 'toolbar->render(); ?>'; + CFactory::_('Content')->set_($viewCodeName, 'SITE_TOP_BUTTON', 'toolbar->render(); ?>'); break; case 3: // set buttons to buttom right of the view - $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')] - = '
toolbar->render(); ?>
'; + CFactory::_('Content')->set_($viewCodeName, 'SITE_BOTTOM_BUTTON', + '
toolbar->render(); ?>
' + ); break; case 4: // set buttons to buttom left of the view - $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')] - = 'toolbar->render(); ?>'; + CFactory::_('Content')->set_($viewCodeName, 'SITE_BOTTOM_BUTTON', 'toolbar->render(); ?>'); break; case 5: // set buttons to buttom left of the view - CFactory::_('Placeholder')->active[Placefix::_('SITE_TOOLBAR')] - = 'toolbar->render(); ?>'; + CFactory::_('Placeholder')->set_('SITE_TOOLBAR', + 'toolbar->render(); ?>'); break; } } @@ -5671,12 +5647,10 @@ class Interpretation extends Fields && $view['settings']->php_controller_list != '//') { // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_CONTROLLER_LIST')] - = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $view['settings']->php_controller_list, - CFactory::_('Placeholder')->active - ); + CFactory::_('Content')->set_($viewsCodeName, $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST', + PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + $view['settings']->php_controller_list + )); } // load the model if (isset($view['settings']->php_model_list) @@ -5686,12 +5660,10 @@ class Interpretation extends Fields && $view['settings']->php_model_list != '//') { // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_METHOD_LIST')] - = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $view['settings']->php_model_list, - CFactory::_('Placeholder')->active - ); + CFactory::_('Content')->set_($viewsCodeName,$TARGET + . '_CUSTOM_BUTTONS_METHOD_LIST', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + $view['settings']->php_model_list + )); } } else @@ -5703,12 +5675,10 @@ class Interpretation extends Fields && $view['settings']->php_controller != '//') { // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_CONTROLLER')] - = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $view['settings']->php_controller, - CFactory::_('Placeholder')->active - ); + CFactory::_('Content')->set_($viewCodeName,$TARGET + . '_CUSTOM_BUTTONS_CONTROLLER', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + $view['settings']->php_controller + )); if ('site' === CFactory::_('Config')->build_target) { // add the controller for this view @@ -5725,11 +5695,11 @@ class Interpretation extends Fields && $view['settings']->php_model != '//') { // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET - . '_CUSTOM_BUTTONS_METHOD')] - = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $view['settings']->php_model, $this->placeholders - ); + CFactory::_('Content')->set_($viewCodeName,$TARGET + . '_CUSTOM_BUTTONS_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + $view['settings']->php_model + ) + ); } } } @@ -5754,9 +5724,9 @@ class Interpretation extends Fields ) === false)) { // set the custom get form method JAVASCRIPT_FOR_BUTTONS - $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET - . '_JAVASCRIPT_FOR_BUTTONS')] - = $this->setJavaScriptForButtons(); + CFactory::_('Content')->set_($viewCodeName,$TARGET + . '_JAVASCRIPT_FOR_BUTTONS', $this->setJavaScriptForButtons() + ); } // insure the form is added (only if no form exist) if (isset($view['settings']->default) @@ -5810,8 +5780,8 @@ class Interpretation extends Fields { if (StringHelper::check($view['settings']->css)) { - return CFactory::_('Placeholder')->update( - $view['settings']->css, $this->placeholders + return CFactory::_('Placeholder')->update_( + $view['settings']->css ); } } @@ -5841,8 +5811,8 @@ class Interpretation extends Fields ) ); - return $script . CFactory::_('Placeholder')->update( - $cssDocument, $this->placeholders + return $script . CFactory::_('Placeholder')->update_( + $cssDocument ) . PHP_EOL . Indent::_(2) . '");'; } } @@ -5879,11 +5849,10 @@ class Interpretation extends Fields . $view['settings']->code . '.js'; } // add script to file - $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET - . '_JAVASCRIPT_FILE')] - = CFactory::_('Placeholder')->update( - $view['settings']->javascript_file, $this->placeholders - ); + CFactory::_('Content')->set_($view['settings']->code,$TARGET + . '_JAVASCRIPT_FILE', CFactory::_('Placeholder')->update_( + $view['settings']->javascript_file + )); // add script to view return PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( @@ -5917,8 +5886,8 @@ class Interpretation extends Fields ) ); - return $script . CFactory::_('Placeholder')->update( - $jsDocument, $this->placeholders + return $script . CFactory::_('Placeholder')->update_( + $jsDocument ) . PHP_EOL . Indent::_(2) . '");'; } } @@ -6171,11 +6140,11 @@ class Interpretation extends Fields $this->libraries[$id]->document )) { - $setter .= PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( + $setter .= PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( str_replace( '$document->', '$this->document->', $this->libraries[$id]->document - ), $this->placeholders + ) ); } elseif (isset($this->libraries[$id]) @@ -6749,8 +6718,8 @@ class Interpretation extends Fields { if ($view['settings']->add_php_jview == 1) { - return PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $view['settings']->php_jview, $this->placeholders + return PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + $view['settings']->php_jview ); } @@ -6791,69 +6760,69 @@ class Interpretation extends Fields ) !== false); // add pagination start - CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONSTART')] - = PHP_EOL - . 'items) && isset($this->pagination) && isset($this->pagination->pagesTotal) && $this->pagination->pagesTotal > 1): ?>'; - CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONSTART')] - .= PHP_EOL . Indent::_(1) . ''); + CFactory::_('Placeholder')->add_('PAGINATIONEND', + PHP_EOL . ''); // add limit box - CFactory::_('Placeholder')->active[Placefix::_('LIMITBOX')] - = 'pagination->getLimitBox(); ?>'; + CFactory::_('Placeholder')->set_('LIMITBOX', + 'pagination->getLimitBox(); ?>'); // add pages counter - CFactory::_('Placeholder')->active[Placefix::_('PAGESCOUNTER')] - = 'pagination->getPagesCounter(); ?>'; + CFactory::_('Placeholder')->set_('PAGESCOUNTER', + 'pagination->getPagesCounter(); ?>'); // add pages links if (CFactory::_('Config')->build_target === 'custom_admin') { - CFactory::_('Placeholder')->active[Placefix::_('PAGESLINKS')] - = 'pagination->getListFooter(); ?>'; + CFactory::_('Placeholder')->set_('PAGESLINKS', + 'pagination->getListFooter(); ?>'); } else { - CFactory::_('Placeholder')->active[Placefix::_('PAGESLINKS')] - = 'pagination->getPagesLinks(); ?>'; + CFactory::_('Placeholder')->set_('PAGESLINKS', + 'pagination->getPagesLinks(); ?>'); } // build body $body = array(); // Load the default values to the body - $body[] = CFactory::_('Placeholder')->update( - $view['settings']->default, $this->placeholders + $body[] = CFactory::_('Placeholder')->update_( + $view['settings']->default ); + // add pagination start if (!$has_pagination_start) { - $body[] = CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONSTART')]; + $body[] = CFactory::_('Placeholder')->get_('PAGINATIONSTART'); } if (!$has_limitbox && !$has_pagescounter) @@ -6874,24 +6843,16 @@ class Interpretation extends Fields // add pagination end if (!$has_pagination_end) { - $body[] = CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONEND')]; + $body[] = CFactory::_('Placeholder')->get_('PAGINATIONEND'); } + // lets clear the placeholders just in case - unset( - CFactory::_('Placeholder')->active[Placefix::_('LIMITBOX')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('PAGESCOUNTER')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('PAGESLINKS')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONSTART')] - ); - unset( - CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONEND')] - ); + CFactory::_('Placeholder')->remove_('LIMITBOX'); + CFactory::_('Placeholder')->remove_('PAGESCOUNTER'); + CFactory::_('Placeholder')->remove_('PAGESLINKS'); + CFactory::_('Placeholder')->remove_('PAGINATIONSTART'); + CFactory::_('Placeholder')->remove_('PAGINATIONEND'); + // insure the form is added (only if no form exist) if (strpos($view['settings']->default, 'update( - $view['settings']->default, $this->placeholders + return PHP_EOL . CFactory::_('Placeholder')->update_( + $view['settings']->default ); } } @@ -7026,7 +6987,7 @@ class Interpretation extends Fields PHP_EOL, $view['settings']->php_view ); - return CFactory::_('Placeholder')->update($_tmp, $this->placeholders); + return CFactory::_('Placeholder')->update_($_tmp); } } @@ -7058,17 +7019,15 @@ class Interpretation extends Fields CFactory::_('Config')->build_target, 'U' ); // SITE_TEMPLATE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code . '_' - . $template][Placefix::_h($TARGET . '_TEMPLATE_BODY' - )] - = PHP_EOL . CFactory::_('Placeholder')->update( - $data['html'], $this->placeholders - ); + CFactory::_('Content')->set_($view['settings']->code . '_' + . $template, $TARGET . '_TEMPLATE_BODY', PHP_EOL . CFactory::_('Placeholder')->update_( + $data['html'] + )); // SITE_TEMPLATE_CODE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code . '_' - . $template][Placefix::_h($TARGET . '_TEMPLATE_CODE_BODY' - )] - = $this->setCustomViewTemplateCode($data['php_view']); + CFactory::_('Content')->set_($view['settings']->code . '_' + . $template,$TARGET . '_TEMPLATE_CODE_BODY', + $this->setCustomViewTemplateCode($data['php_view']) + ); } } } @@ -7082,7 +7041,7 @@ class Interpretation extends Fields { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); - return CFactory::_('Placeholder')->update($php_view, $this->placeholders); + return CFactory::_('Placeholder')->update_($php_view); } } @@ -7110,31 +7069,29 @@ class Interpretation extends Fields if (ArrayHelper::check($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); - $this->fileContentDynamic[$layout][Placefix::_h($TARGET - . '_LAYOUT_CODE' )] - = CFactory::_('Placeholder')->update( - $php_view, $this->placeholders + CFactory::_('Content')->set_($layout, $TARGET . '_LAYOUT_CODE', + CFactory::_('Placeholder')->update_( + $php_view + ) ); } else { - $this->fileContentDynamic[$layout][Placefix::_h($TARGET - . '_LAYOUT_CODE' )] - = ''; + CFactory::_('Content')->set_($layout,$TARGET + . '_LAYOUT_CODE', ''); } // SITE_LAYOUT_BODY <<>> - $this->fileContentDynamic[$layout][Placefix::_h($TARGET - . '_LAYOUT_BODY' )] - = PHP_EOL . CFactory::_('Placeholder')->update( - $data['html'], $this->placeholders - ); + CFactory::_('Content')->set_($layout,$TARGET . '_LAYOUT_BODY', + PHP_EOL . CFactory::_('Placeholder')->update_( + $data['html'] + ) + ); // SITE_LAYOUT_HEADER <<>> - $this->fileContentDynamic[$layout][Placefix::_h($TARGET - . '_LAYOUT_HEADER' )] - = (($header = $this->setFileHeader( + CFactory::_('Content')->set_($layout, $TARGET . '_LAYOUT_HEADER', + (($header = $this->setFileHeader( str_replace('_', '.', CFactory::_('Config')->build_target) . '.layout', - $layout, false) - ) !== false) ? PHP_EOL . PHP_EOL . $header : ''; + $layout, false)) !== false) ? PHP_EOL . PHP_EOL . $header : '' + ); } } } @@ -8942,9 +8899,8 @@ class Interpretation extends Fields // load the custom script for the switch based on dynamic get $routerSwitch[] = PHP_EOL . Indent::_(3) . "case '" . $view . "':"; - $routerSwitch[] = CFactory::_('Placeholder')->update( - $viewArray['settings']->main_get->php_router_parse, - $this->placeholders + $routerSwitch[] = CFactory::_('Placeholder')->update_( + $viewArray['settings']->main_get->php_router_parse ); $routerSwitch[] = Indent::_(4) . "break;"; @@ -10624,9 +10580,8 @@ class Interpretation extends Fields CFactory::_('Customcode.Dispenser')->hub['sql_uninstall'] )) { - $db .= CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['sql_uninstall'], - $this->placeholders + $db .= CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['sql_uninstall'] ) . PHP_EOL; unset(CFactory::_('Customcode.Dispenser')->hub['sql_uninstall']); } @@ -11558,11 +11513,11 @@ class Interpretation extends Fields { // custom code return PHP_EOL . Indent::_(3) . "
" - . CFactory::_('Placeholder')->update( + . CFactory::_('Placeholder')->update_( str_replace( array_keys($field), array_values($field), $field_relations['set'] - ), $this->placeholders + ) ) . PHP_EOL . Indent::_(3) . "
"; } elseif (isset($field_relations['set']) @@ -13527,16 +13482,12 @@ class Interpretation extends Fields if (StringHelper::check($items)) { // LAYOUTITEMS <<>> - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][Placefix::_h('LAYOUTITEMS')] - = $items; + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutName, 'LAYOUTITEMS', $items); } else { // LAYOUTITEMS <<>> - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][Placefix::_h('bogus')] - = 'boom'; + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutName, 'bogus', 'boom'); } } } @@ -13568,38 +13519,36 @@ class Interpretation extends Fields $items = ''; } // set placeholder - $placeholder = $this->placeholders; + $placeholder = CFactory::_('Placeholder')->active; $placeholder[Placefix::_h('LAYOUTITEMS')] = $items; // OVERRIDE_LAYOUT_CODE <<>> $php_view = (array) explode(PHP_EOL, $data['php_view']); if (ArrayHelper::check($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_CODE')] - = CFactory::_('Placeholder')->update( - $php_view, $placeholder + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutName, 'OVERRIDE_LAYOUT_CODE', + CFactory::_('Placeholder')->update( + $php_view, $placeholder + ) ); } else { - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_CODE')] - = ''; + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutName, 'OVERRIDE_LAYOUT_CODE', ''); } // OVERRIDE_LAYOUT_BODY <<>> - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_BODY')] - = PHP_EOL . CFactory::_('Placeholder')->update( + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutName, 'OVERRIDE_LAYOUT_BODY', + PHP_EOL . CFactory::_('Placeholder')->update( $data['html'], $placeholder - ); + ) + ); // OVERRIDE_LAYOUT_HEADER <<>> - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_HEADER')] - = (($header = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutName, 'OVERRIDE_LAYOUT_HEADER', + (($header = $this->setFileHeader( 'override.layout', $layoutName, false) - ) !== false) ? PHP_EOL . PHP_EOL . $header : ''; + ) !== false) ? PHP_EOL . PHP_EOL . $header : '' + ); // since override was found return true; @@ -13761,9 +13710,9 @@ class Interpretation extends Fields ); $functionName = StringHelper::safe($codeName, 'F'); // LAYOUTITEMSTABLE <<>> - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][Placefix::_h('LAYOUTITEMSTABLE')] - = $head . $body; + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutCodeName, 'LAYOUTITEMSTABLE', + $head . $body + ); // LAYOUTITEMSHEADER <<>> $headerscript = '//' . Line::_(__Line__, __Class__) . ' set the edit URL'; @@ -13834,19 +13783,19 @@ class Interpretation extends Fields . $name_single_code . "'" . ');'; } - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][Placefix::_h('LAYOUTITEMSHEADER')] - = $headerscript; + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutCodeName, 'LAYOUTITEMSHEADER', + $headerscript + ); // LINKEDVIEWITEMS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWITEMS')] - .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + CFactory::_('Content')->add_($nameSingleCode, 'LINKEDVIEWITEMS', + PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( __LINE__,__CLASS__ ) . " Get Linked view data" . PHP_EOL . Indent::_(2) . "\$this->" . $codeName . " = \$this->get('" . $functionName - . "');"; + . "');" + ); // LINKEDVIEWTABLESCRIPTS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWTABLESCRIPTS')] - = $this->setFootableScripts(); + CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWTABLESCRIPTS', $this->setFootableScripts()); if (strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false) { @@ -13887,10 +13836,10 @@ class Interpretation extends Fields = StringHelper::safe( $_key . $this->uniquekey(4) ); - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')] - .= PHP_EOL . Indent::_(2) . "\$this->" - . $globalKey[$parent_key] . " = \$item->" . $parent_key - . ";"; + CFactory::_('Content')->add_($nameSingleCode, 'LINKEDVIEWGLOBAL', + PHP_EOL . Indent::_(2) . "\$this->" + . $globalKey[$parent_key] . " = \$item->" . $parent_key . ";" + ); } } else @@ -13899,26 +13848,26 @@ class Interpretation extends Fields $globalKey = StringHelper::safe( $_key . $this->uniquekey(4) ); - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')] - .= PHP_EOL . Indent::_(2) . "\$this->" . $globalKey - . " = \$item->" . $parent_key . ";"; + CFactory::_('Content')->add_($nameSingleCode, 'LINKEDVIEWGLOBAL', + PHP_EOL . Indent::_(2) . "\$this->" . $globalKey + . " = \$item->" . $parent_key . ";" + ); } // LINKEDVIEWMETHODS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWMETHODS')] - .= $this->setListQueryLinked( - $name_single_code, $name_list_code, $functionName, $key, $_key, - $parentKey, - $parent_key, $globalKey + CFactory::_('Content')->add_($nameSingleCode, 'LINKEDVIEWMETHODS', + $this->setListQueryLinked( + $name_single_code, $name_list_code, $functionName, $key, $_key, + $parentKey, + $parent_key, $globalKey + ) ); } else { - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][Placefix::_h('LAYOUTITEMSTABLE')] - = 'oops! error.....'; - $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][Placefix::_h('LAYOUTITEMSHEADER')] - = ''; + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutCodeName, 'LAYOUTITEMSTABLE', + 'oops! error.....' + ); + CFactory::_('Content')->set_($nameSingleCode . '_' . $layoutCodeName, 'LAYOUTITEMSHEADER', ''); } } @@ -15319,8 +15268,8 @@ class Interpretation extends Fields 'php_import_headers', 'import_' . $nameListCode, PHP_EOL . PHP_EOL, null, true, // set a default script for those with no custom script - PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $header, $this->placeholders + PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + $header ) ); } @@ -15550,59 +15499,47 @@ class Interpretation extends Fields $this->buildDynamique($target, 'customimport'); // load the custom script to the files // IMPORT_EXT_METHOD <<>> - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_EXT_METHOD')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_EXT_METHOD', CFactory::_('Customcode.Dispenser')->get( 'php_import_ext', 'import_' . $nameListCode, PHP_EOL, null, true - ); + )); // IMPORT_DISPLAY_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DISPLAY_METHOD_CUSTOM')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_DISPLAY_METHOD_CUSTOM', CFactory::_('Customcode.Dispenser')->get( 'php_import_display', 'import_' . $nameListCode, PHP_EOL, null, true - ); + )); // IMPORT_SETDATA_METHOD <<>> - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SETDATA_METHOD')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_SETDATA_METHOD', CFactory::_('Customcode.Dispenser')->get( 'php_import_setdata', 'import_' . $nameListCode, PHP_EOL, null, true - ); + )); // IMPORT_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_METHOD_CUSTOM')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_METHOD_CUSTOM', CFactory::_('Customcode.Dispenser')->get( 'php_import', 'import_' . $nameListCode, PHP_EOL, null, true - ); + )); // IMPORT_SAVE_METHOD <<>> - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SAVE_METHOD')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_SAVE_METHOD', CFactory::_('Customcode.Dispenser')->get( 'php_import_save', 'import_' . $nameListCode, PHP_EOL, null, true - ); + )); // IMPORT_DEFAULT_VIEW_CUSTOM <<>> - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DEFAULT_VIEW_CUSTOM')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_('import_' . $nameListCode, 'IMPORT_DEFAULT_VIEW_CUSTOM', CFactory::_('Customcode.Dispenser')->get( 'html_import_view', 'import_' . $nameListCode, PHP_EOL, null, true - ); + )); // insure we have the view placeholders setup - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('VIEW')] - = 'IMPORT_' . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]; - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('View')] - = 'Import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('view')] - = 'import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('VIEWS')] - = 'IMPORT_' . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]; - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('Views')] - = 'Import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; - $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('views')] - = 'import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; + CFactory::_('Content')->set_('import_' . $nameListCode, 'VIEW', 'IMPORT_' . CFactory::_('Placeholder')->get_h('VIEWS')); + CFactory::_('Content')->set_('import_' . $nameListCode, 'View', 'Import_' . CFactory::_('Placeholder')->get_h('views')); + CFactory::_('Content')->set_('import_' . $nameListCode, 'view', 'import_' . CFactory::_('Placeholder')->get_h('views')); + CFactory::_('Content')->set_('import_' . $nameListCode, 'VIEWS', 'IMPORT_' . CFactory::_('Placeholder')->get_h('VIEWS')); + CFactory::_('Content')->set_('import_' . $nameListCode, 'Views', 'Import_' . CFactory::_('Placeholder')->get_h('views')); + CFactory::_('Content')->set_('import_' . $nameListCode, 'views', 'import_' . CFactory::_('Placeholder')->get_h('views')); } public function setListQuery(&$nameSingleCode, &$nameListCode) @@ -16697,9 +16634,8 @@ class Interpretation extends Fields CFactory::_('Customcode.Dispenser')->hub['view_footer'][$nameSingleCode] )) { - $customFooterScript = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['view_footer'][$nameSingleCode], - $this->placeholders + $customFooterScript = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['view_footer'][$nameSingleCode] ); if (strpos($customFooterScript, 'componentCodeName . '/assets/js/' . $nameListCode . '.js'; // load the file to the list view - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_ADD_JAVASCRIPT_FILE')] - = PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_ADD_JAVASCRIPT_FILE', PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( __LINE__,__CLASS__ ) . " Add List View JavaScript File" . PHP_EOL . Indent::_(2) - . $this->setIncludeLibScript($_path); + . $this->setIncludeLibScript($_path) + ); } else { $list_fileScript = ''; - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_ADD_JAVASCRIPT_FILE')] - = ''; + CFactory::_('Content')->set_($nameListCode, 'ADMIN_ADD_JAVASCRIPT_FILE', ''); } // minfy the script if (CFactory::_('Config')->get('minify', 0) && isset($list_fileScript) @@ -17877,8 +17812,8 @@ class Interpretation extends Fields { $methods .= PHP_EOL . PHP_EOL . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " Used in " . $view . PHP_EOL; - $methods .= CFactory::_('Placeholder')->update( - $method, $this->placeholders + $methods .= CFactory::_('Placeholder')->update_( + $method ); } } @@ -18890,25 +18825,18 @@ class Interpretation extends Fields $otherView = $nameSingleCode; } // set the OtherView value - $this->fileContentDynamic['category' . $otherView][Placefix::_h('otherview')] - = $otherView; + CFactory::_('Content')->set_('category' . $otherView, 'otherview', $otherView); // load the category helper details in not already loaded - if (!isset( - $this->fileContentDynamic['category' . $otherView][Placefix::_h('view')] - )) + if (!CFactory::_('Content')->exist_('category' . $otherView, 'view')) { // lets also set the category helper for this view $target = array('site' => 'category' . $otherView); $this->buildDynamique($target, 'category'); // insure the file gets updated - $this->fileContentDynamic['category' . $otherView][Placefix::_h('view')] - = $otherView; - $this->fileContentDynamic['category' . $otherView][Placefix::_h('View')] - = ucfirst($otherView); - $this->fileContentDynamic['category' . $otherView][Placefix::_h('views')] - = $otherViews; - $this->fileContentDynamic['category' . $otherView][Placefix::_h('Views')] - = ucfirst($otherViews); + CFactory::_('Content')->set_('category' . $otherView, 'view', $otherView); + CFactory::_('Content')->set_('category' . $otherView, 'View', ucfirst($otherView)); + CFactory::_('Content')->set_('category' . $otherView, 'views', $otherViews); + CFactory::_('Content')->set_('category' . $otherView, 'Views', ucfirst($otherViews)); // set script to global helper file $includeHelper = array(); $includeHelper[] = "\n//" . Line::_(__Line__, __Class__) @@ -19492,14 +19420,11 @@ class Interpretation extends Fields $getForm[] = Indent::_(3) . "return false;"; $getForm[] = Indent::_(2) . "}"; // load license locker - if ($this->componentData->add_license - && $this->componentData->license_type == 3 - && isset( - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('BOOLMETHOD')] - )) + if ($this->componentData->add_license && $this->componentData->license_type == 3 + && CFactory::_('Content')->exist_($nameSingleCode, 'BOOLMETHOD')) { $getForm[] = $this->checkStatmentLicenseLocked( - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('BOOLMETHOD')] + CFactory::_('Content')->get_($nameSingleCode, 'BOOLMETHOD') ); } // setup correct core target @@ -22379,7 +22304,7 @@ class Interpretation extends Fields if (ArrayHelper::check($headers)) { // return the headers - return CFactory::_('Placeholder')->update(implode(PHP_EOL, $headers), $this->placeholders); + return CFactory::_('Placeholder')->update_(implode(PHP_EOL, $headers)); } return $default; @@ -22563,7 +22488,7 @@ class Interpretation extends Fields ) . ';'; } - return CFactory::_('Placeholder')->update($fix, $this->placeholders); + return CFactory::_('Placeholder')->update_($fix); } public function setSelectionTranslationFix($views, $Component, $tab = '') @@ -22986,9 +22911,8 @@ class Interpretation extends Fields ); // return the methods - return PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $this->componentData->php_dashboard_methods, - $this->placeholders + return PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + $this->componentData->php_dashboard_methods ); } @@ -23039,8 +22963,8 @@ class Interpretation extends Fields foreach ($this->componentData->dashboard_tab as $data) { $builder[$data['name']][$data['header']] - = CFactory::_('Placeholder')->update( - $data['html'], $this->placeholders + = CFactory::_('Placeholder')->update_( + $data['html'] ); } // since we have custom tabs we must load the tab structure around the cpanel @@ -23138,13 +23062,11 @@ class Interpretation extends Fields CFactory::_('Config')->build_target, 'U' ); // SITE_TEMPLATE_BODY <<>> - $this->fileContentDynamic[$this->componentCodeName . '_' - . $tempName][Placefix::_h('CUSTOM_ADMIN_TEMPLATE_BODY')] - = PHP_EOL . $html; + CFactory::_('Content')->set_($this->componentCodeName . '_' . $tempName, + 'CUSTOM_ADMIN_TEMPLATE_BODY', PHP_EOL . $html); // SITE_TEMPLATE_CODE_BODY <<>> - $this->fileContentDynamic[$this->componentCodeName . '_' - . $tempName][Placefix::_h('CUSTOM_ADMIN_TEMPLATE_CODE_BODY')] - = ''; + CFactory::_('Content')->set_($this->componentCodeName . '_' . $tempName, + 'CUSTOM_ADMIN_TEMPLATE_CODE_BODY', ''); } $display[] = $tab . Indent::_(1) . ""; @@ -24167,6 +24089,8 @@ class Interpretation extends Fields } elseif (2 == $timer) // this is after the admin views are build { + // for plugin event TODO change event api signatures + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets CFactory::_('Event')->trigger( 'jcb_ce_onBeforeSetConfigFieldsets', @@ -24174,7 +24098,7 @@ class Interpretation extends Fields &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->componentData->config, &$this->extensionsParams, - &$this->placeholders) + &$placeholders) ); // these field sets can only be added after admin view is build $this->setGroupControlConfigFieldsets($lang); @@ -24186,12 +24110,14 @@ class Interpretation extends Fields // these are the coustom settings $this->setCustomControlConfigFieldsets($lang); } + // for plugin event TODO change event api signatures + $placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterSetConfigFieldsets CFactory::_('Event')->trigger( 'jcb_ce_onAfterSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->extensionsParams, - &$this->frontEndParams, &$this->placeholders) + &$this->frontEndParams, &$placeholders) ); } @@ -28012,7 +27938,7 @@ function vdm_dkim() { // check if we have string if (StringHelper::check($setter)) { - return CFactory::_('Placeholder')->update( CFactory::_('Placeholder')->update( + return CFactory::_('Placeholder')->update( CFactory::_('Placeholder')->update_( str_replace( '$this->document->', '$document->', implode( @@ -28022,8 +27948,7 @@ function vdm_dkim() { (array) explode(PHP_EOL, $setter) ) ) - ), - $this->placeholders + ) ), CFactory::_('Content')->active); } @@ -28419,13 +28344,15 @@ function vdm_dkim() { public function getPluginMainClass(&$plugin) { - return - CFactory::_('Placeholder')->update(PHP_EOL . $plugin->head . PHP_EOL . + return CFactory::_('Placeholder')->update( + PHP_EOL . $plugin->head . PHP_EOL . $plugin->comment . PHP_EOL . 'class ' . $plugin->class_name . ' extends ' . $plugin->extends . PHP_EOL . '{' . PHP_EOL . $plugin->main_class_code . PHP_EOL . - "}" . PHP_EOL, CFactory::_('Content')->active); + "}" . PHP_EOL, + CFactory::_('Content')->active + ); } public function getPluginMainXML(&$plugin) @@ -28841,135 +28768,6 @@ function vdm_dkim() { return CFactory::_('Placeholder')->update(implode(PHP_EOL, $code), CFactory::_('Content')->active); } - public function setPowersAutoloader($namespace, $loadSite) - { - if (($size = ArrayHelper::check($namespace)) > 0) - { - // check if we are using a plugin - $use_plugin = CFactory::_('Content')->exist('PLUGIN_POWER_AUTOLOADER'); - // build the methods - $autoloadNotSiteMethod = array(); - $autoloadMethod = array(); - // add only if we are not using a plugin - $tab_space = 2; - if (!$use_plugin) - { - $autoloadNotSiteMethod[] = PHP_EOL . PHP_EOL; - $tab_space = 0; - } - elseif (!$loadSite) - { - // we add code to prevent this plugin from triggering on the site area - $autoloadNotSiteMethod[] = PHP_EOL . Indent::_(2) . '//' - . Line::_(__Line__, __Class__) . ' do not run the autoloader in the site area'; - $autoloadNotSiteMethod[] = Indent::_(2) . 'if ($this->app->isClient(\'site\'))'; - $autoloadNotSiteMethod[] = Indent::_(2) . '{'; - $autoloadNotSiteMethod[] = Indent::_(3) . 'return;'; - $autoloadNotSiteMethod[] = Indent::_(2) . '}' . PHP_EOL; - } - // we start building the spl_autoload_register function call - $autoloadMethod[] = Indent::_($tab_space) . '//' - . Line::_(__Line__, __Class__) . ' register this component namespace'; - $autoloadMethod[] = Indent::_($tab_space) . 'spl_autoload_register(function ($class) {'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' - . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$search = array('; - // ==== IMPORTANT NOTICE ===== - // make sure the name space values are sorted from the longest string to the shortest - // so that the search do not mistakenly match a shorter namespace before a longer one - // that has the same short namespace for example: - // NameSpace\SubName\Sub <- will always match first - // NameSpace\SubName\SubSubName - // Should the shorter namespace be listed [first] it will match both of these: - // NameSpace\SubName\Sub\ClassName - // ^^^^^^^^^^^^^^^^^^^^^ - // NameSpace\SubName\SubSubName\ClassName - // ^^^^^^^^^^^^^^^^^^^^^ - uksort($namespace, function ($a, $b) { - return strlen($b) - strlen($a); - }); - // counter to manage the comma in the actual array - $counter = 1; - foreach ($namespace as $base_dir => $prefix) - { - // don't add the ending comma on last value - if ($size == $counter) - { - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . "'" . CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; - } - else - { - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . "'" . CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; - } - $counter++; - } - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . ');'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// Start the search and load if found'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found = false;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found_base_dir = "";'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found_len = 0;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '//' - . Line::_(__Line__, __Class__) . ' does the class use the namespace prefix?'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '$len = strlen($prefix);'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '{'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '//' - . Line::_(__Line__, __Class__) . ' we have a match so load the values'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found = true;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found_base_dir = $base_dir;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found_len = $len;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '//' - . Line::_(__Line__, __Class__) . ' done here'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . 'break;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '}'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' - . Line::_(__Line__, __Class__) . ' check if we found a match'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'if (!$found)'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '//' - . Line::_(__Line__, __Class__) . ' no, move to the next registered autoloader'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'return;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' - . Line::_(__Line__, __Class__) . ' get the relative class name'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$relative_class = substr($class, $found_len);'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' - . Line::_(__Line__, __Class__) . ' replace the namespace prefix with the base directory, replace namespace'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// separators with directory separators in the relative class name, append'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// with .php'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' - . Line::_(__Line__, __Class__) . ' if the file exists, require it'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'if (file_exists($file))'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'require $file;'; - $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; - $autoloadMethod[] = Indent::_($tab_space) . '});'; - // create the method string - $autoloader = implode(PHP_EOL, $autoloadNotSiteMethod) . implode(PHP_EOL, $autoloadMethod); - // check if we are using a plugin - if ($use_plugin) - { - CFactory::_('Content')->set('PLUGIN_POWER_AUTOLOADER', PHP_EOL . $autoloader); - } - else - { - // load to events placeholders - CFactory::_('Content')->add('ADMIN_POWER_HELPER', $autoloader); - // load to site if needed - if ($loadSite) - { - CFactory::_('Content')->add('SITE_POWER_HELPER', $autoloader); - } - } - // to add to custom files - CFactory::_('Content')->add('CUSTOM_POWER_AUTOLOADER', PHP_EOL . implode(PHP_EOL, $autoloadMethod)); - } - } - /** * build field set for an extention * diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 0ab0f1b58..b709e5f10 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -30,9 +30,22 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; class Infusion extends Interpretation { - public $langFiles = array(); + + /** + * Switch to remove site folder + * + * @var bool + * @deprecated 3.3 Use CFactory::_('Config')->remove_site_folder; + */ public $removeSiteFolder = false; + + /** + * Switch to remove site edit folder + * + * @var bool + * @deprecated 3.3 Use CFactory::_('Config')->remove_site_edit_folder; + */ public $removeSiteEditFolder = true; /** @@ -65,30 +78,28 @@ class Infusion extends Interpretation )) { // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildFilesContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildFilesContent', array(&$this->componentContext, &$this->componentData, - &$fileContentStatic, &$this->fileContentDynamic, - &$this->placeholders, &$this->hhh) + &$fileContentStatic, &$fileContentDynamic, + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); // COMPONENT - CFactory::_('Content')->set('COMPONENT', CFactory::_('Placeholder')->active[Placefix::_h('COMPONENT')]); + CFactory::_('Content')->set('COMPONENT', CFactory::_('Placeholder')->get('COMPONENT')); // Component - CFactory::_('Content')->set('Component', CFactory::_('Placeholder')->active[Placefix::_h('Component')]); + CFactory::_('Content')->set('Component', CFactory::_('Placeholder')->get('Component')); // component - CFactory::_('Content')->set('component', CFactory::_('Placeholder')->active[Placefix::_h('component')]); + CFactory::_('Content')->set('component', CFactory::_('Placeholder')->get('component')); // COMPANYNAME CFactory::_('Content')->set('COMPANYNAME', trim( @@ -192,40 +203,36 @@ class Infusion extends Interpretation // ADMINJS CFactory::_('Content')->set('ADMINJS', - CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active + CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_js'] )); // SITEJS CFactory::_('Content')->set('SITEJS', - CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active + CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_js'] )); // ADMINCSS CFactory::_('Content')->set('ADMINCSS', - CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_css_admin'], - CFactory::_('Placeholder')->active + CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_css_admin'] )); // SITECSS CFactory::_('Content')->set('SITECSS', - CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_css_site'], - CFactory::_('Placeholder')->active + CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_css_site'] )); // CUSTOM_HELPER_SCRIPT CFactory::_('Content')->set('CUSTOM_HELPER_SCRIPT', - CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_php_helper_admin'], - CFactory::_('Placeholder')->active + CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_admin'] )); // BOTH_CUSTOM_HELPER_SCRIPT CFactory::_('Content')->set('BOTH_CUSTOM_HELPER_SCRIPT', - CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_php_helper_both'], - CFactory::_('Placeholder')->active + CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_both'] )); // ADMIN_GLOBAL_EVENT_HELPER @@ -256,9 +263,8 @@ class Infusion extends Interpretation . 'public static function globalEvent($document)'); CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '{'); CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', - PHP_EOL . CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_php_admin_event'], - CFactory::_('Placeholder')->active + PHP_EOL . CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_php_admin_event'] )); CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '}'); } @@ -326,7 +332,7 @@ class Infusion extends Interpretation . $nameSingleCode . "'"; CFactory::_('Config')->lang_target = 'both'; // insure site view does not get removed - $this->removeSiteEditFolder = false; + CFactory::_('Config')->remove_site_edit_folder = false; } // check if help is being loaded $this->checkHelp($nameSingleCode); @@ -352,9 +358,9 @@ class Infusion extends Interpretation ); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminEditViewContent', @@ -362,57 +368,48 @@ class Infusion extends Interpretation &$nameSingleCode, &$nameListCode, &$fileContentStatic, - &$this->fileContentDynamic[$nameSingleCode], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$nameSingleCode], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); // FIELDSETS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('FIELDSETS')] - = $this->setFieldSet( + CFactory::_('Content')->set_($nameSingleCode, 'FIELDSETS', $this->setFieldSet( $view, CFactory::_('Config')->component_code_name, $nameSingleCode, $nameListCode - ); + )); // ACCESSCONTROL <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ACCESSCONTROL')] - = $this->setFieldSetAccessControl( + CFactory::_('Content')->set_($nameSingleCode, 'ACCESSCONTROL', $this->setFieldSetAccessControl( $nameSingleCode - ); + )); // LINKEDVIEWITEMS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWITEMS')] - = ''; + CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWITEMS', ''); // ADDTOOLBAR <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADDTOOLBAR')] - = $this->setAddToolBar($view); + CFactory::_('Content')->set_($nameSingleCode, 'ADDTOOLBAR', $this->setAddToolBar($view)); // set the script for this view $this->buildTheViewScript($view); // VIEW_SCRIPT - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEW_SCRIPT')] - = $this->setViewScript( + CFactory::_('Content')->set_($nameSingleCode, 'VIEW_SCRIPT', $this->setViewScript( $nameSingleCode, 'fileScript' - ); + )); // EDITBODYSCRIPT - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODYSCRIPT')] - = $this->setViewScript( + CFactory::_('Content')->set_($nameSingleCode, 'EDITBODYSCRIPT', $this->setViewScript( $nameSingleCode, 'footerScript' - ); + )); // AJAXTOKE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('AJAXTOKE')] - = $this->setAjaxToke( + CFactory::_('Content')->set_($nameSingleCode, 'AJAXTOKE', $this->setAjaxToke( $nameSingleCode - ); + )); // DOCUMENT_CUSTOM_PHP <<>> if ($phpDocument = CFactory::_('Customcode.Dispenser')->get( @@ -421,195 +418,163 @@ class Infusion extends Interpretation false )) { - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('DOCUMENT_CUSTOM_PHP')] - = str_replace( + CFactory::_('Content')->set_($nameSingleCode, 'DOCUMENT_CUSTOM_PHP', str_replace( '$document->', '$this->document->', $phpDocument - ); + )); // clear some memory unset($phpDocument); } else { - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('DOCUMENT_CUSTOM_PHP')] - = ''; + CFactory::_('Content')->set_($nameSingleCode, 'DOCUMENT_CUSTOM_PHP', ''); } // LINKEDVIEWTABLESCRIPTS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWTABLESCRIPTS')] - = ''; + CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWTABLESCRIPTS', ''); // VALIDATEFIX <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VALIDATIONFIX')] - = $this->setValidationFix( + CFactory::_('Content')->set_($nameSingleCode, 'VALIDATIONFIX', $this->setValidationFix( $nameSingleCode, CFactory::_('Content')->get('Component') - ); + )); // EDITBODY <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODY')] - = $this->setEditBody($view); + CFactory::_('Content')->set_($nameSingleCode, 'EDITBODY', $this->setEditBody($view)); // EDITBODYFADEIN <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODYFADEIN')] - = $this->setFadeInEfect($view); + CFactory::_('Content')->set_($nameSingleCode, 'EDITBODYFADEIN', $this->setFadeInEfect($view)); // JTABLECONSTRUCTOR <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JTABLECONSTRUCTOR')] - = $this->setJtableConstructor( + CFactory::_('Content')->set_($nameSingleCode, 'JTABLECONSTRUCTOR', $this->setJtableConstructor( $nameSingleCode - ); + )); // JTABLEALIASCATEGORY <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JTABLEALIASCATEGORY')] - = $this->setJtableAliasCategory( + CFactory::_('Content')->set_($nameSingleCode, 'JTABLEALIASCATEGORY', $this->setJtableAliasCategory( $nameSingleCode - ); + )); // METHOD_GET_ITEM <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('METHOD_GET_ITEM')] - = $this->setMethodGetItem( + CFactory::_('Content')->set_($nameSingleCode, 'METHOD_GET_ITEM', $this->setMethodGetItem( $nameSingleCode - ); + )); // LINKEDVIEWGLOBAL <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')] - = ''; + CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWGLOBAL', ''); // LINKEDVIEWMETHODS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWMETHODS')] - = ''; + CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWMETHODS', ''); // JMODELADMIN_BEFORE_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_DELETE')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_BEFORE_DELETE', CFactory::_('Customcode.Dispenser')->get( 'php_before_delete', $nameSingleCode, PHP_EOL - ); + )); // JMODELADMIN_AFTER_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_DELETE')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_AFTER_DELETE', CFactory::_('Customcode.Dispenser')->get( 'php_after_delete', $nameSingleCode, PHP_EOL . PHP_EOL - ); + )); // JMODELADMIN_BEFORE_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_PUBLISH')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_BEFORE_PUBLISH', CFactory::_('Customcode.Dispenser')->get( 'php_before_publish', $nameSingleCode, PHP_EOL - ); + )); // JMODELADMIN_AFTER_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_PUBLISH')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_AFTER_PUBLISH', CFactory::_('Customcode.Dispenser')->get( 'php_after_publish', $nameSingleCode, PHP_EOL . PHP_EOL - ); + )); // CHECKBOX_SAVE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('CHECKBOX_SAVE')] - = $this->setCheckboxSave( + CFactory::_('Content')->set_($nameSingleCode, 'CHECKBOX_SAVE', $this->setCheckboxSave( $nameSingleCode - ); + )); // METHOD_ITEM_SAVE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('METHOD_ITEM_SAVE')] - = $this->setMethodItemSave( + CFactory::_('Content')->set_($nameSingleCode, 'METHOD_ITEM_SAVE', $this->setMethodItemSave( $nameSingleCode - ); + )); // POSTSAVEHOOK <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('POSTSAVEHOOK')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'POSTSAVEHOOK', CFactory::_('Customcode.Dispenser')->get( 'php_postsavehook', $nameSingleCode, PHP_EOL, null, true, PHP_EOL . Indent::_(2) . "return;", PHP_EOL . PHP_EOL . Indent::_(2) . "return;" - ); + )); // VIEWCSS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWCSS')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'VIEWCSS', CFactory::_('Customcode.Dispenser')->get( 'css_view', $nameSingleCode, '', null, true - ); + )); // add css to front end if (isset($view['edit_create_site_view']) - && is_numeric( - $view['edit_create_site_view'] - ) + && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0) { - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_VIEWCSS')] - = $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWCSS')]; + CFactory::_('Content')->set_($nameSingleCode, 'SITE_VIEWCSS', CFactory::_('Content')->get_($nameSingleCode,'VIEWCSS')); // check if we should add a create menu if ($view['edit_create_site_view'] == 2) { // SITE_MENU_XML <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_MENU_XML')] - = $this->setAdminViewMenu( + CFactory::_('Content')->set_($nameSingleCode, 'SITE_MENU_XML', $this->setAdminViewMenu( $nameSingleCode, $view - ); + )); } // SITE_ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_CONTROLLER_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_CONTROLLER_HEADER', $this->setFileHeader( 'site.admin.view.controller', $nameSingleCode - ); + )); // SITE_ADMIN_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_MODEL_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_MODEL_HEADER', $this->setFileHeader( 'site.admin.view.model', $nameSingleCode - ); + )); // SITE_ADMIN_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_HTML_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_HTML_HEADER', $this->setFileHeader( 'site.admin.view.html', $nameSingleCode - ); + )); // SITE_ADMIN_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_HEADER', $this->setFileHeader( 'site.admin.view', $nameSingleCode - ); + )); } // TABLAYOUTFIELDSARRAY <<>> add the tab layout fields array to the model - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('TABLAYOUTFIELDSARRAY')] - = $this->getTabLayoutFieldsArray( + CFactory::_('Content')->set_($nameSingleCode, 'TABLAYOUTFIELDSARRAY', $this->getTabLayoutFieldsArray( $nameSingleCode - ); + )); // ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_CONTROLLER_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_CONTROLLER_HEADER', $this->setFileHeader( 'admin.view.controller', $nameSingleCode - ); + )); // ADMIN_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_MODEL_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_MODEL_HEADER', $this->setFileHeader( 'admin.view.model', $nameSingleCode - ); + )); // ADMIN_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_HTML_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_HTML_HEADER', $this->setFileHeader( 'admin.view.html', $nameSingleCode - ); + )); // ADMIN_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_HEADER', $this->setFileHeader( 'admin.view', $nameSingleCode - ); + )); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminEditViewContent', @@ -617,14 +582,12 @@ class Infusion extends Interpretation &$nameSingleCode, &$nameListCode, &$fileContentStatic, - &$this->fileContentDynamic[$nameSingleCode], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$nameSingleCode], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); } // set the views names if (isset($view['settings']->name_list) @@ -633,13 +596,12 @@ class Infusion extends Interpretation CFactory::_('Config')->lang_target = 'admin'; // ICOMOON <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('ICOMOON')] - = $view['icomoon']; + CFactory::_('Content')->set_($nameListCode, 'ICOMOON', $view['icomoon']); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminListViewContent', @@ -647,14 +609,12 @@ class Infusion extends Interpretation &$nameSingleCode, &$nameListCode, &$fileContentStatic, - &$this->fileContentDynamic[$nameListCode], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$nameListCode], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); // set the export/import option if (isset($view['port']) && $view['port'] @@ -683,90 +643,75 @@ class Infusion extends Interpretation if (isset($view['checkin']) && $view['checkin'] == 1) { // AUTOCHECKIN <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('AUTOCHECKIN')] - = $this->setAutoCheckin( + CFactory::_('Content')->set_($nameListCode, 'AUTOCHECKIN', $this->setAutoCheckin( $nameSingleCode, CFactory::_('Config')->component_code_name - ); + )); // CHECKINCALL <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('CHECKINCALL')] - = $this->setCheckinCall(); + CFactory::_('Content')->set_($nameListCode, 'CHECKINCALL', $this->setCheckinCall()); } else { // AUTOCHECKIN <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('AUTOCHECKIN')] - = ''; + CFactory::_('Content')->set_($nameListCode, 'AUTOCHECKIN', ''); // CHECKINCALL <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('CHECKINCALL')] - = ''; + CFactory::_('Content')->set_($nameListCode, 'CHECKINCALL', ''); } // admin list file contnet - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_JAVASCRIPT_FILE')] - = $this->setViewScript( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_JAVASCRIPT_FILE', $this->setViewScript( $nameListCode, 'list_fileScript' - ); + )); // ADMIN_CUSTOM_BUTTONS_LIST - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_CUSTOM_BUTTONS_LIST')] - = $this->setCustomButtons($view, 3, Indent::_(1)); - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST')] - = $this->setFunctionOnlyButtons( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_CUSTOM_BUTTONS_LIST', $this->setCustomButtons($view, 3, Indent::_(1))); + CFactory::_('Content')->set_($nameListCode, 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST', $this->setFunctionOnlyButtons( $nameListCode - ); + )); // GET_ITEMS_METHOD_STRING_FIX <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('GET_ITEMS_METHOD_STRING_FIX')] - = $this->setGetItemsMethodStringFix( + CFactory::_('Content')->set_($nameListCode, 'GET_ITEMS_METHOD_STRING_FIX', $this->setGetItemsMethodStringFix( $nameSingleCode, $nameListCode, CFactory::_('Content')->get('Component') - ); + )); // GET_ITEMS_METHOD_AFTER_ALL <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('GET_ITEMS_METHOD_AFTER_ALL')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameListCode, 'GET_ITEMS_METHOD_AFTER_ALL', CFactory::_('Customcode.Dispenser')->get( 'php_getitems_after_all', $nameSingleCode, PHP_EOL - ); + )); // SELECTIONTRANSLATIONFIX <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIX')] - = $this->setSelectionTranslationFix( + CFactory::_('Content')->set_($nameListCode, 'SELECTIONTRANSLATIONFIX', $this->setSelectionTranslationFix( $nameListCode, CFactory::_('Content')->get('Component') - ); + )); // SELECTIONTRANSLATIONFIXFUNC <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIXFUNC')] - = $this->setSelectionTranslationFixFunc( + CFactory::_('Content')->set_($nameListCode, 'SELECTIONTRANSLATIONFIXFUNC', $this->setSelectionTranslationFixFunc( $nameListCode, CFactory::_('Content')->get('Component') - ); + )); // FILTER_FIELDS <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('FILTER_FIELDS')] - = $this->setFilterFieldsArray( + CFactory::_('Content')->set_($nameListCode, 'FILTER_FIELDS', $this->setFilterFieldsArray( $nameSingleCode, $nameListCode - ); + )); // STOREDID <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('STOREDID')] - = $this->setStoredId( + CFactory::_('Content')->set_($nameListCode, 'STOREDID', $this->setStoredId( $nameSingleCode, $nameListCode - ); + )); // POPULATESTATE <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('POPULATESTATE')] - = $this->setPopulateState( + CFactory::_('Content')->set_($nameListCode, 'POPULATESTATE', $this->setPopulateState( $nameSingleCode, $nameListCode - ); + )); // SORTFIELDS <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('SORTFIELDS')] - = $this->setSortFields( + CFactory::_('Content')->set_($nameListCode, 'SORTFIELDS', $this->setSortFields( $nameListCode - ); + )); // CATEGORY_VIEWS CFactory::_('Content')->add('ROUTER_CATEGORY_VIEWS', @@ -776,123 +721,106 @@ class Infusion extends Interpretation )); // FILTERFIELDDISPLAYHELPER <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('FILTERFIELDDISPLAYHELPER')] - = $this->setFilterFieldSidebarDisplayHelper( + CFactory::_('Content')->set_($nameListCode, 'FILTERFIELDDISPLAYHELPER', $this->setFilterFieldSidebarDisplayHelper( $nameSingleCode, $nameListCode - ); + )); // BATCHDISPLAYHELPER <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('BATCHDISPLAYHELPER')] - = $this->setBatchDisplayHelper( + CFactory::_('Content')->set_($nameListCode, 'BATCHDISPLAYHELPER', $this->setBatchDisplayHelper( $nameSingleCode, $nameListCode - ); + )); // FILTERFUNCTIONS <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('FILTERFUNCTIONS')] - = $this->setFilterFieldHelper( + CFactory::_('Content')->set_($nameListCode, 'FILTERFUNCTIONS', $this->setFilterFieldHelper( $nameSingleCode, $nameListCode - ); + )); // FIELDFILTERSETS <<>> - $this->fileContentDynamic['filter_' - . $nameListCode][Placefix::_h('FIELDFILTERSETS')] - = $this->setFieldFilterSet( + CFactory::_('Content')->set_('filter_' . $nameListCode,'FIELDFILTERSETS', + $this->setFieldFilterSet( $nameSingleCode, $nameListCode - ); + )); // FIELDLISTSETS <<>> - $this->fileContentDynamic['filter_' - . $nameListCode][Placefix::_h('FIELDLISTSETS')] - = $this->setFieldFilterListSet( + CFactory::_('Content')->set_('filter_' . $nameListCode, 'FIELDLISTSETS', + $this->setFieldFilterListSet( $nameSingleCode, $nameListCode - ); + )); // LISTQUERY <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTQUERY')] - = $this->setListQuery( + CFactory::_('Content')->set_($nameListCode, 'LISTQUERY', $this->setListQuery( $nameSingleCode, $nameListCode - ); + )); // MODELEXPORTMETHOD <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('MODELEXPORTMETHOD')] - = $this->setGetItemsModelMethod( + CFactory::_('Content')->set_($nameListCode, 'MODELEXPORTMETHOD', $this->setGetItemsModelMethod( $nameSingleCode, $nameListCode - ); + )); // MODELEXIMPORTMETHOD <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('CONTROLLEREXIMPORTMETHOD')] - = $this->setControllerEximportMethod( + CFactory::_('Content')->set_($nameListCode, 'CONTROLLEREXIMPORTMETHOD', $this->setControllerEximportMethod( $nameSingleCode, $nameListCode - ); + )); // EXPORTBUTTON <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('EXPORTBUTTON')] - = $this->setExportButton( + CFactory::_('Content')->set_($nameListCode, 'EXPORTBUTTON', $this->setExportButton( $nameSingleCode, $nameListCode - ); + )); // IMPORTBUTTON <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('IMPORTBUTTON')] - = $this->setImportButton( + CFactory::_('Content')->set_($nameListCode, 'IMPORTBUTTON', $this->setImportButton( $nameSingleCode, $nameListCode - ); + )); // VIEWS_DEFAULT_BODY <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_DEFAULT_BODY')] - = $this->setDefaultViewsBody( + CFactory::_('Content')->set_($nameListCode, 'VIEWS_DEFAULT_BODY', $this->setDefaultViewsBody( $nameSingleCode, $nameListCode - ); + )); // LISTHEAD <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTHEAD')] - = $this->setListHead( + CFactory::_('Content')->set_($nameListCode, 'LISTHEAD', $this->setListHead( $nameSingleCode, $nameListCode - ); + )); // LISTBODY <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTBODY')] - = $this->setListBody( + CFactory::_('Content')->set_($nameListCode, 'LISTBODY', $this->setListBody( $nameSingleCode, $nameListCode - ); + )); // LISTCOLNR <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTCOLNR')] - = $this->setListColnr( + CFactory::_('Content')->set_($nameListCode, 'LISTCOLNR', $this->setListColnr( $nameListCode - ); + )); // JVIEWLISTCANDO <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('JVIEWLISTCANDO')] - = $this->setJviewListCanDo( + CFactory::_('Content')->set_($nameListCode, 'JVIEWLISTCANDO', $this->setJviewListCanDo( $nameSingleCode, $nameListCode - ); + )); // VIEWSCSS <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWSCSS')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameListCode, 'VIEWSCSS', CFactory::_('Customcode.Dispenser')->get( 'css_views', $nameSingleCode, '', null, true - ); + )); // ADMIN_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_DIPLAY_METHOD')] - = $this->setAdminViewDisplayMethod( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_DIPLAY_METHOD', $this->setAdminViewDisplayMethod( $nameListCode - ); + )); // VIEWS_FOOTER_SCRIPT <<>> $scriptNote = PHP_EOL . '//' . Line::_(__Line__, __Class__) @@ -916,44 +844,38 @@ class Infusion extends Interpretation // clear some memory unset($minifier); } - $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_FOOTER_SCRIPT')] - = PHP_EOL . '"; + CFactory::_('Content')->set_($nameListCode, 'VIEWS_FOOTER_SCRIPT', PHP_EOL . '"); // clear some memory unset($footerScript); } else { - $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_FOOTER_SCRIPT')] - = ''; + CFactory::_('Content')->set_($nameListCode, 'VIEWS_FOOTER_SCRIPT', ''); } // ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_CONTROLLER_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_CONTROLLER_HEADER', $this->setFileHeader( 'admin.views.controller', $nameListCode - ); + )); // ADMIN_VIEWS_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_MODEL_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_MODEL_HEADER', $this->setFileHeader( 'admin.views.model', $nameListCode - ); + )); // ADMIN_VIEWS_HTML_HEADER <<>> add the header details for the views - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_HTML_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_HTML_HEADER', $this->setFileHeader( 'admin.views.html', $nameListCode - ); + )); // ADMIN_VIEWS_HEADER <<>> add the header details for the views - $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_HEADER', $this->setFileHeader( 'admin.views', $nameListCode - ); + )); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildAdminListViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminListViewContent', @@ -961,121 +883,102 @@ class Infusion extends Interpretation &$nameSingleCode, &$nameListCode, &$fileContentStatic, - &$this->fileContentDynamic[$nameListCode], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$nameListCode], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); } // set u fields used in batch - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('UNIQUEFIELDS')] - = $this->setUniqueFields( + CFactory::_('Content')->set_($nameSingleCode, 'UNIQUEFIELDS', $this->setUniqueFields( $nameSingleCode - ); + )); // TITLEALIASFIX <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('TITLEALIASFIX')] - = $this->setAliasTitleFix( + CFactory::_('Content')->set_($nameSingleCode, 'TITLEALIASFIX', $this->setAliasTitleFix( $nameSingleCode - ); + )); // GENERATENEWTITLE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('GENERATENEWTITLE')] - = $this->setGenerateNewTitle( + CFactory::_('Content')->set_($nameSingleCode, 'GENERATENEWTITLE', $this->setGenerateNewTitle( $nameSingleCode - ); + )); // GENERATENEWALIAS <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('GENERATENEWALIAS')] - = $this->setGenerateNewAlias( + CFactory::_('Content')->set_($nameSingleCode, 'GENERATENEWALIAS', $this->setGenerateNewAlias( $nameSingleCode - ); + )); // MODEL_BATCH_COPY <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('MODEL_BATCH_COPY')] - = $this->setBatchCopy($nameSingleCode); + CFactory::_('Content')->set_($nameSingleCode, 'MODEL_BATCH_COPY', $this->setBatchCopy($nameSingleCode)); // MODEL_BATCH_MOVE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('MODEL_BATCH_MOVE')] - = $this->setBatchMove($nameSingleCode); + CFactory::_('Content')->set_($nameSingleCode, 'MODEL_BATCH_MOVE', $this->setBatchMove($nameSingleCode)); // BATCH_ONCLICK_CANCEL_SCRIPT <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('BATCH_ONCLICK_CANCEL_SCRIPT')] - = ''; // TODO <-- must still be build + CFactory::_('Content')->set_($nameListCode, 'BATCH_ONCLICK_CANCEL_SCRIPT', ''); // TODO <-- must still be build // JCONTROLLERFORM_ALLOWADD <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_ALLOWADD')] - = $this->setJcontrollerAllowAdd( + CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_ALLOWADD', $this->setJcontrollerAllowAdd( $nameSingleCode, $nameListCode - ); + )); // JCONTROLLERFORM_BEFORECANCEL <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_BEFORECANCEL')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_BEFORECANCEL', CFactory::_('Customcode.Dispenser')->get( 'php_before_cancel', $nameSingleCode, PHP_EOL, null, false, '' - ); + )); // JCONTROLLERFORM_AFTERCANCEL <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_AFTERCANCEL')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_AFTERCANCEL', CFactory::_('Customcode.Dispenser')->get( 'php_after_cancel', $nameSingleCode, PHP_EOL, null, false, '' - ); + )); // JCONTROLLERFORM_ALLOWEDIT <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_ALLOWEDIT')] - = $this->setJcontrollerAllowEdit( + CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_ALLOWEDIT', $this->setJcontrollerAllowEdit( $nameSingleCode, $nameListCode - ); + )); // JMODELADMIN_GETFORM <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_GETFORM')] - = $this->setJmodelAdminGetForm( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_GETFORM', $this->setJmodelAdminGetForm( $nameSingleCode, $nameListCode - ); + )); // JMODELADMIN_ALLOWEDIT <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_ALLOWEDIT')] - = $this->setJmodelAdminAllowEdit( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_ALLOWEDIT', $this->setJmodelAdminAllowEdit( $nameSingleCode, $nameListCode - ); + )); // JMODELADMIN_CANDELETE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_CANDELETE')] - = $this->setJmodelAdminCanDelete( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_CANDELETE', $this->setJmodelAdminCanDelete( $nameSingleCode, $nameListCode - ); + )); // JMODELADMIN_CANEDITSTATE <<>> - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_CANEDITSTATE')] - = $this->setJmodelAdminCanEditState( + CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_CANEDITSTATE', $this->setJmodelAdminCanEditState( $nameSingleCode, $nameListCode - ); + )); // set custom admin view Toolbare buttons // CUSTOM_ADMIN_DYNAMIC_BUTTONS <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('CUSTOM_ADMIN_DYNAMIC_BUTTONS')] - = $this->setCustomAdminDynamicButton( + CFactory::_('Content')->set_($nameListCode, 'CUSTOM_ADMIN_DYNAMIC_BUTTONS', $this->setCustomAdminDynamicButton( $nameListCode - ); + )); // CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER <<>> - $this->fileContentDynamic[$nameListCode][Placefix::_h('CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER')] - = $this->setCustomAdminDynamicButtonController( + CFactory::_('Content')->set_($nameListCode, 'CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER', $this->setCustomAdminDynamicButtonController( $nameListCode - ); + )); // set helper router CFactory::_('Content')->add('ROUTEHELPER', @@ -1115,9 +1018,9 @@ class Infusion extends Interpretation } // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildAdminViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminViewContent', @@ -1125,14 +1028,12 @@ class Infusion extends Interpretation &$nameSingleCode, &$nameListCode, &$fileContentStatic, - &$this->fileContentDynamic, &$this->placeholders, + &$fileContentDynamic, &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); } // all fields stored in database @@ -1153,19 +1054,13 @@ class Infusion extends Interpretation foreach ($this->componentData->custom_admin_views as $view) { // for single views - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SView')] - = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sview')] - = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SVIEW')] - = $view['settings']->CODE; + CFactory::_('Content')->set_($view['settings']->code, 'SView', $view['settings']->Code); + CFactory::_('Content')->set_($view['settings']->code, 'sview', $view['settings']->code); + CFactory::_('Content')->set_($view['settings']->code, 'SVIEW', $view['settings']->CODE); // for list views - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SViews')] - = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sviews')] - = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SVIEWS')] - = $view['settings']->CODE; + CFactory::_('Content')->set_($view['settings']->code, 'SViews', $view['settings']->Code); + CFactory::_('Content')->set_($view['settings']->code, 'sviews', $view['settings']->code); + CFactory::_('Content')->set_($view['settings']->code, 'SVIEWS', $view['settings']->CODE); // add to lang array CFactory::_('Language')->set( CFactory::_('Config')->lang_target, @@ -1178,53 +1073,33 @@ class Infusion extends Interpretation . '_DESC', $view['settings']->description ); // ICOMOON <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('ICOMOON')] - = $view['icomoon']; + CFactory::_('Content')->set_($view['settings']->code, 'ICOMOON', $view['icomoon']); // set placeholders - CFactory::_('Placeholder')->active[Placefix::_h('SView')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_h('sview')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_h('SVIEW')] - = $view['settings']->CODE; - CFactory::_('Placeholder')->active[Placefix::_('SView')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_('sview')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_('SVIEW')] - = $view['settings']->CODE; - CFactory::_('Placeholder')->active[Placefix::_h('SViews')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_h('sviews')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_h('SVIEWS')] - = $view['settings']->CODE; - CFactory::_('Placeholder')->active[Placefix::_('SViews')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_('sviews')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_('SVIEWS')] - = $view['settings']->CODE; + CFactory::_('Placeholder')->set('SView', $view['settings']->Code); + CFactory::_('Placeholder')->set('sview', $view['settings']->code); + CFactory::_('Placeholder')->set('SVIEW', $view['settings']->CODE); + + CFactory::_('Placeholder')->set('SViews', $view['settings']->Code); + CFactory::_('Placeholder')->set('sviews', $view['settings']->code); + CFactory::_('Placeholder')->set('SVIEWS', $view['settings']->CODE); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$fileContentStatic, - &$this->fileContentDynamic[$view['settings']->code], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$view['settings']->code], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); // set license per view if needed $this->setLockLicensePer( @@ -1236,189 +1111,162 @@ class Infusion extends Interpretation && $this->dynamicDashboard === $view['settings']->code) { // HIDEMAINMENU <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('HIDEMAINMENU')] - = ''; + CFactory::_('Content')->set_($view['settings']->code, 'HIDEMAINMENU', ''); } else { // HIDEMAINMENU <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('HIDEMAINMENU')] - = PHP_EOL . Indent::_(2) . '//' . Line::_( + CFactory::_('Content')->set_($view['settings']->code, 'HIDEMAINMENU', PHP_EOL . Indent::_(2) . '//' . Line::_( __LINE__,__CLASS__ ) . " hide the main menu" . PHP_EOL . Indent::_(2) - . "\$this->app->input->set('hidemainmenu', true);"; + . "\$this->app->input->set('hidemainmenu', true);"); } if ($view['settings']->main_get->gettype == 1) { // CUSTOM_ADMIN_BEFORE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEM')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BEFORE_GET_ITEM', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitem', $view['settings']->code, '', null, true - ); + )); // CUSTOM_ADMIN_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_ITEM')] - = $this->setCustomViewGetItem( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_GET_ITEM', $this->setCustomViewGetItem( $view['settings']->main_get, $view['settings']->code, Indent::_(2) - ); + )); // CUSTOM_ADMIN_AFTER_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEM')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_AFTER_GET_ITEM', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitem', $view['settings']->code, '', null, true - ); + )); } elseif ($view['settings']->main_get->gettype == 2) { // CUSTOM_ADMIN_GET_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_LIST_QUERY')] - = $this->setCustomViewListQuery( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_GET_LIST_QUERY', $this->setCustomViewListQuery( $view['settings']->main_get, $view['settings']->code - ); + )); // CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true - ); + )); // CUSTOM_ADMIN_BEFORE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEMS')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BEFORE_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true - ); + )); // CUSTOM_ADMIN_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_ITEMS')] - = $this->setCustomViewGetItems( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_GET_ITEMS', $this->setCustomViewGetItems( $view['settings']->main_get, $view['settings']->code - ); + )); // CUSTOM_ADMIN_AFTER_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEMS')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_AFTER_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true - ); + )); } // CUSTOM_ADMIN_CUSTOM_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_METHODS')] - = $this->setCustomViewCustomItemMethods( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_CUSTOM_METHODS', $this->setCustomViewCustomItemMethods( $view['settings']->main_get, $view['settings']->code - ); - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_METHODS')] - .= $this->setCustomViewCustomMethods( - $view, $view['settings']->code + )); + CFactory::_('Content')->add_($view['settings']->code, 'CUSTOM_ADMIN_CUSTOM_METHODS', + $this->setCustomViewCustomMethods( + $view, $view['settings']->code + ) ); // CUSTOM_ADMIN_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_DIPLAY_METHOD')] - = $this->setCustomViewDisplayMethod($view); + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_DIPLAY_METHOD', $this->setCustomViewDisplayMethod($view)); // set document details $this->setPrepareDocument($view); // CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS')] - = $this->setCustomViewExtraDisplayMethods($view); + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS', $this->setCustomViewExtraDisplayMethods($view)); // CUSTOM_ADMIN_CODE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CODE_BODY')] - = $this->setCustomViewCodeBody($view); + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_CODE_BODY', $this->setCustomViewCodeBody($view)); // CUSTOM_ADMIN_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BODY')] - = $this->setCustomViewBody($view); + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BODY', $this->setCustomViewBody($view)); // CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT')] - = $this->setCustomViewSubmitButtonScript($view); + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT', $this->setCustomViewSubmitButtonScript($view)); // setup the templates $this->setCustomViewTemplateBody($view); // set the site form if needed - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_TOP_FORM')] - = $this->setCustomViewForm( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_TOP_FORM', $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 1 - ); - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BOTTOM_FORM')] - = $this->setCustomViewForm( + )); + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BOTTOM_FORM', $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 2 - ); + )); // set headers based on the main get type if ($view['settings']->main_get->gettype == 1) { // CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER', $this->setFileHeader( 'custom.admin.view.controller', $view['settings']->code - ); + )); // CUSTOM_ADMIN_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_MODEL_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_MODEL_HEADER', $this->setFileHeader( 'custom.admin.view.model', $view['settings']->code - ); + )); // CUSTOM_ADMIN_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_HTML_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_HTML_HEADER', $this->setFileHeader( 'custom.admin.view.html', $view['settings']->code - ); + )); // CUSTOM_ADMIN_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_HEADER', $this->setFileHeader( 'custom.admin.view', $view['settings']->code - ); + )); } elseif ($view['settings']->main_get->gettype == 2) { // CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER', $this->setFileHeader( 'custom.admin.views.controller', $view['settings']->code - ); + )); // CUSTOM_ADMIN_VIEWS_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_MODEL_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_MODEL_HEADER', $this->setFileHeader( 'custom.admin.views.model', $view['settings']->code - ); + )); // CUSTOM_ADMIN_VIEWS_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_HTML_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_HTML_HEADER', $this->setFileHeader( 'custom.admin.views.html', $view['settings']->code - ); + )); // CUSTOM_ADMIN_VIEWS_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_HEADER', $this->setFileHeader( 'custom.admin.views', $view['settings']->code - ); + )); } // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$fileContentStatic, - &$this->fileContentDynamic[$view['settings']->code], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$view['settings']->code], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); } // setup the layouts @@ -1489,37 +1337,28 @@ class Infusion extends Interpretation CFactory::_('Content')->set('DASHBOARDVIEW', CFactory::_('Config')->component_code_name); // DASHBOARDICONS - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASHBOARDICONS')] - = $this->setDashboardIcons(); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASHBOARDICONS', $this->setDashboardIcons()); // DASHBOARDICONACCESS - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASHBOARDICONACCESS')] - = $this->setDashboardIconAccess(); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASHBOARDICONACCESS', $this->setDashboardIconAccess()); // DASH_MODEL_METHODS - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_MODEL_METHODS')] - = $this->setDashboardModelMethods(); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_MODEL_METHODS', $this->setDashboardModelMethods()); // DASH_GET_CUSTOM_DATA - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_GET_CUSTOM_DATA')] - = $this->setDashboardGetCustomData(); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_GET_CUSTOM_DATA', $this->setDashboardGetCustomData()); // DASH_DISPLAY_DATA - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_DISPLAY_DATA')] - = $this->setDashboardDisplayData(); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_DISPLAY_DATA', $this->setDashboardDisplayData()); // DASH_VIEW_HEADER - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_VIEW_HEADER')] - = $this->setFileHeader('dashboard.view', 'dashboard'); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_VIEW_HEADER', $this->setFileHeader('dashboard.view', 'dashboard')); // DASH_VIEW_HTML_HEADER - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_VIEW_HTML_HEADER')] - = $this->setFileHeader('dashboard.view.html', 'dashboard'); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_VIEW_HTML_HEADER', $this->setFileHeader('dashboard.view.html', 'dashboard')); // DASH_MODEL_HEADER - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_MODEL_HEADER')] - = $this->setFileHeader('dashboard.model', 'dashboard'); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_MODEL_HEADER', $this->setFileHeader('dashboard.model', 'dashboard')); // DASH_CONTROLLER_HEADER - $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_CONTROLLER_HEADER')] - = $this->setFileHeader('dashboard.controller', 'dashboard'); + CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_CONTROLLER_HEADER', $this->setFileHeader('dashboard.controller', 'dashboard')); } else { @@ -1534,23 +1373,17 @@ class Infusion extends Interpretation $target = array('admin' => 'import'); $this->buildDynamique($target, 'import'); // IMPORT_EXT_METHOD <<>> - $this->fileContentDynamic['import'][Placefix::_h('IMPORT_EXT_METHOD')] - = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - ComponentbuilderHelper::getDynamicScripts('ext'), - CFactory::_('Placeholder')->active - ); + CFactory::_('Content')->set_('import', 'IMPORT_EXT_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + ComponentbuilderHelper::getDynamicScripts('ext') + )); // IMPORT_SETDATA_METHOD <<>> - $this->fileContentDynamic['import'][Placefix::_h('IMPORT_SETDATA_METHOD')] - = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - ComponentbuilderHelper::getDynamicScripts('setdata'), - CFactory::_('Placeholder')->active - ); + CFactory::_('Content')->set_('import', 'IMPORT_SETDATA_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + ComponentbuilderHelper::getDynamicScripts('setdata') + )); // IMPORT_SAVE_METHOD <<>> - $this->fileContentDynamic['import'][Placefix::_h('IMPORT_SAVE_METHOD')] - = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - ComponentbuilderHelper::getDynamicScripts('save'), - CFactory::_('Placeholder')->active - ); + CFactory::_('Content')->set_('import', 'IMPORT_SAVE_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_( + ComponentbuilderHelper::getDynamicScripts('save') + )); } // ensure that the ajax model and controller is set if needed @@ -1560,16 +1393,12 @@ class Infusion extends Interpretation $target = array('admin' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax'][Placefix::_h('REGISTER_AJAX_TASK')] - = $this->setRegisterAjaxTask('admin'); - $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_INPUT_RETURN')] - = $this->setAjaxInputReturn('admin'); + CFactory::_('Content')->set_('ajax', 'REGISTER_AJAX_TASK', $this->setRegisterAjaxTask('admin')); + CFactory::_('Content')->set_('ajax', 'AJAX_INPUT_RETURN', $this->setAjaxInputReturn('admin')); // set the model header - $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_ADMIN_MODEL_HEADER')] - = $this->setFileHeader('ajax.admin.model', 'ajax'); + CFactory::_('Content')->set_('ajax', 'AJAX_ADMIN_MODEL_HEADER', $this->setFileHeader('ajax.admin.model', 'ajax')); // set the module - $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_MODEL_METHODS')] - = $this->setAjaxModelMethods('admin'); + CFactory::_('Content')->set_('ajax', 'AJAX_MODEL_METHODS', $this->setAjaxModelMethods('admin')); } // ensure that the site ajax model and controller is set if needed @@ -1579,16 +1408,12 @@ class Infusion extends Interpretation $target = array('site' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax'][Placefix::_h('REGISTER_SITE_AJAX_TASK')] - = $this->setRegisterAjaxTask('site'); - $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_INPUT_RETURN')] - = $this->setAjaxInputReturn('site'); + CFactory::_('Content')->set_('ajax', 'REGISTER_SITE_AJAX_TASK', $this->setRegisterAjaxTask('site')); + CFactory::_('Content')->set_('ajax', 'AJAX_SITE_INPUT_RETURN', $this->setAjaxInputReturn('site')); // set the model header - $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_MODEL_HEADER')] - = $this->setFileHeader('ajax.site.model', 'ajax'); + CFactory::_('Content')->set_('ajax', 'AJAX_SITE_MODEL_HEADER', $this->setFileHeader('ajax.site.model', 'ajax')); // set the module - $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_MODEL_METHODS')] - = $this->setAjaxModelMethods('site'); + CFactory::_('Content')->set_('ajax', 'AJAX_SITE_MODEL_METHODS', $this->setAjaxModelMethods('site')); } // build the validation rules @@ -1600,11 +1425,9 @@ class Infusion extends Interpretation $target = array('admin' => 'a_rule_zi'); $this->buildDynamique($target, 'rule', $rule); // set the JFormRule Name - $this->fileContentDynamic['a_rule_zi_' . $rule][Placefix::_h('Name')] - = ucfirst($rule); + CFactory::_('Content')->set_('a_rule_zi_' . $rule, 'Name', ucfirst($rule)); // set the JFormRule PHP - $this->fileContentDynamic['a_rule_zi_' . $rule][Placefix::_h('VALIDATION_RULE_METHODS')] - = PHP_EOL . $_php; + CFactory::_('Content')->set_('a_rule_zi_' . $rule, 'VALIDATION_RULE_METHODS', PHP_EOL . $_php); } } @@ -1644,60 +1467,37 @@ class Infusion extends Interpretation foreach ($this->componentData->site_views as $view) { // for list views - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SViews')] - = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sviews')] - = $view['settings']->code; + CFactory::_('Content')->set_($view['settings']->code, 'SViews', $view['settings']->Code); + CFactory::_('Content')->set_($view['settings']->code, 'sviews', $view['settings']->code); // for single views - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SView')] - = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sview')] - = $view['settings']->code; + CFactory::_('Content')->set_($view['settings']->code, 'SView', $view['settings']->Code); + CFactory::_('Content')->set_($view['settings']->code, 'sview', $view['settings']->code); - // set placeholder - CFactory::_('Placeholder')->active[Placefix::_h('SView')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_h('sview')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_h('SVIEW')] - = $view['settings']->CODE; - CFactory::_('Placeholder')->active[Placefix::_('SView')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_('sview')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_('SVIEW')] - = $view['settings']->CODE; - CFactory::_('Placeholder')->active[Placefix::_h('SViews')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_h('sviews')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_h('SVIEWS')] - = $view['settings']->CODE; - CFactory::_('Placeholder')->active[Placefix::_('SViews')] - = $view['settings']->Code; - CFactory::_('Placeholder')->active[Placefix::_('sviews')] - = $view['settings']->code; - CFactory::_('Placeholder')->active[Placefix::_('SVIEWS')] - = $view['settings']->CODE; + // set placeholders + CFactory::_('Placeholder')->set('SView', $view['settings']->Code); + CFactory::_('Placeholder')->set('sview', $view['settings']->code); + CFactory::_('Placeholder')->set('SVIEW', $view['settings']->CODE); + + CFactory::_('Placeholder')->set('SViews', $view['settings']->Code); + CFactory::_('Placeholder')->set('sviews', $view['settings']->code); + CFactory::_('Placeholder')->set('SVIEWS', $view['settings']->CODE); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildSiteViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$fileContentStatic, - &$this->fileContentDynamic[$view['settings']->code], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$view['settings']->code], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); // set license per view if needed $this->setLockLicensePer( @@ -1714,8 +1514,7 @@ class Infusion extends Interpretation if (isset($view['menu']) && $view['menu'] == 1) { // SITE_MENU_XML <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_MENU_XML')] - = $this->setCustomViewMenu($view); + CFactory::_('Content')->set_($view['settings']->code, 'SITE_MENU_XML', $this->setCustomViewMenu($view)); } // insure the needed route helper is loaded @@ -1733,60 +1532,51 @@ class Infusion extends Interpretation if ($view['settings']->main_get->gettype == 1) { // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('USER_PERMISSION_CHECK_ACCESS')] - = $this->setUserPermissionCheckAccess($view, 1); + CFactory::_('Content')->set_($view['settings']->code, 'USER_PERMISSION_CHECK_ACCESS', $this->setUserPermissionCheckAccess($view, 1)); // SITE_BEFORE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEM')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_BEFORE_GET_ITEM', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitem', $view['settings']->code, '', null, true - ); + )); // SITE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_ITEM')] - = $this->setCustomViewGetItem( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_GET_ITEM', $this->setCustomViewGetItem( $view['settings']->main_get, $view['settings']->code, Indent::_(2) - ); + )); // SITE_AFTER_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEM')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_AFTER_GET_ITEM', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitem', $view['settings']->code, '', null, true - ); + )); } elseif ($view['settings']->main_get->gettype == 2) { // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('USER_PERMISSION_CHECK_ACCESS')] - = $this->setUserPermissionCheckAccess($view, 2); + CFactory::_('Content')->set_($view['settings']->code, 'USER_PERMISSION_CHECK_ACCESS', $this->setUserPermissionCheckAccess($view, 2)); // SITE_GET_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_LIST_QUERY')] - = $this->setCustomViewListQuery( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_GET_LIST_QUERY', $this->setCustomViewListQuery( $view['settings']->main_get, $view['settings']->code - ); + )); // SITE_BEFORE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEMS')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_BEFORE_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true - ); + )); // SITE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_ITEMS')] - = $this->setCustomViewGetItems( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_GET_ITEMS', $this->setCustomViewGetItems( $view['settings']->main_get, $view['settings']->code - ); + )); // SITE_AFTER_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEMS')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_AFTER_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true - ); + )); } // add to lang array CFactory::_('Language')->set( @@ -1800,43 +1590,37 @@ class Infusion extends Interpretation . '_DESC', $view['settings']->description ); // SITE_CUSTOM_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CUSTOM_METHODS')] - = $this->setCustomViewCustomItemMethods( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_CUSTOM_METHODS', $this->setCustomViewCustomItemMethods( $view['settings']->main_get, $view['settings']->code - ); - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CUSTOM_METHODS')] - .= $this->setCustomViewCustomMethods( - $view, $view['settings']->code + )); + CFactory::_('Content')->add_($view['settings']->code, 'SITE_CUSTOM_METHODS', + $this->setCustomViewCustomMethods( + $view, $view['settings']->code + ) ); // SITE_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_DIPLAY_METHOD')] - = $this->setCustomViewDisplayMethod($view); + CFactory::_('Content')->set_($view['settings']->code, 'SITE_DIPLAY_METHOD', $this->setCustomViewDisplayMethod($view)); // set document details $this->setPrepareDocument($view); // SITE_EXTRA_DIPLAY_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_EXTRA_DIPLAY_METHODS')] - = $this->setCustomViewExtraDisplayMethods($view); + CFactory::_('Content')->set_($view['settings']->code, 'SITE_EXTRA_DIPLAY_METHODS', $this->setCustomViewExtraDisplayMethods($view)); // SITE_CODE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CODE_BODY')] - = $this->setCustomViewCodeBody($view); + CFactory::_('Content')->set_($view['settings']->code, 'SITE_CODE_BODY', $this->setCustomViewCodeBody($view)); // SITE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BODY')] - = $this->setCustomViewBody($view); + CFactory::_('Content')->set_($view['settings']->code, 'SITE_BODY', $this->setCustomViewBody($view)); // setup the templates $this->setCustomViewTemplateBody($view); // set the site form if needed - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_TOP_FORM')] - = $this->setCustomViewForm( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_TOP_FORM', $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 1 - ); - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BOTTOM_FORM')] - = $this->setCustomViewForm( + )); + CFactory::_('Content')->set_($view['settings']->code, 'SITE_BOTTOM_FORM', $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 2 - ); + )); // set headers based on the main get type if ($view['settings']->main_get->gettype == 1) @@ -1848,26 +1632,22 @@ class Infusion extends Interpretation && $view['settings']->php_controller != '//') { // SITE_VIEW_CONTROLLER_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_CONTROLLER_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_CONTROLLER_HEADER', $this->setFileHeader( 'site.view.controller', $view['settings']->code - ); + )); } // SITE_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_MODEL_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_MODEL_HEADER', $this->setFileHeader( 'site.view.model', $view['settings']->code - ); + )); // SITE_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_HTML_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_HTML_HEADER', $this->setFileHeader( 'site.view.html', $view['settings']->code - ); + )); // SITE_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_HEADER', $this->setFileHeader( 'site.view', $view['settings']->code - ); + )); } elseif ($view['settings']->main_get->gettype == 2) { @@ -1878,46 +1658,40 @@ class Infusion extends Interpretation && $view['settings']->php_controller != '//') { // SITE_VIEW_CONTROLLER_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_CONTROLLER_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_CONTROLLER_HEADER', $this->setFileHeader( 'site.views.controller', $view['settings']->code - ); + )); } // SITE_VIEWS_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_MODEL_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEWS_MODEL_HEADER', $this->setFileHeader( 'site.views.model', $view['settings']->code - ); + )); // SITE_VIEWS_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_HTML_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEWS_HTML_HEADER', $this->setFileHeader( 'site.views.html', $view['settings']->code - ); + )); // SITE_VIEWS_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEWS_HEADER', $this->setFileHeader( 'site.views', $view['settings']->code - ); + )); } // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildSiteViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$fileContentStatic, - &$this->fileContentDynamic[$view['settings']->code], - &$this->placeholders, &$this->hhh) + &$fileContentDynamic[$view['settings']->code], + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); } // setup the layouts @@ -1926,10 +1700,10 @@ class Infusion extends Interpretation else { // clear all site folder since none is needed - $this->removeSiteFolder = true; + CFactory::_('Config')->remove_site_folder = true; } // load the site statics - if (!$this->removeSiteFolder || !$this->removeSiteEditFolder) + if (!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder) { CFactory::_('Config')->build_target = 'site'; // if no default site view was set, the redirect to root @@ -1940,9 +1714,8 @@ class Infusion extends Interpretation // set site custom script to helper class // SITE_CUSTOM_HELPER_SCRIPT CFactory::_('Content')->set('SITE_CUSTOM_HELPER_SCRIPT', - CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_php_helper_site'], - CFactory::_('Placeholder')->active + CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_site'] )); // SITE_GLOBAL_EVENT_HELPER if (!CFactory::_('Content')->exist('SITE_GLOBAL_EVENT')) @@ -1971,34 +1744,33 @@ class Infusion extends Interpretation . 'public static function globalEvent($document)'); CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '{'); CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', - PHP_EOL . CFactory::_('Placeholder')->update( - CFactory::_('Customcode.Dispenser')->hub['component_php_site_event'], - CFactory::_('Placeholder')->active + PHP_EOL . CFactory::_('Placeholder')->update_( + CFactory::_('Customcode.Dispenser')->hub['component_php_site_event'] )); CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '}'); } } // PREINSTALLSCRIPT - CFactory::_('Content')->set('PREINSTALLSCRIPT', + CFactory::_('Content')->add('PREINSTALLSCRIPT', CFactory::_('Customcode.Dispenser')->get( 'php_preflight', 'install', PHP_EOL, null, true )); // PREUPDATESCRIPT - CFactory::_('Content')->set('PREUPDATESCRIPT', + CFactory::_('Content')->add('PREUPDATESCRIPT', CFactory::_('Customcode.Dispenser')->get( 'php_preflight', 'update', PHP_EOL, null, true )); // POSTINSTALLSCRIPT - CFactory::_('Content')->set('POSTINSTALLSCRIPT', $this->setPostInstallScript()); + CFactory::_('Content')->add('POSTINSTALLSCRIPT', $this->setPostInstallScript()); // POSTUPDATESCRIPT - CFactory::_('Content')->set('POSTUPDATESCRIPT', $this->setPostUpdateScript()); + CFactory::_('Content')->add('POSTUPDATESCRIPT', $this->setPostUpdateScript()); // UNINSTALLSCRIPT - CFactory::_('Content')->set('UNINSTALLSCRIPT', $this->setUninstallScript()); + CFactory::_('Content')->add('UNINSTALLSCRIPT', $this->setUninstallScript()); // MOVEFOLDERSSCRIPT CFactory::_('Content')->set('MOVEFOLDERSSCRIPT', $this->setMoveFolderScript()); @@ -2034,6 +1806,7 @@ class Infusion extends Interpretation CFactory::_('Content')->set('ADMIN_POWER_HELPER', ''); CFactory::_('Content')->set('SITE_POWER_HELPER', ''); CFactory::_('Content')->set('CUSTOM_POWER_AUTOLOADER', ''); + // infuse powers data if set if (ArrayHelper::check(CFactory::_('Power')->active)) { @@ -2049,10 +1822,7 @@ class Infusion extends Interpretation array(&$this->componentContext, &$power, &$this) ); // POWERCODE - $this->fileContentDynamic[$power->key][Placefix::_h('POWERCODE')] - = $this->getPowerCode($power); - // build the autoloader - $autoloader[implode('.', $power->_namespace_prefix)] = $power->_namespace_prefix; + CFactory::_('Content')->set_($power->key, 'POWERCODE', $this->getPowerCode($power)); // Trigger Event: jcb_ce_onAfterInfusePowerData CFactory::_('Event')->trigger( 'jcb_ce_onAfterInfusePowerData', @@ -2061,7 +1831,7 @@ class Infusion extends Interpretation } } // now set the power autoloader - $this->setPowersAutoloader($autoloader, (!$this->removeSiteFolder || !$this->removeSiteEditFolder)); + CFactory::_('Power.Autoloader')->set((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder)); } // tweak system to set stuff to the module domain $_backup_target = CFactory::_('Config')->build_target; @@ -2084,28 +1854,23 @@ class Infusion extends Interpretation $this->langPrefix = $module->lang_prefix; CFactory::_('Config')->set('lang_prefix', $module->lang_prefix); // MODCODE - $this->fileContentDynamic[$module->key][Placefix::_h('MODCODE')] - = $this->getModCode($module); + CFactory::_('Content')->set_($module->key, 'MODCODE', $this->getModCode($module)); // DYNAMICGET - $this->fileContentDynamic[$module->key][Placefix::_h('DYNAMICGETS')] - = $this->setCustomViewCustomMethods( + CFactory::_('Content')->set_($module->key, 'DYNAMICGETS', $this->setCustomViewCustomMethods( $module, $module->key - ); + )); // HELPERCODE if ($module->add_class_helper >= 1) { - $this->fileContentDynamic[$module->key][Placefix::_h('HELPERCODE')] - = $this->getModHelperCode($module); + CFactory::_('Content')->set_($module->key, 'HELPERCODE', $this->getModHelperCode($module)); } // MODDEFAULT - $this->fileContentDynamic[$module->key][Placefix::_h('MODDEFAULT')] - = $this->getModDefault($module, $module->key); + CFactory::_('Content')->set_($module->key, 'MODDEFAULT', $this->getModDefault($module, $module->key)); // only add install script if needed if ($module->add_install_script) { // INSTALLCLASS - $this->fileContentDynamic[$module->key][Placefix::_h('INSTALLCLASS')] - = CFactory::_('Extension.InstallScript')->get($module); + CFactory::_('Content')->set_($module->key, 'INSTALLCLASS', CFactory::_('Extension.InstallScript')->get($module)); } // FIELDSET if (isset($module->form_files) @@ -2120,18 +1885,18 @@ class Infusion extends Interpretation foreach ($fieldsets as $fieldset => $fields) { // FIELDSET_ . $file.$field_name.$fieldset - $this->fileContentDynamic[$module->key][Placefix::_h('FIELDSET_' - . $file . $field_name . $fieldset)] - = $this->getExtensionFieldsetXML( - $module, $fields + CFactory::_('Content')->set_($module->key, + 'FIELDSET_' . $file . $field_name . $fieldset, + $this->getExtensionFieldsetXML( + $module, $fields + ) ); } } } } // MAINXML - $this->fileContentDynamic[$module->key][Placefix::_h('MAINXML')] - = $this->getModuleMainXML($module); + CFactory::_('Content')->set_($module->key, 'MAINXML', $this->getModuleMainXML($module)); // Trigger Event: jcb_ce_onAfterInfuseModuleData CFactory::_('Event')->trigger( 'jcb_ce_onAfterInfuseModuleData', @@ -2157,14 +1922,12 @@ class Infusion extends Interpretation $this->langPrefix = $plugin->lang_prefix; CFactory::_('Config')->set('lang_prefix', $plugin->lang_prefix); // MAINCLASS - $this->fileContentDynamic[$plugin->key][Placefix::_h('MAINCLASS')] - = $this->getPluginMainClass($plugin); + CFactory::_('Content')->set_($plugin->key, 'MAINCLASS', $this->getPluginMainClass($plugin)); // only add install script if needed if ($plugin->add_install_script) { // INSTALLCLASS - $this->fileContentDynamic[$plugin->key][Placefix::_h('INSTALLCLASS')] - = CFactory::_('Extension.InstallScript')->get($plugin); + CFactory::_('Content')->set_($plugin->key, 'INSTALLCLASS', CFactory::_('Extension.InstallScript')->get($plugin)); } // FIELDSET if (isset($plugin->form_files) @@ -2179,18 +1942,18 @@ class Infusion extends Interpretation foreach ($fieldsets as $fieldset => $fields) { // FIELDSET_ . $file.$field_name.$fieldset - $this->fileContentDynamic[$plugin->key][Placefix::_h( - 'FIELDSET_' . $file . $field_name . $fieldset)] - = $this->getExtensionFieldsetXML( - $plugin, $fields + CFactory::_('Content')->set_($plugin->key, + 'FIELDSET_' . $file . $field_name . $fieldset, + $this->getExtensionFieldsetXML( + $plugin, $fields + ) ); } } } } // MAINXML - $this->fileContentDynamic[$plugin->key][Placefix::_h('MAINXML')] - = $this->getPluginMainXML($plugin); + CFactory::_('Content')->set_($plugin->key, 'MAINXML', $this->getPluginMainXML($plugin)); // Trigger Event: jcb_ce_onAfterInfusePluginData CFactory::_('Event')->trigger( 'jcb_ce_onAfterInfusePluginData', @@ -2205,21 +1968,19 @@ class Infusion extends Interpretation $this->langPrefix = $_backup_langPrefix; CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); // for plugin event TODO change event api signatures - $this->placeholders = CFactory::_('Placeholder')->active; + $placeholders = CFactory::_('Placeholder')->active; $fileContentStatic = CFactory::_('Content')->active; - // $this->fileContentDynamic = CFactory::_('Content')->_active; + $fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildFilesContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$fileContentStatic, &$this->fileContentDynamic, - &$this->placeholders, &$this->hhh) + &$placeholders, &$this->hhh) ); - // for plugin event TODO change event api signatures - CFactory::_('Placeholder')->active = $this->placeholders; - CFactory::_('Content')->active = $fileContentStatic; - // CFactory::_('Content')->_active = $this->fileContentDynamic; unset($fileContentStatic); + unset($fileContentDynamic); + unset($placeholders); return true; } @@ -2238,6 +1999,7 @@ class Infusion extends Interpretation { // just to be safe, lets clear previous view placeholders CFactory::_('Placeholder')->clearType('view'); + CFactory::_('Placeholder')->clearType('views'); // VIEW <<>> if (isset($view->name_single) && $view->name_single != 'null') @@ -2252,18 +2014,9 @@ class Infusion extends Interpretation ); // set some place holder for the views - CFactory::_('Placeholder')->active[Placefix::_h('view')] - = $nameSingleCode; - CFactory::_('Placeholder')->active[Placefix::_h('View')] - = $name_single_first_uppercase; - CFactory::_('Placeholder')->active[Placefix::_h('VIEW')] - = $name_single_uppercase; - CFactory::_('Placeholder')->active[Placefix::_('view')] - = $nameSingleCode; - CFactory::_('Placeholder')->active[Placefix::_('View')] - = $name_single_first_uppercase; - CFactory::_('Placeholder')->active[Placefix::_('VIEW')] - = $name_single_uppercase; + CFactory::_('Placeholder')->set('view', $nameSingleCode); + CFactory::_('Placeholder')->set('View', $name_single_first_uppercase); + CFactory::_('Placeholder')->set('VIEW', $name_single_uppercase); } // VIEWS <<>> @@ -2278,59 +2031,38 @@ class Infusion extends Interpretation ); // set some place holder for the views - CFactory::_('Placeholder')->active[Placefix::_h('views')] - = $nameListCode; - CFactory::_('Placeholder')->active[Placefix::_h('Views')] - = $name_list_first_uppercase; - CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')] - = $name_list_uppercase; - CFactory::_('Placeholder')->active[Placefix::_('views')] - = $nameListCode; - CFactory::_('Placeholder')->active[Placefix::_('Views')] - = $name_list_first_uppercase; - CFactory::_('Placeholder')->active[Placefix::_('VIEWS')] - = $name_list_uppercase; + CFactory::_('Placeholder')->set('views', $nameListCode); + CFactory::_('Placeholder')->set('Views', $name_list_first_uppercase); + CFactory::_('Placeholder')->set('VIEWS', $name_list_uppercase); } // view <<>> if (isset($nameSingleCode)) { - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('view')] - = $nameSingleCode; - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEW')] - = $name_single_uppercase; - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('View')] - = $name_single_first_uppercase; + CFactory::_('Content')->set_($nameSingleCode, 'view', $nameSingleCode); + CFactory::_('Content')->set_($nameSingleCode, 'VIEW', $name_single_uppercase); + CFactory::_('Content')->set_($nameSingleCode, 'View', $name_single_first_uppercase); if (isset($nameListCode)) { - $this->fileContentDynamic[$nameListCode][Placefix::_h('view')] - = $nameSingleCode; - $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEW')] - = $name_single_uppercase; - $this->fileContentDynamic[$nameListCode][Placefix::_h('View')] - = $name_single_first_uppercase; + CFactory::_('Content')->set_($nameListCode, 'view', $nameSingleCode); + CFactory::_('Content')->set_($nameListCode, 'VIEW', $name_single_uppercase); + CFactory::_('Content')->set_($nameListCode, 'View', $name_single_first_uppercase); } } // views <<>> if (isset($nameListCode)) { - $this->fileContentDynamic[$nameListCode][Placefix::_h('views')] - = $nameListCode; - $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS')] - = $name_list_uppercase; - $this->fileContentDynamic[$nameListCode][Placefix::_h('Views')] - = $name_list_first_uppercase; + CFactory::_('Content')->set_($nameListCode, 'views', $nameListCode); + CFactory::_('Content')->set_($nameListCode, 'VIEWS', $name_list_uppercase); + CFactory::_('Content')->set_($nameListCode, 'Views', $name_list_first_uppercase); if (isset($nameSingleCode)) { - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('views')] - = $nameListCode; - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWS')] - = $name_list_uppercase; - $this->fileContentDynamic[$nameSingleCode][Placefix::_h('Views')] - = $name_list_first_uppercase; + CFactory::_('Content')->set_($nameSingleCode, 'views', $nameListCode); + CFactory::_('Content')->set_($nameSingleCode, 'VIEWS', $name_list_uppercase); + CFactory::_('Content')->set_($nameSingleCode, 'Views', $name_list_first_uppercase); } } } @@ -2367,7 +2099,7 @@ class Infusion extends Interpretation ); } // check the site lang is set - if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) + if ((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder) && $this->setLangSite()) { $values[] = array_values( @@ -2378,7 +2110,7 @@ class Infusion extends Interpretation ); } // check the site system lang is set - if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) + if ((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder) && $this->setLangSiteSys()) { $values[] = array_values( @@ -2421,8 +2153,8 @@ class Infusion extends Interpretation $t = ''; if (strpos($area, 'site') !== false) { - if ($this->removeSiteFolder - && $this->removeSiteEditFolder) + if (CFactory::_('Config')->remove_site_folder + && CFactory::_('Config')->remove_site_edit_folder) { continue; } @@ -2491,7 +2223,7 @@ class Infusion extends Interpretation $replace[Placefix::_h('ADMIN_LANGUAGES')] = implode(PHP_EOL . Indent::_(3), $langXML['admin']); } - if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) + if ((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder) && isset($langXML['site']) && ArrayHelper::check($langXML['site'])) { diff --git a/componentbuilder.xml b/componentbuilder.xml index dc22412d7..dd7c7fece 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 4th December, 2022 + 11th December, 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 index cad4fad30..429463b4a 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -416,6 +416,28 @@ class Config extends BaseConfig { return false; } + + /** + * Should we remove the site folder + * + * @return bool Switch to control the removal + * @since 3.2.0 + */ + protected function getRemovesitefolder(): bool + { + return false; + } + + /** + * Should we remove the site edit folder + * + * @return bool Switch to control the removal + * @since 3.2.0 + */ + protected function getRemovesiteeditfolder(): bool + { + return true; + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Content.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Content.php index 2da198f39..f4e3e35df 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Content.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Content.php @@ -104,6 +104,19 @@ class Content } } + /** + * Remove content + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove(string $key) + { + unset($this->active[Placefix::_h($key)]); + } + /** * Set dynamic content * @@ -122,15 +135,15 @@ class Content /** * Get dynamic content * - * @param string $view The view key - * @param string $key The main string key + * @param string $view The view key + * @param string|null $key The main string key * * @return mixed * @since 3.2.0 */ - public function get_(string $view, string $key = null) + public function get_(string $view, ?string $key = null) { - if (!is_null($key)) + if (is_string($key)) { return $this->_active[$view][Placefix::_h($key)] ?? null; } @@ -140,19 +153,23 @@ class Content /** * Does view key exist * - * @param string $view The view key - * @param string $key The main string key + * @param string $view The view key + * @param string|null $key The main string key * * @return bool * @since 3.2.0 */ - public function exist_(string $view, string $key): bool + public function exist_(string $view, ?string $key = null): bool { - if (isset($this->_active[$view]) && + if (is_string($key) && isset($this->_active[$view]) && isset($this->_active[$view][Placefix::_h($key)])) { return true; } + elseif (is_null($key) && isset($this->_active[$view])) + { + return true; + } return false; } @@ -178,6 +195,27 @@ class Content $this->_active[$view][Placefix::_h($key)] = $value; } } + + /** + * Remove dynamic content + * + * @param string $view The view key + * @param string|null $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_(string $view, ?string $key = null) + { + if (is_string($key)) + { + unset($this->_active[$view][Placefix::_h($key)]); + } + else + { + unset($this->_active[$view]); + } + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/PlaceholderInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/PlaceholderInterface.php index dc6b8cee5..50eb87ee2 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/PlaceholderInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/PlaceholderInterface.php @@ -19,6 +19,164 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; */ interface PlaceholderInterface { + /** + * Set content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function set(string $key, $value, bool $hash = true); + + /** + * Get content by key + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $key); + + /** + * Does key exist at all in any variation + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $key): bool; + + /** + * Add content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function add(string $key, $value, bool $hash = true); + + /** + * Remove content + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove(string $key); + + /** + * Set content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_(string $key, $value); + + /** + * Get content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_(string $key); + + /** + * Does key exist with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_(string $key): bool; + + /** + * Add content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_(string $key, $value); + + /** + * Remove content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_(string $key); + + /** + * Set content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_h(string $key, $value); + + /** + * Get content with # # # hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_h(string $key); + + /** + * Does key exist with # # # hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_h(string $key): bool; + + /** + * Add content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_h(string $key, $value); + + /** + * Remove content with # # # hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_h(string $key); + /** * Set a type of placeholder with set of values * @@ -57,6 +215,16 @@ interface PlaceholderInterface */ public function update(string $data, array &$placeholder, int $action = 1): string; + /** + * Update the data with the active placeholders + * + * @param string $data The actual data + * + * @return string + * @since 3.2.0 + */ + public function update_(string $data): string; + /** * return the placeholders for inserted and replaced code * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php index 102bd0f98..83eaf599c 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php @@ -13,8 +13,6 @@ namespace VDM\Joomla\Componentbuilder\Compiler; use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; @@ -56,6 +54,270 @@ class Placeholder implements PlaceholderInterface $this->config = $config ?: Compiler::_('Config'); } + /** + * Set content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function set(string $key, $value, bool $hash = true) + { + if ($hash) + { + $this->set_($key, $value); + $this->set_h($key, $value); + } + else + { + $this->active[$key] = $value; + } + } + + /** + * Get content by key + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $key) + { + return $this->active[$key] ?? $this->get_($key) ?? $this->get_h($key) ?? null; + } + + /** + * Does key exist at all in any variation + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $key): bool + { + if (isset($this->active[$key]) || $this->exist_($key) || $this->exist_h($key)) + { + return true; + } + + return false; + } + + /** + * Add content + * + * @param string $key The main string key + * @param mixed $value The values to set + * @param bool $hash Add the hash around the key + * + * @return void + * @since 3.2.0 + */ + public function add(string $key, $value, bool $hash = true) + { + if ($hash) + { + $this->add_($key, $value); + $this->add_h($key, $value); + } + elseif (isset($this->active[$key])) + { + $this->active[$key] .= $value; + } + else + { + $this->active[$key] = $value; + } + } + + /** + * Remove content + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove(string $key) + { + if (isset($this->active[$key])) + { + unset($this->active[$key]); + } + else + { + $this->remove_($key); + $this->remove_h($key); + } + } + + /** + * Set content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_(string $key, $value) + { + $this->active[Placefix::_($key)] = $value; + } + + /** + * Get content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_(string $key) + { + return $this->active[Placefix::_($key)] ?? null; + } + + /** + * Does key exist with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_(string $key): bool + { + if (isset($this->active[Placefix::_($key)])) + { + return true; + } + return false; + } + + /** + * Add content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_(string $key, $value) + { + if (isset($this->active[Placefix::_($key)])) + { + $this->active[Placefix::_($key)] .= $value; + } + else + { + $this->active[Placefix::_($key)] = $value; + } + } + + /** + * Remove content with [ [ [ ... ] ] ] hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_(string $key) + { + if ($this->exist_($key)) + { + unset($this->active[Placefix::_($key)]); + } + } + + /** + * Set content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function set_h(string $key, $value) + { + $this->active[Placefix::_h($key)] = $value; + } + + /** + * Get content with # # # hash + * + * @param string $key The main string key + * + * @return mixed + * @since 3.2.0 + */ + public function get_h(string $key) + { + return $this->active[Placefix::_h($key)] ?? null; + } + + /** + * Does key exist with # # # hash + * + * @param string $key The main string key + * + * @return bool + * @since 3.2.0 + */ + public function exist_h(string $key): bool + { + if (isset($this->active[Placefix::_h($key)])) + { + return true; + } + return false; + } + + /** + * Add content with # # # hash + * + * @param string $key The main string key + * @param mixed $value The values to set + * + * @return void + * @since 3.2.0 + */ + public function add_h(string $key, $value) + { + if ($this->exist_h($key)) + { + $this->active[Placefix::_h($key)] .= $value; + } + else + { + $this->active[Placefix::_h($key)] = $value; + } + } + + /** + * Remove content with # # # hash + * + * @param string $key The main string key + * + * @return void + * @since 3.2.0 + */ + public function remove_h(string $key) + { + if ($this->exist_h($key)) + { + unset($this->active[Placefix::_h($key)]); + } + } + /** * Set a type of placeholder with set of values * @@ -76,8 +338,7 @@ class Placeholder implements PlaceholderInterface $number = 0; foreach ($values as $value) { - $this->active[Placefix::_($key . $number)] - = $value; + $this->set($key . $number, $value); $number++; } } @@ -93,15 +354,18 @@ class Placeholder implements PlaceholderInterface */ public function clearType(string $key) { - $key = Placefix::_($key); + $keys = [Placefix::_($key), Placefix::_h($key), $key]; - $this->active = array_filter( - $this->active, - function(string $k) use($key){ - return preg_replace('/\d/', '', $k) !== $key; - }, - ARRAY_FILTER_USE_KEY - ); + foreach ($keys as $_key) + { + $this->active = array_filter( + $this->active, + function (string $k) use ($_key) { + return preg_replace('/\d/', '', $k) !== $_key; + }, + ARRAY_FILTER_USE_KEY + ); + } } /** @@ -124,9 +388,9 @@ class Placeholder implements PlaceholderInterface // make sure the placeholders is an array if (!ArrayHelper::check($placeholder)) { - // This is an error, TODO actually we need to add a kind of log here to know that this happened return $data; } + // continue with the work of replacement if (1 == $action) // <-- just replace (default) { @@ -148,7 +412,6 @@ class Placeholder implements PlaceholderInterface // only replace if the data has these placeholder values if ($replace === true) { - return str_replace( array_keys($placeholder), array_values($placeholder), $data ); @@ -176,6 +439,22 @@ class Placeholder implements PlaceholderInterface return $data; } + /** + * Update the data with the active placeholders + * + * @param string $data The actual data + * + * @return string + * @since 3.2.0 + */ + public function update_(string $data): string + { + // just replace the placeholders in data + return str_replace( + array_keys($this->active), array_values($this->active), $data + ); + } + /** * return the placeholders for inserted and replaced code * @@ -239,7 +518,6 @@ class Placeholder implements PlaceholderInterface return [ 'start' => "", 'end' => ""]; } - } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php index b18500817..2224f0e01 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php @@ -44,6 +44,22 @@ class Power implements PowerInterface **/ public array $active = []; + /** + * All power namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $namespace = []; + + /** + * All composer namespaces + * + * @var array + * @since 3.2.0 + **/ + public array $composer = []; + /** * The url to the power, if there is an error. * @@ -475,10 +491,13 @@ class Power implements PowerInterface $namespace_array = array_map(function ($val) { return $this->getCleanNamespace($val); }, $namespace_array); + // set the actual class namespace $this->active[$guid]->_namespace = implode('\\', $namespace_array); - // prefix values - $this->active[$guid]->_namespace_prefix = $path_array; + + // set global namespaces for autoloader + $this->namespace[implode('.', $path_array)] = $path_array; + // get the parent folder (the first value in array) $prefix_folder = implode('.', $path_array); @@ -579,10 +598,10 @@ class Power implements PowerInterface $this->active[$guid]->composer )) ? json_decode($this->active[$guid]->composer, true) : null; + unset($this->active[$guid]->composer); + if (ArrayHelper::check($_composer)) { - $this->active[$guid]->composer = []; - foreach ($_composer as $composer) { if (isset($composer['access_point']) && StringHelper::check($composer['access_point'])) @@ -612,17 +631,15 @@ class Power implements PowerInterface { $namespace = $this->getCleanNamespace(explode(' as ', $namespace)[0]); } - $this->active[$guid]->composer[$namespace] = $composer['access_point']; + + // add composer namespaces for autoloader + $this->composer[$namespace] = $composer['access_point']; } } } } } } - else - { - $this->active[$guid]->composer = null; - } } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php new file mode 100644 index 000000000..b496a2006 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php @@ -0,0 +1,214 @@ + + * @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\Power; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Power; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Content; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Compiler Autoloader + * + * @since 3.2.0 + */ +class Autoloader +{ + /** + * Power Objects + * + * @var Power + * @since 3.2.0 + **/ + protected Power $power; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Content + * + * @var Content + * @since 3.2.0 + **/ + protected Content $content; + + /** + * Constructor. + * + * @param Power|null $power The power object. + * @param Config|null $config The compiler config object. + * @param Content|null $content The compiler content object. + * + * @since 3.2.0 + */ + public function __construct(?Power $power = null, ?Config $config = null, ?Content $content = null) + { + $this->power = $power ?: Compiler::_('Power'); + $this->config = $config ?: Compiler::_('Config'); + $this->content = $content ?: Compiler::_('Content'); + + // reset all autoloaders power placeholders + $this->content->set('ADMIN_POWER_HELPER', ''); + $this->content->set('SITE_POWER_HELPER', ''); + $this->content->set('CUSTOM_POWER_AUTOLOADER', ''); + } + + /** + * Set the autoloader into the active content array + * + * @return void + * @since 3.2.0 + */ + public function set() + { + if (($size = ArrayHelper::check($this->power->namespace)) > 0) + { + // set if we should load the autoloader on the site area + $loadSite = true; + // check if we are using a plugin + $use_plugin = $this->content->exist('PLUGIN_POWER_AUTOLOADER'); + // build the methods + $autoloadNotSiteMethod = array(); + $autoloadMethod = array(); + // add only if we are not using a plugin + $tab_space = 2; + if (!$use_plugin) + { + $autoloadNotSiteMethod[] = PHP_EOL . PHP_EOL; + $tab_space = 0; + } + elseif (!$loadSite) + { + // we add code to prevent this plugin from triggering on the site area + $autoloadNotSiteMethod[] = PHP_EOL . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' do not run the autoloader in the site area'; + $autoloadNotSiteMethod[] = Indent::_(2) . 'if ($this->app->isClient(\'site\'))'; + $autoloadNotSiteMethod[] = Indent::_(2) . '{'; + $autoloadNotSiteMethod[] = Indent::_(3) . 'return;'; + $autoloadNotSiteMethod[] = Indent::_(2) . '}' . PHP_EOL; + } + // we start building the spl_autoload_register function call + $autoloadMethod[] = Indent::_($tab_space) . '//' + . Line::_(__Line__, __Class__) . ' register this component namespace'; + $autoloadMethod[] = Indent::_($tab_space) . 'spl_autoload_register(function ($class) {'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$search = array('; + // ==== IMPORTANT NOTICE ===== + // make sure the name space values are sorted from the longest string to the shortest + // so that the search do not mistakenly match a shorter namespace before a longer one + // that has the same short namespace for example: + // NameSpace\SubName\Sub <- will always match first + // NameSpace\SubName\SubSubName + // Should the shorter namespace be listed [first] it will match both of these: + // NameSpace\SubName\Sub\ClassName + // ^^^^^^^^^^^^^^^^^^^^^ + // NameSpace\SubName\SubSubName\ClassName + // ^^^^^^^^^^^^^^^^^^^^^ + uksort($this->power->namespace, function ($a, $b) { + return strlen($b) - strlen($a); + }); + // counter to manage the comma in the actual array + $counter = 1; + foreach ($this->power->namespace as $base_dir => $prefix) + { + // don't add the ending comma on last value + if ($size == $counter) + { + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + } + else + { + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . "'" . $this->config->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + } + $counter++; + } + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . ');'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// Start the search and load if found'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found = false;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found_base_dir = "";'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found_len = 0;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' does the class use the namespace prefix?'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '$len = strlen($prefix);'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' we have a match so load the values'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found = true;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found_base_dir = $base_dir;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found_len = $len;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' done here'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . 'break;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' check if we found a match'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'if (!$found)'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' no, move to the next registered autoloader'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'return;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' get the relative class name'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$relative_class = substr($class, $found_len);'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' replace the namespace prefix with the base directory, replace namespace'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// separators with directory separators in the relative class name, append'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// with .php'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' if the file exists, require it'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'if (file_exists($file))'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'require $file;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . '});'; + // create the method string + $autoloader = implode(PHP_EOL, $autoloadNotSiteMethod) . implode(PHP_EOL, $autoloadMethod); + // check if we are using a plugin + if ($use_plugin) + { + $this->content->set('PLUGIN_POWER_AUTOLOADER', PHP_EOL . $autoloader); + } + else + { + // load to events placeholders + $this->content->add('ADMIN_POWER_HELPER', $autoloader); + // load to site if needed + if ($loadSite) + { + $this->content->add('SITE_POWER_HELPER', $autoloader); + } + } + // to add to custom files + $this->content->add('CUSTOM_POWER_AUTOLOADER', PHP_EOL . implode(PHP_EOL, $autoloadMethod)); + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php index 83fd34c36..9b6090dc7 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php @@ -14,7 +14,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Power as CompilerPower; +use VDM\Joomla\Componentbuilder\Compiler\Power as Powers; +use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader; /** @@ -34,26 +35,47 @@ class Power implements ServiceProviderInterface */ public function register(Container $container) { - $container->alias(CompilerPower::class, 'Power') - ->share('Power', [$this, 'getPower'], true); + $container->alias(Powers::class, 'Power') + ->share('Power', [$this, 'getPowers'], true); + + $container->alias(Autoloader::class, 'Power.Autoloader') + ->share('Power.Autoloader', [$this, 'getAutoloader'], true); } /** - * Get the Compiler Power + * Get the Powers * * @param Container $container The DI container. * - * @return CompilerPower + * @return Powers * @since 3.2.0 */ - public function getPower(Container $container): CompilerPower + public function getPowers(Container $container): Powers { - return new CompilerPower( + return new Powers( $container->get('Config'), $container->get('Placeholder'), $container->get('Customcode'), $container->get('Customcode.Gui') ); - } + } + + /** + * Get the Compiler Autoloader + * + * @param Container $container The DI container. + * + * @return Autoloader + * @since 3.2.0 + */ + public function getAutoloader(Container $container): Autoloader + { + return new Autoloader( + $container->get('Power'), + $container->get('Config'), + $container->get('Content') + ); + } + }