From 4217b22f6739d1fee019fc98a82d33a824b2b824 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 4 Dec 2022 11:23:43 +0200 Subject: [PATCH] Adds new Content class. Adds the intial Package Classes. Removed phpseclib. --- README.md | 14 +- admin/README.txt | 14 +- admin/helpers/compiler.php | 127 +- admin/helpers/compiler/b_Structure.php | 39 +- admin/helpers/compiler/c_Fields.php | 3 +- admin/helpers/compiler/e_Interpretation.php | 296 +- admin/helpers/compiler/f_Infusion.php | 543 +- admin/helpers/componentbuilder.php | 26 +- .../en-GB/en-GB.com_componentbuilder.ini | 20 +- admin/layouts/power/composer_fullwidth.php | 45 + admin/models/ajax.php | 2 +- admin/models/forms/power.xml | 121 +- admin/models/import_joomla_components.php | 2 +- admin/models/joomla_components.php | 5 +- admin/models/power.php | 51 +- admin/sql/install.mysql.utf8.sql | 1 + admin/sql/updates/mysql/3.1.12.sql | 1 + admin/views/power/tmpl/edit.php | 10 + componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 + .../Abstraction/BaseConfig.php | 2 +- .../Abstraction/BaseRegistry.php | 2 +- .../Componentbuilder/Abstraction/Database.php | 2 +- .../Compiler/Component/Placeholder.php | 2 +- .../src/Componentbuilder/Compiler/Config.php | 2 +- .../src/Componentbuilder/Compiler/Content.php | 183 + .../Componentbuilder/Compiler/Customcode.php | 2 +- .../Compiler/Customcode/Dispenser.php | 2 +- .../Compiler/Customcode/External.php | 2 +- .../Compiler/Customcode/Extractor.php | 2 +- .../Compiler/Customcode/Extractor/Paths.php | 2 +- .../Compiler/Customcode/Gui.php | 2 +- .../Compiler/Customcode/Hash.php | 2 +- .../Compiler/Customcode/LockBase.php | 2 +- .../Extension/JoomlaThree/InstallScript.php | 2 +- .../src/Componentbuilder/Compiler/Factory.php | 2 +- .../src/Componentbuilder/Compiler/Field.php | 2 +- .../Compiler/Field/Customcode.php | 2 +- .../Componentbuilder/Compiler/Field/Data.php | 2 +- .../Compiler/Field/DatabaseName.php | 2 +- .../Field/JoomlaThree/CoreValidation.php | 2 +- .../Componentbuilder/Compiler/Field/Name.php | 2 +- .../Compiler/Field/TypeName.php | 2 +- .../Compiler/Field/UniqueName.php | 2 +- .../Compiler/Field/Validation.php | 2 +- .../Component/PlaceholderInterface.php | 2 +- .../Customcode/DispenserInterface.php | 2 +- .../Customcode/ExternalInterface.php | 2 +- .../Customcode/ExtractorInterface.php | 2 +- .../Interfaces/Customcode/GuiInterface.php | 2 +- .../Customcode/LockBaseInterface.php | 2 +- .../Interfaces/CustomcodeInterface.php | 2 +- .../Compiler/Interfaces/EventInterface.php | 2 +- .../Interfaces/Extension/InstallInterface.php | 2 +- .../Field/CoreValidationInterface.php | 2 +- .../Interfaces/GetScriptInterface.php | 2 +- .../Compiler/Interfaces/HistoryInterface.php | 2 +- .../Compiler/Interfaces/LanguageInterface.php | 2 +- .../Interfaces/PlaceholderInterface.php | 2 +- .../Compiler/Interfaces/PowerInterface.php | 2 +- .../Compiler/JoomlaThree/Event.php | 2 +- .../Compiler/JoomlaThree/History.php | 2 +- .../Componentbuilder/Compiler/Language.php | 2 +- .../Compiler/Language/Extractor.php | 2 +- .../Componentbuilder/Compiler/Placeholder.php | 2 +- .../Compiler/Placeholder/Reverse.php | 2 +- .../src/Componentbuilder/Compiler/Power.php | 150 +- .../Componentbuilder/Compiler/Registry.php | 2 +- .../Compiler/Service/Compiler.php | 19 +- .../Compiler/Service/Component.php | 2 +- .../Compiler/Service/Customcode.php | 2 +- .../Compiler/Service/Event.php | 2 +- .../Compiler/Service/Extension.php | 2 +- .../Compiler/Service/Field.php | 2 +- .../Compiler/Service/History.php | 2 +- .../Compiler/Service/Language.php | 2 +- .../Compiler/Service/Placeholder.php | 2 +- .../Compiler/Service/Power.php | 2 +- .../Compiler/Utilities/Indent.php | 2 +- .../Compiler/Utilities/Line.php | 2 +- .../Compiler/Utilities/Path.php | 2 +- .../Compiler/Utilities/Placefix.php | 2 +- .../src/Componentbuilder/Database/Insert.php | 2 +- .../src/Componentbuilder/Database/Load.php | 2 +- .../Interfaces/FactoryInterface.php | 18 +- .../Interfaces/InsertInterface.php | 2 +- .../Interfaces/LoadInterface.php | 2 +- .../Interfaces/Tableinterface.php | 18 +- .../Package/Database/Insert.php | 187 + .../Package/Database/Load.php | 128 + .../Package/Database}/index.html | 0 .../src/Componentbuilder/Package/Factory.php | 81 + .../Package/Service/Database.php | 112 + .../Package/Service}/index.html | 0 .../src/Componentbuilder/Package/index.html | 1 + .../Search/Abstraction/Engine.php | 2 +- .../Search/Abstraction/Model.php | 2 +- .../src/Componentbuilder/Search/Agent.php | 2 +- .../Componentbuilder/Search/Agent/Find.php | 2 +- .../Componentbuilder/Search/Agent/Replace.php | 2 +- .../Componentbuilder/Search/Agent/Search.php | 2 +- .../Componentbuilder/Search/Agent/Update.php | 2 +- .../src/Componentbuilder/Search/Config.php | 2 +- .../Search/Database/Insert.php | 2 +- .../Componentbuilder/Search/Database/Load.php | 4 +- .../Componentbuilder/Search/Engine/Basic.php | 2 +- .../Componentbuilder/Search/Engine/Regex.php | 2 +- .../src/Componentbuilder/Search/Factory.php | 2 +- .../Search/Interfaces/FindInterface.php | 2 +- .../Search/Interfaces/InsertInterface.php | 2 +- .../Search/Interfaces/LoadInterface.php | 2 +- .../Search/Interfaces/ModelInterface.php | 2 +- .../Search/Interfaces/ReplaceInterface.php | 2 +- .../Search/Interfaces/SearchInterface.php | 2 +- .../Search/Interfaces/SearchTypeInterface.php | 2 +- .../Componentbuilder/Search/Model/Insert.php | 2 +- .../Componentbuilder/Search/Model/Load.php | 2 +- .../Componentbuilder/Search/Service/Agent.php | 2 +- .../Search/Service/Database.php | 19 +- .../Componentbuilder/Search/Service/Model.php | 2 +- .../Search/Service/Search.php | 2 +- .../src/Componentbuilder/Service/Crypt.php | 397 ++ .../src/Componentbuilder/Service/index.html | 1 + .../VDM.Joomla/src/Componentbuilder/Table.php | 28 +- libraries/phpseclib/vendor/.htaccess | 9 - libraries/phpseclib/vendor/autoload.php | 7 - .../phpseclib/vendor/composer/ClassLoader.php | 572 -- .../vendor/composer/InstalledVersions.php | 350 -- libraries/phpseclib/vendor/composer/LICENSE | 21 - .../vendor/composer/autoload_classmap.php | 10 - .../vendor/composer/autoload_files.php | 10 - .../vendor/composer/autoload_namespaces.php | 9 - .../vendor/composer/autoload_psr4.php | 10 - .../vendor/composer/autoload_real.php | 75 - .../vendor/composer/autoload_static.php | 40 - .../phpseclib/vendor/composer/installed.json | 114 - .../phpseclib/vendor/composer/installed.php | 32 - .../vendor/composer/platform_check.php | 26 - libraries/phpseclib/vendor/htaccess.txt | 9 - .../vendor/phpseclib/phpseclib/AUTHORS | 6 - .../vendor/phpseclib/phpseclib/BACKERS.md | 9 - .../vendor/phpseclib/phpseclib/LICENSE | 20 - .../vendor/phpseclib/phpseclib/README.md | 100 - .../vendor/phpseclib/phpseclib/appveyor.yml | 27 - .../vendor/phpseclib/phpseclib/composer.json | 75 - .../phpseclib/phpseclib/Crypt/AES.php | 126 - .../phpseclib/phpseclib/Crypt/Base.php | 2724 --------- .../phpseclib/phpseclib/Crypt/Blowfish.php | 571 -- .../phpseclib/phpseclib/Crypt/DES.php | 1443 ----- .../phpseclib/phpseclib/Crypt/Hash.php | 893 --- .../phpseclib/phpseclib/Crypt/RC2.php | 688 --- .../phpseclib/phpseclib/Crypt/RC4.php | 342 -- .../phpseclib/phpseclib/Crypt/RSA.php | 3265 ---------- .../phpseclib/phpseclib/Crypt/Random.php | 277 - .../phpseclib/phpseclib/Crypt/Rijndael.php | 936 --- .../phpseclib/phpseclib/Crypt/TripleDES.php | 460 -- .../phpseclib/phpseclib/Crypt/Twofish.php | 816 --- .../phpseclib/phpseclib/File/ANSI.php | 577 -- .../phpseclib/phpseclib/File/ASN1.php | 1459 ----- .../phpseclib/phpseclib/File/ASN1/Element.php | 47 - .../phpseclib/phpseclib/File/X509.php | 5097 ---------------- .../phpseclib/phpseclib/Math/BigInteger.php | 3787 ------------ .../phpseclib/phpseclib/phpseclib/Net/SCP.php | 342 -- .../phpseclib/phpseclib/Net/SFTP.php | 3807 ------------ .../phpseclib/phpseclib/Net/SFTP/Stream.php | 796 --- .../phpseclib/phpseclib/Net/SSH1.php | 1646 ----- .../phpseclib/phpseclib/Net/SSH2.php | 5387 ----------------- .../phpseclib/phpseclib/System/SSH/Agent.php | 351 -- .../phpseclib/System/SSH/Agent/Identity.php | 241 - .../phpseclib/phpseclib/bootstrap.php | 17 - .../phpseclib/phpseclib/phpseclib/openssl.cnf | 6 - libraries/phpseclib/vendor/web.config | 8 - script.php | 6 +- site/helpers/componentbuilder.php | 26 +- 174 files changed, 2091 insertions(+), 38444 deletions(-) create mode 100644 admin/layouts/power/composer_fullwidth.php create mode 100644 admin/sql/updates/mysql/3.1.12.sql create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Content.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Package/Database/Insert.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Package/Database/Load.php rename libraries/{phpseclib => jcb_powers/VDM.Joomla/src/Componentbuilder/Package/Database}/index.html (100%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Package/Factory.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Package/Service/Database.php rename libraries/{phpseclib/vendor => jcb_powers/VDM.Joomla/src/Componentbuilder/Package/Service}/index.html (100%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Package/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/Crypt.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/index.html delete mode 100644 libraries/phpseclib/vendor/.htaccess delete mode 100644 libraries/phpseclib/vendor/autoload.php delete mode 100644 libraries/phpseclib/vendor/composer/ClassLoader.php delete mode 100644 libraries/phpseclib/vendor/composer/InstalledVersions.php delete mode 100644 libraries/phpseclib/vendor/composer/LICENSE delete mode 100644 libraries/phpseclib/vendor/composer/autoload_classmap.php delete mode 100644 libraries/phpseclib/vendor/composer/autoload_files.php delete mode 100644 libraries/phpseclib/vendor/composer/autoload_namespaces.php delete mode 100644 libraries/phpseclib/vendor/composer/autoload_psr4.php delete mode 100644 libraries/phpseclib/vendor/composer/autoload_real.php delete mode 100644 libraries/phpseclib/vendor/composer/autoload_static.php delete mode 100644 libraries/phpseclib/vendor/composer/installed.json delete mode 100644 libraries/phpseclib/vendor/composer/installed.php delete mode 100644 libraries/phpseclib/vendor/composer/platform_check.php delete mode 100644 libraries/phpseclib/vendor/htaccess.txt delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/AUTHORS delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/BACKERS.md delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/LICENSE delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/README.md delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/appveyor.yml delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/composer.json delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC2.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC4.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/File/ANSI.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/File/X509.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php delete mode 100644 libraries/phpseclib/vendor/phpseclib/phpseclib/phpseclib/openssl.cnf delete mode 100644 libraries/phpseclib/vendor/web.config diff --git a/README.md b/README.md index fb26a8745..b63b621e7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.12) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.13) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 27th November, 2022 -+ *Version*: 3.1.12 ++ *Last Build*: 4th 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*: **335381** -+ *Field count*: **2004** -+ *File count*: **2192** -+ *Folder count*: **383** ++ *Line count*: **336766** ++ *Field count*: **2009** ++ *File count*: **2204** ++ *Folder count*: **387** > 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 fb26a8745..b63b621e7 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.12) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.13) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 27th November, 2022 -+ *Version*: 3.1.12 ++ *Last Build*: 4th 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*: **335381** -+ *Field count*: **2004** -+ *File count*: **2192** -+ *Folder count*: **383** ++ *Line count*: **336766** ++ *Field count*: **2009** ++ *File count*: **2204** ++ *Folder count*: **387** > 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 069dcd8bb..7bfcb4e14 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -105,7 +105,7 @@ class Compiler extends Infusion $this->removeFolder($this->componentPath . '/site'); // clear form component xml $xmlPath = $this->componentPath . '/' - . $this->fileContentStatic[Placefix::_h('component')] . '.xml'; + . CFactory::_('Content')->get('component') . '.xml'; $componentXML = ComponentbuilderHelper::getFileContents( $xmlPath ); @@ -632,7 +632,7 @@ class Compiler extends Infusion array(&$this->componentContext, &$name, &$path, &$bom, &$view) ); // set the file name - $this->fileContentStatic[Placefix::_h('FILENAME')] = $name; + CFactory::_('Content')->set('FILENAME', $name); // check if the file should get PHP opening $php = ''; if (ComponentbuilderHelper::checkFileType($name, 'php')) @@ -656,7 +656,7 @@ class Compiler extends Infusion $string = $php . $bom . $code; } // set the answer - $answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic, 3); + $answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active, 3); // set the dynamic answer if ($view) { @@ -805,21 +805,15 @@ class Compiler extends Infusion $value = '@update number ' . $value . ' of this MVC'; } } - $this->fileContentStatic[$key] = $value; + CFactory::_('Content')->set($key, $value); } return true; } // else insure to reset to global - $this->fileContentStatic[Placefix::_h('CREATIONDATE')] - = $this->fileContentStatic[Placefix::_h('CREATIONDATE') - . 'GLOBAL']; - $this->fileContentStatic[Placefix::_h('BUILDDATE')] - = $this->fileContentStatic[Placefix::_h('BUILDDATE') - . 'GLOBAL']; - $this->fileContentStatic[Placefix::_h('VERSION')] - = $this->fileContentStatic[Placefix::_h('VERSION') - . 'GLOBAL']; + CFactory::_('Content')->set('CREATIONDATE', CFactory::_('Content')->get('GLOBALCREATIONDATE')); + CFactory::_('Content')->set('BUILDDATE', CFactory::_('Content')->get('GLOBALBUILDDATE')); + CFactory::_('Content')->set('VERSION', CFactory::_('Content')->get('GLOBALVERSION')); } // set all global numbers @@ -883,10 +877,8 @@ class Compiler extends Infusion private function setReadMe($path) { // set readme data if not set already - if (!isset( - $this->fileContentStatic[Placefix::_h('LINE_COUNT')] - ) - || $this->fileContentStatic[Placefix::_h('LINE_COUNT')] + if (!CFactory::_('Content')->exist('LINE_COUNT') + || CFactory::_('Content')->get('LINE_COUNT') != $this->lineCount) { $this->buildReadMeData(); @@ -894,7 +886,7 @@ class Compiler extends Infusion // get the file $string = ComponentbuilderHelper::getFileContents($path); // update the file - $answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic); + $answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active); // add to zip array $this->writeFile($path, $answer); } @@ -902,72 +894,39 @@ class Compiler extends Infusion private function buildReadMeData() { // set some defaults - $this->fileContentStatic[Placefix::_h('LINE_COUNT')] - = $this->lineCount; - $this->fileContentStatic[Placefix::_h('FIELD_COUNT')] - = $this->fieldCount; - $this->fileContentStatic[Placefix::_h('FILE_COUNT')] - = $this->fileCount; - $this->fileContentStatic[Placefix::_h('FOLDER_COUNT')] - = $this->folderCount; - $this->fileContentStatic[Placefix::_h('PAGE_COUNT')] - = $this->pageCount; - $this->fileContentStatic[Placefix::_h('folders')] - = $this->folderSeconds; - $this->fileContentStatic[Placefix::_h('foldersSeconds')] - = $this->folderSeconds; - $this->fileContentStatic[Placefix::_h('files')] - = $this->fileSeconds; - $this->fileContentStatic[Placefix::_h('filesSeconds')] - = $this->fileSeconds; - $this->fileContentStatic[Placefix::_h('lines')] - = $this->lineSeconds; - $this->fileContentStatic[Placefix::_h('linesSeconds')] - = $this->lineSeconds; - $this->fileContentStatic[Placefix::_h('seconds')] - = $this->actualSeconds; - $this->fileContentStatic[Placefix::_h('actualSeconds')] - = $this->actualSeconds; - $this->fileContentStatic[Placefix::_h('totalHours')] - = $this->totalHours; - $this->fileContentStatic[Placefix::_h('totalDays')] - = $this->totalDays; - $this->fileContentStatic[Placefix::_h('debugging')] - = $this->secondsDebugging; - $this->fileContentStatic[Placefix::_h('secondsDebugging')] - = $this->secondsDebugging; - $this->fileContentStatic[Placefix::_h('planning')] - = $this->secondsPlanning; - $this->fileContentStatic[Placefix::_h('secondsPlanning')] - = $this->secondsPlanning; - $this->fileContentStatic[Placefix::_h('mapping')] - = $this->secondsMapping; - $this->fileContentStatic[Placefix::_h('secondsMapping')] - = $this->secondsMapping; - $this->fileContentStatic[Placefix::_h('office')] - = $this->secondsOffice; - $this->fileContentStatic[Placefix::_h('secondsOffice')] - = $this->secondsOffice; - $this->fileContentStatic[Placefix::_h('actualTotalHours')] - = $this->actualTotalHours; - $this->fileContentStatic[Placefix::_h('actualTotalDays')] - = $this->actualTotalDays; - $this->fileContentStatic[Placefix::_h('debuggingHours')] - = $this->debuggingHours; - $this->fileContentStatic[Placefix::_h('planningHours')] - = $this->planningHours; - $this->fileContentStatic[Placefix::_h('mappingHours')] - = $this->mappingHours; - $this->fileContentStatic[Placefix::_h('officeHours')] - = $this->officeHours; - $this->fileContentStatic[Placefix::_h('actualHoursSpent')] - = $this->actualHoursSpent; - $this->fileContentStatic[Placefix::_h('actualDaysSpent')] - = $this->actualDaysSpent; - $this->fileContentStatic[Placefix::_h('projectWeekTime')] - = $this->projectWeekTime; - $this->fileContentStatic[Placefix::_h('projectMonthTime')] - = $this->projectMonthTime; + CFactory::_('Content')->set('LINE_COUNT', $this->lineCount); + CFactory::_('Content')->set('FIELD_COUNT', $this->fieldCount); + CFactory::_('Content')->set('FILE_COUNT', $this->fileCount); + CFactory::_('Content')->set('FOLDER_COUNT', $this->folderCount); + CFactory::_('Content')->set('PAGE_COUNT', $this->pageCount); + CFactory::_('Content')->set('folders', $this->folderSeconds); + CFactory::_('Content')->set('foldersSeconds', $this->folderSeconds); + CFactory::_('Content')->set('files', $this->fileSeconds); + CFactory::_('Content')->set('filesSeconds', $this->fileSeconds); + CFactory::_('Content')->set('lines', $this->lineSeconds); + CFactory::_('Content')->set('linesSeconds', $this->lineSeconds); + CFactory::_('Content')->set('seconds', $this->actualSeconds); + CFactory::_('Content')->set('actualSeconds', $this->actualSeconds); + CFactory::_('Content')->set('totalHours', $this->totalHours); + CFactory::_('Content')->set('totalDays', $this->totalDays); + CFactory::_('Content')->set('debugging', $this->secondsDebugging); + CFactory::_('Content')->set('secondsDebugging', $this->secondsDebugging); + CFactory::_('Content')->set('planning', $this->secondsPlanning); + CFactory::_('Content')->set('secondsPlanning', $this->secondsPlanning); + CFactory::_('Content')->set('mapping', $this->secondsMapping); + CFactory::_('Content')->set('secondsMapping', $this->secondsMapping); + CFactory::_('Content')->set('office', $this->secondsOffice); + CFactory::_('Content')->set('secondsOffice', $this->secondsOffice); + CFactory::_('Content')->set('actualTotalHours', $this->actualTotalHours); + CFactory::_('Content')->set('actualTotalDays', $this->actualTotalDays); + CFactory::_('Content')->set('debuggingHours', $this->debuggingHours); + CFactory::_('Content')->set('planningHours', $this->planningHours); + CFactory::_('Content')->set('mappingHours', $this->mappingHours); + CFactory::_('Content')->set('officeHours', $this->officeHours); + CFactory::_('Content')->set('actualHoursSpent', $this->actualHoursSpent); + CFactory::_('Content')->set('actualDaysSpent', $this->actualDaysSpent); + CFactory::_('Content')->set('projectWeekTime', $this->projectWeekTime); + CFactory::_('Content')->set('projectMonthTime', $this->projectMonthTime); } private function setLocalRepos() diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index a42341ed8..b538e253e 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -240,6 +240,7 @@ class Structure extends Get * Static File Content * * @var array + * @deprecated 3.3 Use CFactory::_('Content')->active */ public $fileContentStatic = array(); @@ -277,6 +278,7 @@ class Structure extends Get * Dynamic File Content * * @var array + * @deprecated 3.3 Use CFactory::_('Content')->_active */ public $fileContentDynamic = array(); @@ -382,23 +384,17 @@ class Structure extends Get // set the standard admin file $this->stdRootFiles[] = $this->componentData->name_code . '.php'; // set incase no extra admin folder are loaded - $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FOLDERS')] - = ''; + CFactory::_('Content')->set('EXSTRA_ADMIN_FOLDERS', ''); // set incase no extra site folder are loaded - $this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FOLDERS')] - = ''; + CFactory::_('Content')->set('EXSTRA_SITE_FOLDERS', ''); // set incase no extra media folder are loaded - $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')] - = ''; + CFactory::_('Content')->set('EXSTRA_MEDIA_FOLDERS', ''); // set incase no extra admin files are loaded - $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FILES')] - = ''; + CFactory::_('Content')->set('EXSTRA_ADMIN_FILES', ''); // set incase no extra site files are loaded - $this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FILES')] - = ''; + CFactory::_('Content')->set('EXSTRA_SITE_FILES', ''); // set incase no extra media files are loaded - $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FILES')] - = ''; + CFactory::_('Content')->set('EXSTRA_MEDIA_FILES', ''); // run global updater ComponentbuilderHelper::runGlobalUpdater(); // set the template path @@ -1701,9 +1697,9 @@ class Structure extends Get if ($addLocalFolder) { // add folder to xml of media folders - $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')] - .= PHP_EOL . Indent::_(2) . "" - . $libFolder . ""; + CFactory::_('Content')->add('EXSTRA_MEDIA_FOLDERS', + PHP_EOL . Indent::_(2) . "" + . $libFolder . ""); } } // if config fields are found load into component config (avoiding duplicates) @@ -2283,12 +2279,13 @@ class Structure extends Get $eTab = Indent::_(3); } // set the xml file - $this->fileContentStatic[Placefix::_h('EXSTRA_' - . StringHelper::safe( - $checker[0], 'U' - ) . '_' . $eNAME)] - .= PHP_EOL . $eTab . "<" . $ename . ">" - . $checker[1] . ""; + $key_ = 'EXSTRA_' + . StringHelper::safe( + $checker[0], 'U' + ) . '_' . $eNAME; + CFactory::_('Content')->add($key_, + PHP_EOL . $eTab . "<" . $ename . ">" + . $checker[1] . ""); } } } diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 9390d8c85..e04d4e2cb 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -29,7 +29,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; class Fields extends Structure { - /** * Metadate Switch * @@ -5386,7 +5385,7 @@ class Fields extends Structure ) : 'com_' . CFactory::_('Config')->component_code_name, // set the generic values Placefix::_('component') => CFactory::_('Config')->component_code_name, - Placefix::_('Component') => $this->fileContentStatic[Placefix::_h('Component')], + Placefix::_('Component') => CFactory::_('Content')->get('Component'), Placefix::_('view') => (isset($data['custom']['view']) && StringHelper::check( $data['custom']['view'] diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 6dd1bbd61..f2f7c94cc 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -271,7 +271,7 @@ class Interpretation extends Fields { // set email helper in place with component name $component = CFactory::_('Config')->component_code_name; - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); $target = array('admin' => 'emailer'); $done = $this->buildDynamique($target, 'emailer', $component); if ($done) @@ -297,36 +297,27 @@ class Interpretation extends Fields if ($this->componentData->add_license && $this->componentData->license_type == 3) { - if (!isset( - $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')] - )) + if (!CFactory::_('Content')->exist('HELPER_SITE_LICENSE_LOCK')) { $_WHMCS = '_' . StringHelper::safe( $this->uniquekey(10), 'U' ); // add it to the system - $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')] - = $this->setHelperLicenseLock($_WHMCS, 'site'); - $this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')] - = $this->setHelperLicenseLock($_WHMCS, 'admin'); - $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')] - = $this->setInitLicenseLock($_WHMCS); - $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')] - = PHP_EOL . PHP_EOL . 'defined(\'' . $_WHMCS - . '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));'; + CFactory::_('Content')->set('HELPER_SITE_LICENSE_LOCK', $this->setHelperLicenseLock($_WHMCS, 'site')); + CFactory::_('Content')->set('HELPER_LICENSE_LOCK', $this->setHelperLicenseLock($_WHMCS, 'admin')); + CFactory::_('Content')->set('LICENSE_LOCKED_INT', $this->setInitLicenseLock($_WHMCS)); + CFactory::_('Content')->set('LICENSE_LOCKED_DEFINED', + PHP_EOL . PHP_EOL . 'defined(\'' . $_WHMCS + . '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));'); } } else { // don't add it to the system - $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')] - = ''; - $this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')] - = ''; - $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')] - = ''; - $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')] - = ''; + CFactory::_('Content')->set('HELPER_SITE_LICENSE_LOCK', ''); + CFactory::_('Content')->set('HELPER_LICENSE_LOCK', ''); + CFactory::_('Content')->set('LICENSE_LOCKED_INT', ''); + CFactory::_('Content')->set('LICENSE_LOCKED_DEFINED', ''); } } @@ -496,7 +487,7 @@ class Interpretation extends Fields $init[] = PHP_EOL . "if (!defined('" . $_WHMCS . "'))"; $init[] = "{"; $init[] = Indent::_(1) . "\$allow = " - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::isGenuine();"; $init[] = Indent::_(1) . "if (\$allow)"; $init[] = Indent::_(1) . "{"; @@ -819,8 +810,7 @@ class Interpretation extends Fields public function setGetCryptKey() { // WHMCS_ENCRYPT_FILE - $this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')] - = ''; + CFactory::_('Content')->set('WHMCS_ENCRYPT_FILE', ''); // check if encryption is ative if ((isset($this->basicFieldModeling) && ArrayHelper::check( @@ -847,8 +837,7 @@ class Interpretation extends Fields $this->fileContentDynamic['whmcs'][Placefix::_h('WHMCS_ENCRYPTION_BODY')] = $this->setWHMCSCryption(); // ENCRYPT_FILE - $this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')] - = PHP_EOL . Indent::_(3) . "whmcs.php"; + CFactory::_('Content')->set('WHMCS_ENCRYPT_FILE', PHP_EOL . Indent::_(3) . "whmcs.php"); } // get component name $component = CFactory::_('Config')->component_code_name; @@ -1158,20 +1147,18 @@ class Interpretation extends Fields $updateServer[] = Indent::_(2) . '' . $this->componentData->update_server_url + . CFactory::_('Content')->get('Component_name') . '">' . $this->componentData->update_server_url . ''; $updateServer[] = Indent::_(1) . ''; // return the array to string $updateServer = implode(PHP_EOL, $updateServer); // add update server details to component XML file - $this->fileContentStatic[Placefix::_h('UPDATESERVER')] - = $updateServer; + CFactory::_('Content')->set('UPDATESERVER', $updateServer); } else { // add update server details to component XML file - $this->fileContentStatic[Placefix::_h('UPDATESERVER')] - = ''; + CFactory::_('Content')->set('UPDATESERVER', ''); } // ensure to update Component version data if (ArrayHelper::check($this->updateSQLBuilder)) @@ -1364,9 +1351,9 @@ class Interpretation extends Fields // build update xml $updateXML[] = Indent::_(1) . ""; $updateXML[] = Indent::_(2) . "" - . $this->fileContentStatic[Placefix::_h('Component_name')] . ""; + . CFactory::_('Content')->get('Component_name') . ""; $updateXML[] = Indent::_(2) . "" - . $this->fileContentStatic[Placefix::_h('SHORT_DESCRIPTION')] . ""; + . CFactory::_('Content')->get('SHORT_DESCRIPTION') . ""; $updateXML[] = Indent::_(2) . "$u_element"; $updateXML[] = Indent::_(2) . "$u_server_type"; // check if we should add the target client value @@ -1377,7 +1364,7 @@ class Interpretation extends Fields $updateXML[] = Indent::_(2) . "" . $update['version'] . ""; $updateXML[] = Indent::_(2) . '' . $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . ''; + . CFactory::_('Content')->get('Component_name') . '!">' . CFactory::_('Content')->get('AUTHORWEBSITE') . ''; $updateXML[] = Indent::_(2) . ""; if (!isset($update['url']) || !StringHelper::check( @@ -1394,10 +1381,10 @@ class Interpretation extends Fields $updateXML[] = Indent::_(3) . "$u_state"; $updateXML[] = Indent::_(2) . ""; $updateXML[] = Indent::_(2) . "" - . $this->fileContentStatic[Placefix::_h('AUTHOR')] + . CFactory::_('Content')->get('AUTHOR') . ""; $updateXML[] = Indent::_(2) . "" - . $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . ""; + . CFactory::_('Content')->get('AUTHORWEBSITE') . ""; $updateXML[] = Indent::_(2) . ''; $updateXML[] = Indent::_(1) . ""; @@ -1437,11 +1424,9 @@ class Interpretation extends Fields if ($admindone && $sitedone) { // HELP - $this->fileContentStatic[Placefix::_h('HELP')] - = $this->setHelp(1); + CFactory::_('Content')->set('HELP', $this->setHelp(1)); // HELP_SITE - $this->fileContentStatic[Placefix::_h('HELP_SITE')] - = $this->setHelp(2); + CFactory::_('Content')->set('HELP_SITE', $this->setHelp(2)); // to make sure the file is updated TODO $this->fileContentDynamic['help'][Placefix::_h('BLABLA')] = 'blabla'; @@ -1557,7 +1542,7 @@ class Interpretation extends Fields if ($this->addEximport) { // we use the company name set in the GUI - $company_name = $this->fileContentStatic[Placefix::_h('COMPANYNAME')]; + $company_name = CFactory::_('Content')->get('COMPANYNAME'); // start building the xml function $exel = array(); $exel[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; @@ -2313,7 +2298,7 @@ class Interpretation extends Fields $xml .= PHP_EOL . Indent::_(1) . ''; $xml .= PHP_EOL . Indent::_(2) . '
get('COMPONENT') . '"'; $xml .= PHP_EOL . Indent::_(3) . 'addrulepath="/administrator/components/com_' . CFactory::_('Config')->component_code_name . '/models/rules"'; @@ -2587,7 +2572,7 @@ class Interpretation extends Fields $filter .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(" . $string . "->" . $field . "))"; $filter .= PHP_EOL . Indent::_(1) . $tab @@ -2640,7 +2625,7 @@ class Interpretation extends Fields . $as . " based on repeatable value"; $filter .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkString(" . $string . "->" . $field . "))"; $filter .= PHP_EOL . Indent::_(1) . $tab @@ -2651,7 +2636,7 @@ class Interpretation extends Fields . $string . "->" . $field . ",true);"; $filter .= PHP_EOL . Indent::_(2) . $tab . Indent::_(1) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$array))"; $filter .= PHP_EOL . Indent::_(2) . $tab . Indent::_(1) . "{"; @@ -2769,7 +2754,7 @@ class Interpretation extends Fields if ('json' === $decode) { $if = PHP_EOL . Indent::_(1) . $tab . Indent::_(1) - . "if (" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(" + . "if (" . CFactory::_('Content')->get('Component') . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "{"; // json_decode @@ -2869,7 +2854,7 @@ class Interpretation extends Fields $fieldPrepare = ''; $runplugins = false; // set component - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); // set context $context = (isset($get['context'])) ? $get['context'] : $code; $context = 'com_' . CFactory::_('Config')->component_code_name . '.' . $context; @@ -2969,7 +2954,7 @@ class Interpretation extends Fields . $field . " has uikit components that must be loaded."; $fieldUikit .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$this->uikitComp = " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::getUikitComp(" . $string . "->" + . CFactory::_('Content')->get('Component') . "Helper::getUikitComp(" . $string . "->" . $field . ",\$this->uikitComp);"; } } @@ -3148,7 +3133,7 @@ class Interpretation extends Fields . "\$array = " . $ter['state_key'] . ";"; $string .= PHP_EOL . Indent::_(2) . $tab . "if (isset(\$array) && " - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$array))"; $string .= PHP_EOL . Indent::_(2) . $tab . "{"; $string .= PHP_EOL . Indent::_(2) . $tab @@ -3177,7 +3162,7 @@ class Interpretation extends Fields . "\$checkValue = " . $ter['state_key'] . ";"; $string .= PHP_EOL . Indent::_(2) . $tab . "if (isset(\$checkValue) && " - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkString(\$checkValue))"; $string .= PHP_EOL . Indent::_(2) . $tab . "{"; $string .= PHP_EOL . Indent::_(2) . $tab @@ -3395,7 +3380,7 @@ class Interpretation extends Fields || $whe['operator'] === 'NOT IN') { $string = "if (isset(" . $whe['value_key'] . ") && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(" + . CFactory::_('Content')->get('Component') . "Helper::checkArray(" . $whe['value_key'] . "))"; $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1) . "{"; @@ -3526,10 +3511,8 @@ class Interpretation extends Fields break; } // check that the default and the redirect page is not the same - if (isset( - $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] - ) - && $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $view['settings']->code) + if (CFactory::_('Content')->exist('SITE_DEFAULT_VIEW') + && CFactory::_('Content')->get('SITE_DEFAULT_VIEW') != $view['settings']->code) { $redirectMessage = Indent::_(3) . "//" . Line::_( __LINE__,__CLASS__ @@ -3537,7 +3520,7 @@ class Interpretation extends Fields . " redirect away to the default view if no access allowed."; $redirectString = "JRoute::_('index.php?option=com_" . CFactory::_('Config')->component_code_name . "&view=" - . $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')"; + . CFactory::_('Content')->get('SITE_DEFAULT_VIEW') . "')"; } else { @@ -3711,14 +3694,12 @@ class Interpretation extends Fields if ('site' === CFactory::_('Config')->build_target) { // check that the default and the redirect page is not the same - if (isset( - $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] - ) - && $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $code) + if (CFactory::_('Content')->exist('SITE_DEFAULT_VIEW') + && CFactory::_('Content')->get('SITE_DEFAULT_VIEW') != $code) { $redirectString = "JRoute::_('index.php?option=com_" . CFactory::_('Config')->component_code_name . "&view=" - . $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')"; + . CFactory::_('Content')->get('SITE_DEFAULT_VIEW') . "')"; } else { @@ -3819,7 +3800,7 @@ class Interpretation extends Fields } } // set the scripts - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); $script = ''; foreach ($this->cryptionTypes as $cryptionType) { @@ -4240,7 +4221,7 @@ class Interpretation extends Fields $method .= PHP_EOL . Indent::_(1) . "{"; $method .= PHP_EOL . Indent::_(2) . "if (isset(\$this->uikitComp) && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$this->uikitComp))"; + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$this->uikitComp))"; $method .= PHP_EOL . Indent::_(2) . "{"; $method .= PHP_EOL . Indent::_(3) . "return \$this->uikitComp;"; $method .= PHP_EOL . Indent::_(2) . "}"; @@ -4337,7 +4318,7 @@ class Interpretation extends Fields . $default['on_field'] . " is an array with values."; $methods .= PHP_EOL . Indent::_(2) . "\$array = (" - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkJson(\$" . $default['on_field'] . ", true)) ? json_decode(\$" @@ -4345,7 +4326,7 @@ class Interpretation extends Fields . $default['on_field'] . ";"; $methods .= PHP_EOL . Indent::_(2) . "if (isset(\$array) && " - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$array, true))"; $methods .= PHP_EOL . Indent::_(2) . "{"; $methods .= PHP_EOL . Indent::_(3) @@ -4628,7 +4609,7 @@ class Interpretation extends Fields $methods .= PHP_EOL . Indent::_(1) . "}"; // set the script if it was found - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); $script = ''; foreach ($this->cryptionTypes as $cryptionType) { @@ -4840,7 +4821,7 @@ class Interpretation extends Fields $this->siteDecrypt[$cryptionType][$code] = false; } // set the component name - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); // start load the get item if (ObjectHelper::check($get)) { @@ -5188,7 +5169,7 @@ class Interpretation extends Fields __LINE__,__CLASS__ ) . " Process the content plugins."; $method .= PHP_EOL . Indent::_(2) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$this->item))"; + . CFactory::_('Content')->get('Component') . "Helper::checkObject(\$this->item))"; $method .= PHP_EOL . Indent::_(2) . "{"; $method .= PHP_EOL . Indent::_(3) . "JPluginHelper::importPlugin('content');"; @@ -5202,7 +5183,7 @@ class Interpretation extends Fields ) . " Check if item has params, or pass global params"; $method .= PHP_EOL . Indent::_(3) . "\$params = (isset(\$this->item->params) && " - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkJson(\$this->item->params)) ? json_decode(\$this->item->params) : \$this->params;"; // load the defaults foreach ( @@ -5355,7 +5336,7 @@ class Interpretation extends Fields $addModule[] = Indent::_(3) . "\$modules = JModuleHelper::getModules(\$position);"; $addModule[] = Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$modules, true))"; $addModule[] = Indent::_(3) . "{"; $addModule[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) @@ -5374,13 +5355,13 @@ class Interpretation extends Fields . " check if modules were found"; $addModule[] = Indent::_(2) . "if (\$found && isset(\$this->setModules[\$position]) && " - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$this->setModules[\$position]))"; $addModule[] = Indent::_(2) . "{"; $addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " set class"; $addModule[] = Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$class))"; + . CFactory::_('Content')->get('Component') . "Helper::checkString(\$class))"; $addModule[] = Indent::_(3) . "{"; $addModule[] = Indent::_(4) . "\$class = ' class=\"'.\$class.'\" ';"; @@ -5544,7 +5525,7 @@ class Interpretation extends Fields $buttons[] = $tab . Indent::_(2) . "JToolBarHelper::custom('" . $viewCodeName . "." . "dashboard', 'grid-2', '', 'COM_" - . $this->fileContentStatic[Placefix::_h('COMPONENT')] + . CFactory::_('Content')->get('COMPONENT') . "_DASH', false);"; } } @@ -6427,13 +6408,13 @@ class Interpretation extends Fields { case 'js': return '$this->document->addScript(' . $JURI . '"' . $path - . '", (' . $this->fileContentStatic[Placefix::_h('Component')] + . '", (' . CFactory::_('Content')->get('Component') . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");'; break; case 'css': case 'less': return '$this->document->addStyleSheet(' . $JURI . '"' - . $path . '", (' . $this->fileContentStatic[Placefix::_h('Component')] + . $path . '", (' . CFactory::_('Content')->get('Component') . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");'; break; case 'php': @@ -6579,11 +6560,11 @@ class Interpretation extends Fields . "\$uikitFieldComp = \$this->get('UikitComp');"; $setter .= PHP_EOL . $tabV . Indent::_(3) . "if (isset(\$uikitFieldComp) && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitFieldComp))"; + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitFieldComp))"; $setter .= PHP_EOL . $tabV . Indent::_(3) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(4) . "if (isset(\$uikitComp) && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))"; + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . Indent::_(4) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(5) . "\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; @@ -6603,7 +6584,7 @@ class Interpretation extends Fields . " Load the needed uikit components in this view."; $setter .= PHP_EOL . $tabV . Indent::_(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))"; + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_( __LINE__,__CLASS__ @@ -6617,7 +6598,7 @@ class Interpretation extends Fields . "foreach (\$uikitComp as \$class)"; $setter .= PHP_EOL . $tabV . Indent::_(3) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(4) . "foreach (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::\$uk_components[\$class] as \$name)"; + . CFactory::_('Content')->get('Component') . "Helper::\$uk_components[\$class] as \$name)"; $setter .= PHP_EOL . $tabV . Indent::_(4) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_( __LINE__,__CLASS__ @@ -6668,7 +6649,7 @@ class Interpretation extends Fields . "\$uikitComp = \$this->get('UikitComp');"; $setter .= PHP_EOL . $tabV . Indent::_(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))"; + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_( __LINE__,__CLASS__ @@ -6677,7 +6658,7 @@ class Interpretation extends Fields . "foreach (\$uikitComp as \$class)"; $setter .= PHP_EOL . $tabV . Indent::_(3) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(4) . "foreach (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::\$uk_components[\$class] as \$name)"; + . CFactory::_('Content')->get('Component') . "Helper::\$uk_components[\$class] as \$name)"; $setter .= PHP_EOL . $tabV . Indent::_(4) . "{"; $setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_( __LINE__,__CLASS__ @@ -7231,8 +7212,8 @@ class Interpretation extends Fields { $script = ''; // get the component name - $Component = $this->fileContentStatic[Placefix::_h('Component')]; - $component = $this->fileContentStatic[Placefix::_h('component')]; + $Component = CFactory::_('Content')->get('Component'); + $component = CFactory::_('Content')->get('component'); // go from base64 to string if (isset($this->base64Builder[$view]) && ArrayHelper::check($this->base64Builder[$view])) @@ -7439,7 +7420,7 @@ class Interpretation extends Fields { $script = ''; // get component name - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); $component = CFactory::_('Config')->component_code_name; // check if there was script added before modeling of data $script .= CFactory::_('Customcode.Dispenser')->get( @@ -7911,8 +7892,8 @@ class Interpretation extends Fields { $script .= PHP_EOL . Indent::_(3) . 'echo \''; + . CFactory::_('Content')->get('AUTHORWEBSITE') . '" title="' + . CFactory::_('Content')->get('Component_name') . '">'; $script .= PHP_EOL . Indent::_(4) . ''; @@ -7940,14 +7921,14 @@ class Interpretation extends Fields { $script .= PHP_EOL . Indent::_(3) . 'echo \''; + . CFactory::_('Content')->get('AUTHORWEBSITE') . '" title="' + . CFactory::_('Content')->get('Component_name') . '">'; $script .= PHP_EOL . Indent::_(4) . ''; $script .= PHP_EOL . Indent::_(4) . ''; $script .= PHP_EOL . Indent::_(4) . "

Upgrade to Version " - . $this->fileContentStatic[Placefix::_h('ACTUALVERSION')] + . CFactory::_('Content')->get('ACTUALVERSION') . " Was Successful! Let us know if anything is not working as expected.

';"; } @@ -9068,11 +9049,9 @@ class Interpretation extends Fields public function routerBuildViews(&$view) { - if (isset( - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] - ) + if (CFactory::_('Content')->exist('ROUTER_BUILD_VIEWS') && StringHelper::check( - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] + CFactory::_('Content')->get('ROUTER_BUILD_VIEWS') )) { return " || \$view === '" . $view . "'"; @@ -9090,7 +9069,7 @@ class Interpretation extends Fields $batchmove = array(); $VIEW = StringHelper::safe($nameSingleCode, 'U'); // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$nameSingleCode])) @@ -9337,7 +9316,7 @@ class Interpretation extends Fields $batchcopy = array(); $VIEW = StringHelper::safe($nameSingleCode, 'U'); // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$nameSingleCode])) @@ -9860,7 +9839,7 @@ class Interpretation extends Fields . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; $fixUnique[] = Indent::_(4) . "{"; $fixUnique[] = Indent::_(5) . "\$msg = JText:" . ":_('COM_" - . $this->fileContentStatic[Placefix::_h('COMPONENT')] . "_" . $VIEW . "_SAVE_WARNING');"; + . CFactory::_('Content')->get('COMPONENT') . "_" . $VIEW . "_SAVE_WARNING');"; $fixUnique[] = Indent::_(4) . "}"; $fixUnique[] = PHP_EOL . Indent::_(4) . "list(" . implode( '', $titleVars @@ -9879,7 +9858,7 @@ class Interpretation extends Fields . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; $fixUnique[] = Indent::_(4) . "{"; $fixUnique[] = Indent::_(5) . "\$msg = JText:" . ":_('COM_" - . $this->fileContentStatic[Placefix::_h('COMPONENT')] . "_" . $VIEW . "_SAVE_WARNING');"; + . CFactory::_('Content')->get('COMPONENT') . "_" . $VIEW . "_SAVE_WARNING');"; $fixUnique[] = Indent::_(4) . "}"; $fixUnique[] = PHP_EOL . Indent::_(4) . "\$data['" . $alias . "'] = \$this->_generateNewTitle(\$data['" . $alias @@ -9917,7 +9896,7 @@ class Interpretation extends Fields $fixUnique[] = Indent::_(3) . "\$uniqueFields = \$this->getUniqueFields();"; $fixUnique[] = Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uniqueFields))"; $fixUnique[] = Indent::_(3) . "{"; $fixUnique[] = Indent::_(4) @@ -9940,7 +9919,7 @@ class Interpretation extends Fields || isset($this->customAliasBuilder[$nameSingleCode]))) { // get component name - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); // rest the new function $newFunction = array(); $newFunction[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; @@ -11278,7 +11257,7 @@ class Interpretation extends Fields if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null) { // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; // setup correct core target $coreLoad = false; $core = null; @@ -11767,14 +11746,14 @@ class Interpretation extends Fields . $this->componentCodeName . '&view=' . $customLinkView['link'] . '&id=id; ?>' . $ref . '" title="fileContentStatic[Placefix::_h('COMPONENT')] . '_' . $customLinkView['NAME'] . "'" + . CFactory::_('Content')->get('COMPONENT') . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; $customAdminViewButton .= PHP_EOL . Indent::_(3) . ""; $customAdminViewButton .= PHP_EOL . Indent::_(4) . 'fileContentStatic[Placefix::_h('COMPONENT')] . '_' . $customLinkView['NAME'] + . ':_(' . "'COM_" . CFactory::_('Content')->get('COMPONENT') . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; $customAdminViewButton .= PHP_EOL . Indent::_(3) @@ -13811,7 +13790,7 @@ class Interpretation extends Fields $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' check if return value was set'; $headerscript .= PHP_EOL . 'if (' - . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::checkString($return))'; + . CFactory::_('Content')->get('Component') . 'Helper::checkString($return))'; $headerscript .= PHP_EOL . '{'; $headerscript .= PHP_EOL . Indent::_(1) . '//' . Line::_( __LINE__,__CLASS__ @@ -13851,7 +13830,7 @@ class Interpretation extends Fields $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' load the action object'; $headerscript .= PHP_EOL . '$can = ' - . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::getActions(' . "'" + . CFactory::_('Content')->get('Component') . 'Helper::getActions(' . "'" . $name_single_code . "'" . ');'; } @@ -14061,7 +14040,7 @@ class Interpretation extends Fields if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null) { // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; // make sure the custom links are only added once $firstTimeBeingAdded = true; // setup correct core target @@ -14251,7 +14230,7 @@ class Interpretation extends Fields if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null) { // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; $head = ''; // only add new button if set if ($addNewButon > 0) @@ -14613,7 +14592,7 @@ class Interpretation extends Fields if (!isset($this->fieldsNames[$nameSingleCode]['access'])) { // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; // load the access filter query code $query .= PHP_EOL . Indent::_(2) . "//" . Line::_( __LINE__,__CLASS__ @@ -14704,13 +14683,13 @@ class Interpretation extends Fields // add the fixing strings method $query .= $this->setGetItemsMethodStringFix( $nameSingleCode, $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')], + CFactory::_('Content')->get('Component'), Indent::_(1) ); // add translations $query .= $this->setSelectionTranslationFix( $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')], + CFactory::_('Content')->get('Component'), Indent::_(1) ); // filter by child repetable field values @@ -14725,19 +14704,19 @@ class Interpretation extends Fields __LINE__,__CLASS__ ) . " Filter by " . $globalKey . " in this Repetable Field"; $query .= PHP_EOL . Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$this->" + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && isset(\$this->" . $globalKey . "))"; $query .= PHP_EOL . Indent::_(3) . "{"; $query .= PHP_EOL . Indent::_(4) . "foreach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . Indent::_(4) . "{"; $query .= PHP_EOL . Indent::_(5) . "if (isset(\$item->" . $field - . ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $field . "))"; + . ") && " . CFactory::_('Content')->get('Component') . "Helper::checkJson(\$item->" . $field . "))"; $query .= PHP_EOL . Indent::_(5) . "{"; $query .= PHP_EOL . Indent::_(6) . "\$tmpArray = json_decode(\$item->" . $field . ",true);"; $query .= PHP_EOL . Indent::_(6) . "if (!isset(\$tmpArray['" - . $target . "']) || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$tmpArray['" + . $target . "']) || !" . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$tmpArray['" . $target . "']) || !in_array(\$this->" . $globalKey . ", \$tmpArray['" . $target . "']))"; $query .= PHP_EOL . Indent::_(6) . "{"; @@ -14770,7 +14749,7 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; $query .= PHP_EOL . Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && \$" . $globalKey + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && \$" . $globalKey . ")"; $query .= PHP_EOL . Indent::_(3) . "{"; $query .= PHP_EOL . Indent::_(4) @@ -14780,14 +14759,14 @@ class Interpretation extends Fields if (StringHelper::check($target)) { $query .= PHP_EOL . Indent::_(5) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $target + . CFactory::_('Content')->get('Component') . "Helper::checkJson(\$item->" . $target . "))"; $query .= PHP_EOL . Indent::_(5) . "{"; $query .= PHP_EOL . Indent::_(6) . "\$item->" . $target . " = json_decode(\$item->" . $target . ", true);"; $query .= PHP_EOL . Indent::_(5) . "}"; $query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->" - . $target . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->" + . $target . ") || !" . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$item->" . $target . "))"; $query .= PHP_EOL . Indent::_(5) . "{"; $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; @@ -14799,13 +14778,13 @@ class Interpretation extends Fields else { $query .= PHP_EOL . Indent::_(5) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $_key . "))"; + . CFactory::_('Content')->get('Component') . "Helper::checkJson(\$item->" . $_key . "))"; $query .= PHP_EOL . Indent::_(5) . "{"; $query .= PHP_EOL . Indent::_(6) . "\$item->" . $_key . " = json_decode(\$item->" . $_key . ", true);"; $query .= PHP_EOL . Indent::_(5) . "}"; $query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->" - . $_key . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->" + . $_key . ") || !" . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$item->" . $_key . "))"; $query .= PHP_EOL . Indent::_(5) . "{"; $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; @@ -14839,8 +14818,8 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = json_decode(\$this->" . $globalKey . ",true);"; $query .= PHP_EOL . Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$" - . $globalKey . ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && isset(\$" + . $globalKey . ") && " . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$" . $globalKey . "))"; $query .= PHP_EOL . Indent::_(3) . "{"; $query .= PHP_EOL . Indent::_(4) @@ -14848,7 +14827,7 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(4) . "{"; $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key . " && isset(\$" . $globalKey . "['" . $target . "']) && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['" + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; $query .= PHP_EOL . Indent::_(5) . "{"; $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->" . $_key @@ -14883,8 +14862,8 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; $query .= PHP_EOL . Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "))"; + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && " + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$" . $globalKey . "))"; $query .= PHP_EOL . Indent::_(3) . "{"; $query .= PHP_EOL . Indent::_(4) . "foreach (\$items as \$nr => &\$item)"; @@ -14893,7 +14872,7 @@ class Interpretation extends Fields if (StringHelper::check($target)) { $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key - . " && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['" + . " && " . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; $query .= PHP_EOL . Indent::_(5) . "{"; $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->" @@ -14936,7 +14915,7 @@ class Interpretation extends Fields // SELECTIONTRANSLATIONFIXFUNC<<>> $query .= $this->setSelectionTranslationFixFunc( $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')] + CFactory::_('Content')->get('Component') ); // fixe mothod name clash @@ -15122,7 +15101,7 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " setup the query"; $query .= PHP_EOL . Indent::_(2) . "if ((\$pks_size = " - . $this->fileContentStatic[Placefix::_h('Component')] + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$pks)) !== false || 'bulk' === \$pks)"; $query .= PHP_EOL . Indent::_(2) . "{"; $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) @@ -15133,7 +15112,7 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get the user object if not set."; $query .= PHP_EOL . Indent::_(3) . "if (!isset(\$user) || !" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$user))"; + . CFactory::_('Content')->get('Component') . "Helper::checkObject(\$user))"; $query .= PHP_EOL . Indent::_(3) . "{"; $query .= PHP_EOL . Indent::_(4) . "\$user = JFactory::getUser();"; $query .= PHP_EOL . Indent::_(3) . "}"; @@ -15288,7 +15267,7 @@ class Interpretation extends Fields // set the string fixing code $query .= $this->setGetItemsMethodStringFix( $nameSingleCode, $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')], + CFactory::_('Content')->get('Component'), Indent::_(2), $isExport, true ); // first check if we export of text only is avalable @@ -15296,7 +15275,7 @@ class Interpretation extends Fields { $query_translations = $this->setSelectionTranslationFix( $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')], Indent::_(3) + CFactory::_('Content')->get('Component'), Indent::_(3) ); } // add translations @@ -15396,12 +15375,12 @@ class Interpretation extends Fields $method[] = Indent::_(3) . "\$data = \$model->getExportData(\$pks);"; $method[] = Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$data))"; + . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$data))"; $method[] = Indent::_(3) . "{"; $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " now set the data to the spreadsheet"; $method[] = Indent::_(4) . "\$date = JFactory::getDate();"; - $method[] = Indent::_(4) . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::xls(\$data,'" + $method[] = Indent::_(4) . CFactory::_('Content')->get('Component') . "Helper::xls(\$data,'" . StringHelper::safe($nameListCode, 'F') . "_'.\$date->format('jS_F_Y'),'" . StringHelper::safe($nameListCode, 'Ww') @@ -15448,7 +15427,7 @@ class Interpretation extends Fields $method[] = Indent::_(3) . "\$headers = \$model->getExImPortHeaders();"; $method[] = Indent::_(3) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$headers))"; + . CFactory::_('Content')->get('Component') . "Helper::checkObject(\$headers))"; $method[] = Indent::_(3) . "{"; $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Load headers to session."; @@ -15711,7 +15690,7 @@ class Interpretation extends Fields if (!isset($this->fieldsNames[$nameSingleCode]['access'])) { // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; // load the access filter query code $query .= PHP_EOL . Indent::_(2) . "//" . Line::_( __LINE__,__CLASS__ @@ -16051,7 +16030,7 @@ class Interpretation extends Fields )) { // component helper name - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; // start building the filter query $filterQuery = ""; foreach ($this->filterBuilder[$nameListCode] as $filter) @@ -18384,7 +18363,7 @@ class Interpretation extends Fields )) { // get component name - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); // load the rest of the filters foreach ($this->filterBuilder[$nameListCode] as $filter) { @@ -18649,7 +18628,7 @@ class Interpretation extends Fields $get_values = true; } // get component name - $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $Component = CFactory::_('Content')->get('Component'); // load the rest of the batch options foreach ($this->filterBuilder[$nameListCode] as $filter) { @@ -18946,15 +18925,12 @@ class Interpretation extends Fields $includeHelper[] = Indent::_(2) . "include_once \$path;"; $includeHelper[] = Indent::_(1) . "}"; $includeHelper[] = "}"; - $this->fileContentStatic[Placefix::_h('CATEGORY_CLASS_TREES')] - .= implode("\n", $includeHelper); + CFactory::_('Content')->add('CATEGORY_CLASS_TREES', implode("\n", $includeHelper)); } // return category view string - if (isset( - $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] - ) + if (CFactory::_('Content')->exist('ROUTER_CATEGORY_VIEWS') && StringHelper::check( - $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] + CFactory::_('Content')->get('ROUTER_CATEGORY_VIEWS') )) { return "," . PHP_EOL . Indent::_(3) . '"' @@ -20987,7 +20963,7 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Built the actions for new and existing records."; $toolBar .= PHP_EOL . Indent::_(2) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$this->referral))"; + . CFactory::_('Content')->get('Component') . "Helper::checkString(\$this->referral))"; $toolBar .= PHP_EOL . Indent::_(2) . "{"; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) @@ -21226,10 +21202,10 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set help url for this view if found"; $toolBar .= PHP_EOL . Indent::_(2) . "\$this->help_url = " - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::getHelpUrl('" . $nameSingleCode + . CFactory::_('Content')->get('Component') . "Helper::getHelpUrl('" . $nameSingleCode . "');"; $toolBar .= PHP_EOL . Indent::_(2) . "if (" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$this->help_url))"; + . CFactory::_('Content')->get('Component') . "Helper::checkString(\$this->help_url))"; $toolBar .= PHP_EOL . Indent::_(2) . "{"; $toolBar .= PHP_EOL . Indent::_(3) . "JToolbarHelper::help('" . $this->langPrefix . "_HELP_MANAGER', false, \$this->help_url);"; @@ -21635,7 +21611,7 @@ class Interpretation extends Fields . "\$item->tags->getTagIds("; $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$item->id, 'com_" - . $this->fileContentStatic[Placefix::_h('component')] . ".$nameSingleCode'"; + . CFactory::_('Content')->get('component') . ".$nameSingleCode'"; $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . ");"; $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "if (\$item->tags->tags)"; @@ -22069,7 +22045,7 @@ class Interpretation extends Fields . " Get the user object if not set."; $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "if (!isset(\$user) || !" - . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$user))"; + . CFactory::_('Content')->get('Component') . "Helper::checkObject(\$user))"; $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "{"; $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) @@ -23105,7 +23081,7 @@ class Interpretation extends Fields . " 'vdm')); ?>"; $display[] = $tab . Indent::_(2) . "fileContentStatic[Placefix::_h('COMPANYNAME')] + . CFactory::_('Content')->get('COMPANYNAME') . "', 'vdm'); ?>"; $display[] = $tab . Indent::_(3) . "loadTemplate('vdm');?>"; @@ -27940,8 +27916,8 @@ function vdm_dkim() { public function getModCode(&$module) { // get component helper string - $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; - $component = $this->fileContentStatic[Placefix::_h('component')]; + $Helper = CFactory::_('Content')->get('Component') . 'Helper'; + $component = CFactory::_('Content')->get('component'); $_helper = ''; // get libraries code $libraries = array(Placefix::_('MOD_LIBRARIES') => $this->getModLibCode($module)); @@ -27961,7 +27937,7 @@ function vdm_dkim() { . "/helpers/" . $component . ".php');"; } - return CFactory::_('Placeholder')->update($_helper . PHP_EOL . $code . PHP_EOL, $this->fileContentStatic); + return CFactory::_('Placeholder')->update($_helper . PHP_EOL . $code . PHP_EOL, CFactory::_('Content')->active); } public function getModDefault(&$module, &$key) @@ -27983,7 +27959,7 @@ function vdm_dkim() { ); // return the default content for the model default area - return CFactory::_('Placeholder')->update($default, $this->fileContentStatic); + return CFactory::_('Placeholder')->update($default, CFactory::_('Content')->active); } public function getModHelperCode(&$module) @@ -27993,7 +27969,7 @@ function vdm_dkim() { $module->class_helper_type . $module->class_helper_name . PHP_EOL . '{' . PHP_EOL . $module->class_helper_code . PHP_EOL . - "}" . PHP_EOL, $this->fileContentStatic); + "}" . PHP_EOL, CFactory::_('Content')->active); } public function getModLibCode(&$module) @@ -28048,7 +28024,7 @@ function vdm_dkim() { ) ), $this->placeholders - ), $this->fileContentStatic); + ), CFactory::_('Content')->active); } return ''; @@ -28449,7 +28425,7 @@ function vdm_dkim() { $plugin->class_name . ' extends ' . $plugin->extends . PHP_EOL . '{' . PHP_EOL . $plugin->main_class_code . PHP_EOL . - "}" . PHP_EOL, $this->fileContentStatic); + "}" . PHP_EOL, CFactory::_('Content')->active); } public function getPluginMainXML(&$plugin) @@ -28862,7 +28838,7 @@ function vdm_dkim() { } $code[] = '}' . PHP_EOL . PHP_EOL; - return CFactory::_('Placeholder')->update(implode(PHP_EOL, $code), $this->fileContentStatic); + return CFactory::_('Placeholder')->update(implode(PHP_EOL, $code), CFactory::_('Content')->active); } public function setPowersAutoloader($namespace, $loadSite) @@ -28870,7 +28846,7 @@ function vdm_dkim() { if (($size = ArrayHelper::check($namespace)) > 0) { // check if we are using a plugin - $use_plugin = isset($this->fileContentStatic[Placefix::_h('PLUGIN_POWER_AUTOLOADER')]); + $use_plugin = CFactory::_('Content')->exist('PLUGIN_POWER_AUTOLOADER'); // build the methods $autoloadNotSiteMethod = array(); $autoloadMethod = array(); @@ -28977,20 +28953,20 @@ function vdm_dkim() { // check if we are using a plugin if ($use_plugin) { - $this->fileContentStatic[Placefix::_h('PLUGIN_POWER_AUTOLOADER')] = PHP_EOL . $autoloader; + CFactory::_('Content')->set('PLUGIN_POWER_AUTOLOADER', PHP_EOL . $autoloader); } else { // load to events placeholders - $this->fileContentStatic[Placefix::_h('ADMIN_POWER_HELPER')] .= $autoloader; + CFactory::_('Content')->add('ADMIN_POWER_HELPER', $autoloader); // load to site if needed if ($loadSite) { - $this->fileContentStatic[Placefix::_h('SITE_POWER_HELPER')] .= $autoloader; + CFactory::_('Content')->add('SITE_POWER_HELPER', $autoloader); } } // to add to custom files - $this->fileContentStatic[Placefix::_h('CUSTOM_POWER_AUTOLOADER')] .= PHP_EOL . implode(PHP_EOL, $autoloadMethod); + CFactory::_('Content')->add('CUSTOM_POWER_AUTOLOADER', PHP_EOL . implode(PHP_EOL, $autoloadMethod)); } } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 4093f1c70..0ab0f1b58 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -66,269 +66,236 @@ class Infusion extends Interpretation { // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildFilesContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildFilesContent', array(&$this->componentContext, &$this->componentData, - &$this->fileContentStatic, &$this->fileContentDynamic, + &$fileContentStatic, &$this->fileContentDynamic, &$this->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); // COMPONENT - $this->fileContentStatic[Placefix::_h('COMPONENT')] - = CFactory::_('Placeholder')->active[Placefix::_h('COMPONENT')]; + CFactory::_('Content')->set('COMPONENT', CFactory::_('Placeholder')->active[Placefix::_h('COMPONENT')]); // Component - $this->fileContentStatic[Placefix::_h('Component')] - = CFactory::_('Placeholder')->active[Placefix::_h('Component')]; + CFactory::_('Content')->set('Component', CFactory::_('Placeholder')->active[Placefix::_h('Component')]); // component - $this->fileContentStatic[Placefix::_h('component')] - = CFactory::_('Placeholder')->active[Placefix::_h('component')]; + CFactory::_('Content')->set('component', CFactory::_('Placeholder')->active[Placefix::_h('component')]); // COMPANYNAME - $this->fileContentStatic[Placefix::_h('COMPANYNAME')] - = trim( + CFactory::_('Content')->set('COMPANYNAME', trim( JFilterOutput::cleanText($this->componentData->companyname) - ); + )); // CREATIONDATE - $this->fileContentStatic[Placefix::_h('CREATIONDATE')] - = JFactory::getDate($this->componentData->created)->format( + CFactory::_('Content')->set('CREATIONDATE', + JFactory::getDate($this->componentData->created)->format( 'jS F, Y' - ); - $this->fileContentStatic[Placefix::_h('CREATIONDATE') - . 'GLOBAL'] - = $this->fileContentStatic[Placefix::_h('CREATIONDATE')]; + )); + CFactory::_('Content')->set('GLOBALCREATIONDATE', + CFactory::_('Content')->get('CREATIONDATE')); // BUILDDATE - $this->fileContentStatic[Placefix::_h('BUILDDATE')] - = JFactory::getDate()->format('jS F, Y'); - $this->fileContentStatic[Placefix::_h('BUILDDATE') - . 'GLOBAL'] - = $this->fileContentStatic[Placefix::_h('BUILDDATE')]; + CFactory::_('Content')->set('BUILDDATE', JFactory::getDate()->format('jS F, Y')); + CFactory::_('Content')->set('GLOBALBUILDDATE', + CFactory::_('Content')->get('BUILDDATE')); // AUTHOR - $this->fileContentStatic[Placefix::_h('AUTHOR')] = trim( + CFactory::_('Content')->set('AUTHOR', trim( JFilterOutput::cleanText($this->componentData->author) - ); + )); // AUTHOREMAIL - $this->fileContentStatic[Placefix::_h('AUTHOREMAIL')] - = trim($this->componentData->email); + CFactory::_('Content')->set('AUTHOREMAIL', trim($this->componentData->email)); // AUTHORWEBSITE - $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] - = trim($this->componentData->website); + CFactory::_('Content')->set('AUTHORWEBSITE', trim($this->componentData->website)); // COPYRIGHT - $this->fileContentStatic[Placefix::_h('COPYRIGHT')] - = trim($this->componentData->copyright); + CFactory::_('Content')->set('COPYRIGHT', trim($this->componentData->copyright)); // LICENSE - $this->fileContentStatic[Placefix::_h('LICENSE')] - = trim($this->componentData->license); + CFactory::_('Content')->set('LICENSE', trim($this->componentData->license)); // VERSION - $this->fileContentStatic[Placefix::_h('VERSION')] - = trim($this->componentData->component_version); + CFactory::_('Content')->set('VERSION', trim($this->componentData->component_version)); // set the actual global version - $this->fileContentStatic[Placefix::_h('ACTUALVERSION')] - = $this->fileContentStatic[Placefix::_h('VERSION')]; + CFactory::_('Content')->set('ACTUALVERSION', CFactory::_('Content')->get('VERSION')); // do some Tweaks to the version based on selected options - if (strpos( - $this->fileContentStatic[Placefix::_h('VERSION')], '.' - ) !== false) + if (strpos(CFactory::_('Content')->get('VERSION'), '.') !== false) { $versionArray = explode( - '.', $this->fileContentStatic[Placefix::_h('VERSION')] + '.', CFactory::_('Content')->get('VERSION') ); } // load only first two values if (isset($versionArray) && ArrayHelper::check( $versionArray - ) - && $this->componentData->mvc_versiondate == 2) + ) && $this->componentData->mvc_versiondate == 2) { - $this->fileContentStatic[Placefix::_h('VERSION')] - = $versionArray[0] . '.' . $versionArray[1] . '.x'; + CFactory::_('Content')->set('VERSION', $versionArray[0] . '.' . $versionArray[1] . '.x'); } // load only the first value elseif (isset($versionArray) && ArrayHelper::check( $versionArray - ) - && $this->componentData->mvc_versiondate == 3) + ) && $this->componentData->mvc_versiondate == 3) { - $this->fileContentStatic[Placefix::_h('VERSION')] - = $versionArray[0] . '.x.x'; + CFactory::_('Content')->set('VERSION', $versionArray[0] . '.x.x'); } unset($versionArray); // set the global version in case - $this->fileContentStatic[Placefix::_h('VERSION') - . 'GLOBAL'] - = $this->fileContentStatic[Placefix::_h('VERSION')]; + CFactory::_('Content')->set('GLOBALVERSION', CFactory::_('Content')->get('VERSION')); // set the joomla target xml version - $this->fileContentStatic[Placefix::_h('XMLVERSION')] - = $this->joomlaVersions[CFactory::_('Config')->joomla_version]['xml_version']; + CFactory::_('Content')->set('XMLVERSION', $this->joomlaVersions[CFactory::_('Config')->joomla_version]['xml_version']); // Component_name - $this->fileContentStatic[Placefix::_h('Component_name')] - = JFilterOutput::cleanText($this->componentData->name); + CFactory::_('Content')->set('Component_name', JFilterOutput::cleanText($this->componentData->name)); // SHORT_DISCRIPTION - $this->fileContentStatic[Placefix::_h('SHORT_DESCRIPTION')] - = trim( + CFactory::_('Content')->set('SHORT_DESCRIPTION', trim( JFilterOutput::cleanText( $this->componentData->short_description ) - ); + )); // DESCRIPTION - $this->fileContentStatic[Placefix::_h('DESCRIPTION')] - = trim($this->componentData->description); + CFactory::_('Content')->set('DESCRIPTION', trim($this->componentData->description)); // COMP_IMAGE_TYPE - $this->fileContentStatic[Placefix::_h('COMP_IMAGE_TYPE')] - = $this->setComponentImageType($this->componentData->image); + CFactory::_('Content')->set('COMP_IMAGE_TYPE', $this->setComponentImageType($this->componentData->image)); // ACCESS_SECTIONS - $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] - = $this->setAccessSections(); + CFactory::_('Content')->set('ACCESS_SECTIONS', $this->setAccessSections()); // CONFIG_FIELDSETS $keepLang = CFactory::_('Config')->lang_target; CFactory::_('Config')->lang_target = 'admin'; // start loading the category tree scripts - $this->fileContentStatic[Placefix::_h('CATEGORY_CLASS_TREES')] - = ''; + CFactory::_('Content')->set('CATEGORY_CLASS_TREES', ''); // run the field sets for first time $this->setConfigFieldsets(1); CFactory::_('Config')->lang_target = $keepLang; // ADMINJS - $this->fileContentStatic[Placefix::_h('ADMINJS')] - = CFactory::_('Placeholder')->update( + CFactory::_('Content')->set('ADMINJS', + CFactory::_('Placeholder')->update( CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active - ); + )); // SITEJS - $this->fileContentStatic[Placefix::_h('SITEJS')] - = CFactory::_('Placeholder')->update( + CFactory::_('Content')->set('SITEJS', + CFactory::_('Placeholder')->update( CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active - ); + )); // ADMINCSS - $this->fileContentStatic[Placefix::_h('ADMINCSS')] - = CFactory::_('Placeholder')->update( + CFactory::_('Content')->set('ADMINCSS', + CFactory::_('Placeholder')->update( CFactory::_('Customcode.Dispenser')->hub['component_css_admin'], CFactory::_('Placeholder')->active - ); + )); // SITECSS - $this->fileContentStatic[Placefix::_h('SITECSS')] - = CFactory::_('Placeholder')->update( + CFactory::_('Content')->set('SITECSS', + CFactory::_('Placeholder')->update( CFactory::_('Customcode.Dispenser')->hub['component_css_site'], CFactory::_('Placeholder')->active - ); + )); // CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[Placefix::_h('CUSTOM_HELPER_SCRIPT')] - = CFactory::_('Placeholder')->update( + CFactory::_('Content')->set('CUSTOM_HELPER_SCRIPT', + CFactory::_('Placeholder')->update( CFactory::_('Customcode.Dispenser')->hub['component_php_helper_admin'], CFactory::_('Placeholder')->active - ); + )); // BOTH_CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[Placefix::_h('BOTH_CUSTOM_HELPER_SCRIPT')] - = CFactory::_('Placeholder')->update( + CFactory::_('Content')->set('BOTH_CUSTOM_HELPER_SCRIPT', + CFactory::_('Placeholder')->update( CFactory::_('Customcode.Dispenser')->hub['component_php_helper_both'], CFactory::_('Placeholder')->active - ); + )); // ADMIN_GLOBAL_EVENT_HELPER - if (!isset($this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')])) + if (!CFactory::_('Content')->exist('ADMIN_GLOBAL_EVENT')) { - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')] = ''; + CFactory::_('Content')->set('ADMIN_GLOBAL_EVENT', ''); } - if (!isset($this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')])) + if (!CFactory::_('Content')->exist('ADMIN_GLOBAL_EVENT_HELPER')) { - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] = ''; + CFactory::_('Content')->set('ADMIN_GLOBAL_EVENT_HELPER', ''); } // now load the data for the global event if needed if ($this->componentData->add_admin_event == 1) { // ADMIN_GLOBAL_EVENT - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')] - .= PHP_EOL . PHP_EOL . '// Trigger the Global Admin Event'; - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')] - .= PHP_EOL . $this->fileContentStatic[Placefix::_h('Component')] - . 'Helper::globalEvent($document);'; + CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT', PHP_EOL . PHP_EOL . '// Trigger the Global Admin Event'); + CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT', + PHP_EOL . CFactory::_('Content')->get('Component') + . 'Helper::globalEvent($document);'); // ADMIN_GLOBAL_EVENT_HELPER - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) - . '* The Global Admin Event Method.'; - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) . '**/'; - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) - . 'public static function globalEvent($document)'; - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) . '{'; - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . CFactory::_('Placeholder')->update( + CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . PHP_EOL . Indent::_(1) . '/**'); + CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', + PHP_EOL . Indent::_(1) + . '* The Global Admin Event Method.'); + CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '**/'); + CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', + PHP_EOL . Indent::_(1) + . '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 - ); - $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) . '}'; + )); + CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '}'); } // now load the readme file if needed if ($this->componentData->addreadme == 1) { - $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FILES')] - .= PHP_EOL . Indent::_(3) - . "README.txt"; + CFactory::_('Content')->add('EXSTRA_ADMIN_FILES', + PHP_EOL . Indent::_(3) + . "README.txt"); } // HELPER_CREATEUSER - $this->fileContentStatic[Placefix::_h('HELPER_CREATEUSER')] - = $this->setCreateUserHelperMethod( + CFactory::_('Content')->add('HELPER_CREATEUSER', + $this->setCreateUserHelperMethod( $this->componentData->creatuserhelper - ); + )); // HELP - $this->fileContentStatic[Placefix::_h('HELP')] - = $this->noHelp(); + CFactory::_('Content')->set('HELP', $this->noHelp()); // HELP_SITE - $this->fileContentStatic[Placefix::_h('HELP_SITE')] - = $this->noHelp(); + CFactory::_('Content')->set('HELP_SITE', $this->noHelp()); // build route parse switch - $this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')] - = ''; + CFactory::_('Content')->set('ROUTER_PARSE_SWITCH', ''); // build route views - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] - = ''; + CFactory::_('Content')->set('ROUTER_BUILD_VIEWS', ''); // add the helper emailer if set - $this->fileContentStatic[Placefix::_h('HELPER_EMAIL')] - = $this->addEmailHelper(); + CFactory::_('Content')->set('HELPER_EMAIL', $this->addEmailHelper()); // load the global placeholders foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder => $gloabalValue ) { - $this->fileContentStatic[$globalPlaceholder] = $gloabalValue; + CFactory::_('Content')->set($globalPlaceholder, $gloabalValue); } // reset view array @@ -386,18 +353,23 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, &$nameListCode, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$nameSingleCode], &$this->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); // FIELDSETS <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('FIELDSETS')] @@ -469,7 +441,7 @@ class Infusion extends Interpretation $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VALIDATIONFIX')] = $this->setValidationFix( $nameSingleCode, - $this->fileContentStatic[Placefix::_h('Component')] + CFactory::_('Content')->get('Component') ); // EDITBODY <<>> @@ -636,18 +608,23 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, &$nameListCode, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$nameSingleCode], &$this->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); } // set the views names if (isset($view['settings']->name_list) @@ -661,18 +638,23 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminListViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, &$nameListCode, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$nameListCode], &$this->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); // set the export/import option if (isset($view['port']) && $view['port'] @@ -737,7 +719,7 @@ class Infusion extends Interpretation = $this->setGetItemsMethodStringFix( $nameSingleCode, $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')] + CFactory::_('Content')->get('Component') ); // GET_ITEMS_METHOD_AFTER_ALL <<>> @@ -751,14 +733,14 @@ class Infusion extends Interpretation $this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIX')] = $this->setSelectionTranslationFix( $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')] + CFactory::_('Content')->get('Component') ); // SELECTIONTRANSLATIONFIXFUNC <<>> $this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIXFUNC')] = $this->setSelectionTranslationFixFunc( $nameListCode, - $this->fileContentStatic[Placefix::_h('Component')] + CFactory::_('Content')->get('Component') ); // FILTER_FIELDS <<>> @@ -787,18 +769,11 @@ class Infusion extends Interpretation ); // CATEGORY_VIEWS - if (!isset( - $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] - )) - { - $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] - = ''; - } - $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] - .= $this->setRouterCategoryViews( + CFactory::_('Content')->add('ROUTER_CATEGORY_VIEWS', + $this->setRouterCategoryViews( $nameSingleCode, $nameListCode - ); + )); // FILTERFIELDDISPLAYHELPER <<>> $this->fileContentDynamic[$nameListCode][Placefix::_h('FILTERFIELDDISPLAYHELPER')] @@ -977,18 +952,23 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildAdminListViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminListViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, &$nameListCode, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$nameListCode], &$this->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); } // set u fields used in batch @@ -1098,18 +1078,11 @@ class Infusion extends Interpretation ); // set helper router - if (!isset( - $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] - )) - { - $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] - = ''; - } - $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] - .= $this->setRouterHelp( + CFactory::_('Content')->add('ROUTEHELPER', + $this->setRouterHelp( $nameSingleCode, $nameListCode - ); + )); if (isset($view['edit_create_site_view']) && is_numeric( @@ -1118,56 +1091,52 @@ class Infusion extends Interpretation && $view['edit_create_site_view'] > 0) { // add needed router stuff for front edit views - $this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')] - .= $this->routerParseSwitch( + CFactory::_('Content')->add('ROUTER_PARSE_SWITCH', + $this->routerParseSwitch( $nameSingleCode, null, false - ); - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] - .= $this->routerBuildViews( + )); + CFactory::_('Content')->add('ROUTER_BUILD_VIEWS', + $this->routerBuildViews( $nameSingleCode - ); + )); } // ACCESS_SECTIONS - if (!isset( - $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] - )) - { - $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] - = ''; - } - $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] - .= $this->setAccessSectionsCategory( + CFactory::_('Content')->add('ACCESS_SECTIONS', + $this->setAccessSectionsCategory( $nameSingleCode, $nameListCode - ); + )); // set the Joomla Fields ACCESS section if needed if (isset($view['joomla_fields']) && $view['joomla_fields'] == 1) { - $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] - .= $this->setAccessSectionsJoomlaFields(); + CFactory::_('Content')->add('ACCESS_SECTIONS', $this->setAccessSectionsJoomlaFields()); } // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildAdminViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, &$nameListCode, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic, &$this->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); } // all fields stored in database - $this->fileContentStatic[Placefix::_h('ARRAY_ALL_SEARCH_FIELDS')] = - CFactory::_('Registry')->varExport('all_search_fields', 1); + CFactory::_('Content')->set('ARRAY_ALL_SEARCH_FIELDS', CFactory::_('Registry')->varExport('all_search_fields', 1)); // setup the layouts $this->setCustomViewLayouts(); @@ -1240,17 +1209,22 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->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); // set license per view if needed $this->setLockLicensePer( @@ -1429,17 +1403,22 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->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); } // setup the layouts @@ -1447,67 +1426,58 @@ class Infusion extends Interpretation } // ADMIN_HELPER_CLASS_HEADER - $this->fileContentStatic[Placefix::_h('ADMIN_HELPER_CLASS_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set('ADMIN_HELPER_CLASS_HEADER', + $this->setFileHeader( 'admin.helper', 'admin' - ); + )); // ADMIN_COMPONENT_HEADER - $this->fileContentStatic[Placefix::_h('ADMIN_COMPONENT_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set('ADMIN_COMPONENT_HEADER', + $this->setFileHeader( 'admin.component', 'admin' - ); + )); // SITE_HELPER_CLASS_HEADER - $this->fileContentStatic[Placefix::_h('SITE_HELPER_CLASS_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set('SITE_HELPER_CLASS_HEADER', + $this->setFileHeader( 'site.helper', 'site' - ); + )); // SITE_COMPONENT_HEADER - $this->fileContentStatic[Placefix::_h('SITE_COMPONENT_HEADER')] - = $this->setFileHeader( + CFactory::_('Content')->set('SITE_COMPONENT_HEADER', + $this->setFileHeader( 'site.component', 'site' - ); + )); // HELPER_EXEL - $this->fileContentStatic[Placefix::_h('HELPER_EXEL')] - = $this->setHelperExelMethods(); + CFactory::_('Content')->set('HELPER_EXEL', $this->setHelperExelMethods()); // VIEWARRAY - $this->fileContentStatic[Placefix::_h('VIEWARRAY')] - = PHP_EOL . implode("," . PHP_EOL, $viewarray); + CFactory::_('Content')->set('VIEWARRAY', PHP_EOL . implode("," . PHP_EOL, $viewarray)); // CUSTOM_ADMIN_EDIT_VIEW_ARRAY - $this->fileContentStatic[Placefix::_h('SITE_EDIT_VIEW_ARRAY')] - = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array); + CFactory::_('Content')->set('SITE_EDIT_VIEW_ARRAY', PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array)); // MAINMENUS - $this->fileContentStatic[Placefix::_h('MAINMENUS')] - = $this->setMainMenus(); + CFactory::_('Content')->set('MAINMENUS', $this->setMainMenus()); // SUBMENU - $this->fileContentStatic[Placefix::_h('SUBMENU')] - = $this->setSubMenus(); + CFactory::_('Content')->set('SUBMENU', $this->setSubMenus()); // GET_CRYPT_KEY - $this->fileContentStatic[Placefix::_h('GET_CRYPT_KEY')] - = $this->setGetCryptKey(); + CFactory::_('Content')->set('GET_CRYPT_KEY', $this->setGetCryptKey()); // set the license locker $this->setLockLicense(); // CONTRIBUTORS - $this->fileContentStatic[Placefix::_h('CONTRIBUTORS')] - = $this->theContributors; + CFactory::_('Content')->set('CONTRIBUTORS', $this->theContributors); // INSTALL - $this->fileContentStatic[Placefix::_h('INSTALL')] - = $this->setInstall(); + CFactory::_('Content')->set('INSTALL', $this->setInstall()); // UNINSTALL - $this->fileContentStatic[Placefix::_h('UNINSTALL')] - = $this->setUninstall(); + CFactory::_('Content')->set('UNINSTALL', $this->setUninstall()); // UPDATE_VERSION_MYSQL $this->setVersionController(); @@ -1516,8 +1486,7 @@ class Infusion extends Interpretation if (!StringHelper::check($this->dynamicDashboard)) { // DASHBOARDVIEW - $this->fileContentStatic[Placefix::_h('DASHBOARDVIEW')] - = CFactory::_('Config')->component_code_name; + CFactory::_('Content')->set('DASHBOARDVIEW', CFactory::_('Config')->component_code_name); // DASHBOARDICONS $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASHBOARDICONS')] @@ -1555,8 +1524,7 @@ class Infusion extends Interpretation else { // DASHBOARDVIEW - $this->fileContentStatic[Placefix::_h('DASHBOARDVIEW')] - = $this->dynamicDashboard; + CFactory::_('Content')->set('DASHBOARDVIEW', $this->dynamicDashboard); } // add import @@ -1714,17 +1682,22 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onBeforeBuildSiteViewContent CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->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); // set license per view if needed $this->setLockLicensePer( @@ -1735,8 +1708,7 @@ class Infusion extends Interpretation if (isset($view['default_view']) && $view['default_view'] == 1) { - $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] - = $view['settings']->code; + CFactory::_('Content')->set('SITE_DEFAULT_VIEW', $view['settings']->code); } // add site menu if (isset($view['menu']) && $view['menu'] == 1) @@ -1747,17 +1719,16 @@ class Infusion extends Interpretation } // insure the needed route helper is loaded - $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] - .= $this->setRouterHelp( + CFactory::_('Content')->add('ROUTEHELPER', + $this->setRouterHelp( $view['settings']->code, $view['settings']->code, true - ); + )); // build route details - $this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')] - .= $this->routerParseSwitch( + CFactory::_('Content')->add('ROUTER_PARSE_SWITCH', + $this->routerParseSwitch( $view['settings']->code, $view - ); - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] - .= $this->routerBuildViews($view['settings']->code); + )); + CFactory::_('Content')->add('ROUTER_BUILD_VIEWS', $this->routerBuildViews($view['settings']->code)); if ($view['settings']->main_get->gettype == 1) { @@ -1931,17 +1902,22 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildSiteViewContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, - &$this->fileContentStatic, + &$fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->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); } // setup the layouts @@ -1957,127 +1933,107 @@ class Infusion extends Interpretation { CFactory::_('Config')->build_target = 'site'; // if no default site view was set, the redirect to root - if (!isset( - $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] - )) + if (!CFactory::_('Content')->exist('SITE_DEFAULT_VIEW')) { - $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] - = ''; + CFactory::_('Content')->set('SITE_DEFAULT_VIEW', ''); } // set site custom script to helper class // SITE_CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[Placefix::_h('SITE_CUSTOM_HELPER_SCRIPT')] - = CFactory::_('Placeholder')->update( + CFactory::_('Content')->set('SITE_CUSTOM_HELPER_SCRIPT', + CFactory::_('Placeholder')->update( CFactory::_('Customcode.Dispenser')->hub['component_php_helper_site'], CFactory::_('Placeholder')->active - ); + )); // SITE_GLOBAL_EVENT_HELPER - if (!isset($this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')])) + if (!CFactory::_('Content')->exist('SITE_GLOBAL_EVENT')) { - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')] = ''; + CFactory::_('Content')->set('SITE_GLOBAL_EVENT', ''); } - if (!isset($this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')])) + if (!CFactory::_('Content')->exist('SITE_GLOBAL_EVENT_HELPER')) { - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] = ''; + CFactory::_('Content')->set('SITE_GLOBAL_EVENT_HELPER', ''); } // now load the data for the global event if needed if ($this->componentData->add_site_event == 1) { - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')] - .= PHP_EOL . PHP_EOL . '// Trigger the Global Site Event'; - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')] - .= PHP_EOL . $this->fileContentStatic[Placefix::_h('Component')] - . 'Helper::globalEvent($document);'; + CFactory::_('Content')->add('SITE_GLOBAL_EVENT', PHP_EOL . PHP_EOL . '// Trigger the Global Site Event'); + CFactory::_('Content')->add('SITE_GLOBAL_EVENT', + PHP_EOL . CFactory::_('Content')->get('Component') + . 'Helper::globalEvent($document);'); // SITE_GLOBAL_EVENT_HELPER - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) - . '* The Global Site Event Method.'; - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) . '**/'; - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) - . 'public static function globalEvent($document)'; - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) . '{'; - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . CFactory::_('Placeholder')->update( + CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . PHP_EOL . Indent::_(1) . '/**'); + CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', + PHP_EOL . Indent::_(1) + . '* The Global Site Event Method.'); + CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '**/'); + CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', + PHP_EOL . Indent::_(1) + . '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 - ); - $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] - .= PHP_EOL . Indent::_(1) . '}'; + )); + CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '}'); } } // PREINSTALLSCRIPT - $this->fileContentStatic[Placefix::_h('PREINSTALLSCRIPT')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set('PREINSTALLSCRIPT', + CFactory::_('Customcode.Dispenser')->get( 'php_preflight', 'install', PHP_EOL, null, true - ); + )); // PREUPDATESCRIPT - $this->fileContentStatic[Placefix::_h('PREUPDATESCRIPT')] - = CFactory::_('Customcode.Dispenser')->get( + CFactory::_('Content')->set('PREUPDATESCRIPT', + CFactory::_('Customcode.Dispenser')->get( 'php_preflight', 'update', PHP_EOL, null, true - ); + )); // POSTINSTALLSCRIPT - $this->fileContentStatic[Placefix::_h('POSTINSTALLSCRIPT')] - = $this->setPostInstallScript(); + CFactory::_('Content')->set('POSTINSTALLSCRIPT', $this->setPostInstallScript()); // POSTUPDATESCRIPT - $this->fileContentStatic[Placefix::_h('POSTUPDATESCRIPT')] - = $this->setPostUpdateScript(); + CFactory::_('Content')->set('POSTUPDATESCRIPT', $this->setPostUpdateScript()); // UNINSTALLSCRIPT - $this->fileContentStatic[Placefix::_h('UNINSTALLSCRIPT')] - = $this->setUninstallScript(); + CFactory::_('Content')->set('UNINSTALLSCRIPT', $this->setUninstallScript()); // MOVEFOLDERSSCRIPT - $this->fileContentStatic[Placefix::_h('MOVEFOLDERSSCRIPT')] - = $this->setMoveFolderScript(); + CFactory::_('Content')->set('MOVEFOLDERSSCRIPT', $this->setMoveFolderScript()); // MOVEFOLDERSMETHOD - $this->fileContentStatic[Placefix::_h('MOVEFOLDERSMETHOD')] - = $this->setMoveFolderMethod(); + CFactory::_('Content')->set('MOVEFOLDERSMETHOD', $this->setMoveFolderMethod()); // HELPER_UIKIT - $this->fileContentStatic[Placefix::_h('HELPER_UIKIT')] - = $this->setUikitHelperMethods(); + CFactory::_('Content')->set('HELPER_UIKIT', $this->setUikitHelperMethods()); // CONFIG_FIELDSETS - $this->fileContentStatic[Placefix::_h('CONFIG_FIELDSETS')] - = implode(PHP_EOL, $this->configFieldSets); + CFactory::_('Content')->set('CONFIG_FIELDSETS', implode(PHP_EOL, $this->configFieldSets)); // check if this has been set - if (!isset( - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] - ) + if (!CFactory::_('Content')->exist('ROUTER_BUILD_VIEWS') || !StringHelper::check( - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] + CFactory::_('Content')->get('ROUTER_BUILD_VIEWS') )) { - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] - = 0; + CFactory::_('Content')->set('ROUTER_BUILD_VIEWS', 0); } else { - $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] - = '(' . $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] . ')'; + CFactory::_('Content')->set('ROUTER_BUILD_VIEWS', '(' . CFactory::_('Content')->get('ROUTER_BUILD_VIEWS') . ')'); } // README if ($this->componentData->addreadme) { - $this->fileContentStatic[Placefix::_h('README')] - = $this->componentData->readme; + CFactory::_('Content')->set('README', $this->componentData->readme); } // remove all the power placeholders - $this->fileContentStatic[Placefix::_h('ADMIN_POWER_HELPER')] = ''; - $this->fileContentStatic[Placefix::_h('SITE_POWER_HELPER')] = ''; - $this->fileContentStatic[Placefix::_h('CUSTOM_POWER_AUTOLOADER')] = ''; + 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)) { @@ -2250,15 +2206,20 @@ class Infusion extends Interpretation CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; + $fileContentStatic = CFactory::_('Content')->active; + // $this->fileContentDynamic = CFactory::_('Content')->_active; // Trigger Event: jcb_ce_onAfterBuildFilesContent CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildFilesContent', array(&$this->componentContext, &$this->componentData, - &$this->fileContentStatic, &$this->fileContentDynamic, + &$fileContentStatic, &$this->fileContentDynamic, &$this->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); return true; } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 0741a0fa6..9dd9fd45c 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -3799,7 +3799,7 @@ abstract class ComponentbuilderHelper // make sure we have the composer classes loaded self::composerAutoload('phpseclib'); // build class name - $CLASS = '\phpseclib\Crypt\\' . $type; + $CLASS = '\phpseclib3\Crypt\\' . $type; // make sure we have the phpseclib classes if (!class_exists($CLASS)) { @@ -3813,31 +3813,31 @@ abstract class ComponentbuilderHelper switch ($mode) { case 'CTR': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CTR); + self::$CRYPT[$key] = new $CLASS('ctr'); break; case 'ECB': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_ECB); + self::$CRYPT[$key] = new $CLASS('ecb'); break; case 'CBC': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC); + self::$CRYPT[$key] = new $CLASS('cbc'); break; case 'CBC3': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC3); + self::$CRYPT[$key] = new $CLASS('cbc3'); break; case 'CFB': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB); + self::$CRYPT[$key] = new $CLASS('cfb'); break; case 'CFB8': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB8); + self::$CRYPT[$key] = new $CLASS('cfb8'); break; case 'OFB': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_OFB); + self::$CRYPT[$key] = new $CLASS('ofb'); break; case 'GCM': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_GCM); + self::$CRYPT[$key] = new $CLASS('gcm'); break; case 'STREAM': - self::$CRYPT[$key] = new $CLASS($CLASS::MODE_STREAM); + self::$CRYPT[$key] = new $CLASS('stream'); break; default: // No valid mode has been specified @@ -3848,7 +3848,7 @@ abstract class ComponentbuilderHelper } else { - // set the + // set the default self::$CRYPT[$key] = new $CLASS(); } // return the object @@ -3958,7 +3958,7 @@ abstract class ComponentbuilderHelper // make sure we have the composer classes loaded self::composerAutoload('phpseclib'); // make sure we have the phpseclib classes - if (!class_exists('\phpseclib\Net\SFTP')) + if (!class_exists('\phpseclib3\Net\SFTP')) { // class not in place so send out error JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error'); @@ -3967,7 +3967,7 @@ abstract class ComponentbuilderHelper // insure the port is set $server->port = (isset($server->port) && is_numeric($server->port) && $server->port > 0) ? (int) $server->port : 22; // open the connection - self::$sftp[$server->cache] = new phpseclib\Net\SFTP($server->host, $server->port); + self::$sftp[$server->cache] = new phpseclib3\Net\SFTP($server->host, $server->port); // heads-up on protocol self::$sftp[$server->cache]->jcb_protocol = 2; // SFTP <-- if called not knowing what type of protocol is being used // now login based on authentication type diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 5bb7f2ecc..17be2d5fc 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -8011,13 +8011,29 @@ COM_COMPONENTBUILDER_POWERS_N_ITEMS_UNPUBLISHED_1="%s Power unpublished." COM_COMPONENTBUILDER_POWERS_SUBMENU="Powers Submenu" COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power" COM_COMPONENTBUILDER_POWER_ABSTRACT_CLASS="abstract class" +COM_COMPONENTBUILDER_POWER_ACCESS_POINT_DESCRIPTION="Library path to the autoload.php file" +COM_COMPONENTBUILDER_POWER_ACCESS_POINT_HINT="custom_folder/vendor/autoload.php (must be in the .../public_html/library/ folder of Joomla)" +COM_COMPONENTBUILDER_POWER_ACCESS_POINT_LABEL="Access Point" +COM_COMPONENTBUILDER_POWER_ACCESS_POINT_MESSAGE="Error! Please add autoload full path here." COM_COMPONENTBUILDER_POWER_ADD_HEAD_DESCRIPTION="You can add your own custom header script, combined with the default header script that make the extended class work." COM_COMPONENTBUILDER_POWER_ADD_HEAD_LABEL="Add Custom Class Header" COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION="The option to override the licensing template." COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL="Add Licensing Template" COM_COMPONENTBUILDER_POWER_AS_LABEL="as" +COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_DESCRIPTION="

Once you have manually pulled composer classes into your own custom folder in libraries area (via composer), you can link it here.

+ +

So this feature gives you the ability to add your own custom composer set of classes to your project. Yes, you will still have to manually pull them into your own custom and unique folder into the libraries area of Joomla (on this JCB development system). But you can link it here and JCB will take care of adding it to your component.

+ +

First and most importantly (due to obvious risk of collusion), avoid pulling classes into your custom set of composer classes that are already included in the Joomla vendor folder. Those classes that Joomla loads are already available to you. To use them, just add the use Namespace; of that class to the header of this power, and the PHP auto linker will take care of the rest.

+ +

So all composer projects =>(vendor folders) has an autoload.php file that is located in the root of the vendor folder. We call this the access point to that cluster of classes. This means you will have one access point for multiple namespaces.

+ +

Due the continued risk of collusion we allow only one access point per/power. But for even more peace of mind, it is best to have only one access point per/project. Which means you should try to consolidate your custom composer additional classes (outside of the Joomla vendor folder) into one vendor folder. This will result in one access point, that you will use multiple times for various powers.

" +COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_LABEL="When to use Autoloader Composer Powers?" COM_COMPONENTBUILDER_POWER_CLASS="class" COM_COMPONENTBUILDER_POWER_CODE="Code" +COM_COMPONENTBUILDER_POWER_COMPOSER="Composer" +COM_COMPONENTBUILDER_POWER_COMPOSER_LABEL="Autoloader Composer Powers" COM_COMPONENTBUILDER_POWER_CREATED_BY_DESC="The user that created this Power." COM_COMPONENTBUILDER_POWER_CREATED_BY_LABEL="Created By" COM_COMPONENTBUILDER_POWER_CREATED_DATE_DESC="The date this Power was created." @@ -8135,7 +8151,9 @@ COM_COMPONENTBUILDER_POWER_TYPE_DESCRIPTION="The type of power being build" COM_COMPONENTBUILDER_POWER_TYPE_LABEL="Type of Power" COM_COMPONENTBUILDER_POWER_USE="Use" COM_COMPONENTBUILDER_POWER_USE_GLOBAL="Use Global" -COM_COMPONENTBUILDER_POWER_USE_LABEL="use" +COM_COMPONENTBUILDER_POWER_USE_HINT="Name\Project\ClassName" +COM_COMPONENTBUILDER_POWER_USE_LABEL="Use" +COM_COMPONENTBUILDER_POWER_USE_MESSAGE="Error! Please add namespace here." COM_COMPONENTBUILDER_POWER_USE_SELECTION_DESCRIPTION="Select namespace you want to use in your power." COM_COMPONENTBUILDER_POWER_USE_SELECTION_LABEL="Use Selection" COM_COMPONENTBUILDER_POWER_VERSION_DESC="A count of the number of times this Power has been revised." diff --git a/admin/layouts/power/composer_fullwidth.php b/admin/layouts/power/composer_fullwidth.php new file mode 100644 index 000000000..be49af6e3 --- /dev/null +++ b/admin/layouts/power/composer_fullwidth.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'autoload_composer_note', + 'composer' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 131fea076..4aaff6523 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -175,7 +175,7 @@ class ComponentbuilderModelAjax extends ListModel // we first use the new encryption // load phpseclib $opened = false; - if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael) + if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael) { // load the system password ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt'); diff --git a/admin/models/forms/power.xml b/admin/models/forms/power.xml index 573407d82..a39a81ab1 100644 --- a/admin/models/forms/power.xml +++ b/admin/models/forms/power.xml @@ -186,22 +186,6 @@ - - + + +