From 154cd5ae1ead7a32a5175197c950ea1a5a13f5b2 Mon Sep 17 00:00:00 2001 From: Georgios Papadakis Date: Fri, 19 Aug 2022 20:00:52 +0300 Subject: [PATCH 01/49] Remove specific type for adapter parameter from all installer methods --- admin/helpers/compiler/e_Interpretation.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 710054f9f..e14b1c4a9 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -29397,13 +29397,13 @@ function vdm_dkim() { . $function_name; $script .= PHP_EOL . $this->_t(1) . ' *'; $script .= PHP_EOL . $this->_t(1) - . ' * @param JAdapterInstance $adapter The object responsible for running this script'; + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; $script .= PHP_EOL . $this->_t(1) . ' *'; $script .= PHP_EOL . $this->_t(1) . ' * @return boolean True on success'; $script .= PHP_EOL . $this->_t(1) . ' */'; $script .= PHP_EOL . $this->_t(1) . 'public function ' - . $function_name . '(JAdapterInstance $adapter)'; + . $function_name . '($adapter)'; $script .= PHP_EOL . $this->_t(1) . '{'; $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $scripts); // return true @@ -29422,13 +29422,13 @@ function vdm_dkim() { $script .= PHP_EOL . $this->_t(1) . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; $script .= PHP_EOL . $this->_t(1) - . ' * @param JAdapterInstance $adapter The object responsible for running this script'; + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; $script .= PHP_EOL . $this->_t(1) . ' *'; $script .= PHP_EOL . $this->_t(1) . ' * @return boolean True on success'; $script .= PHP_EOL . $this->_t(1) . ' */'; $script .= PHP_EOL . $this->_t(1) . 'public function ' - . $function_name . '($route, JAdapterInstance $adapter)'; + . $function_name . '($route, $adapter)'; $script .= PHP_EOL . $this->_t(1) . '{'; $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( __LINE__ @@ -29475,10 +29475,10 @@ function vdm_dkim() { $script .= PHP_EOL . $this->_t(1) . ' * Constructor'; $script .= PHP_EOL . $this->_t(1) . ' *'; $script .= PHP_EOL . $this->_t(1) - . ' * @param JAdapterInstance $adapter The object responsible for running this script'; + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; $script .= PHP_EOL . $this->_t(1) . ' */'; $script .= PHP_EOL . $this->_t(1) - . 'public function __construct(JAdapterInstance $adapter)'; + . 'public function __construct($adapter)'; $script .= PHP_EOL . $this->_t(1) . '{'; $script .= PHP_EOL . $scripts; break; -- 2.45.1 From a0fda76abda7215ae28f6009586d37f7585aff95 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 20 Aug 2022 18:02:48 +0200 Subject: [PATCH 02/49] Adds getExtensionInstallClass and setInstallMethodScript to its own class. #950 --- README.md | 12 +- admin/README.txt | 12 +- admin/helpers/compiler/e_Interpretation.php | 221 ---------- admin/helpers/compiler/f_Infusion.php | 5 +- admin/models/ajax.php | 2 +- admin/sql/install.mysql.utf8.sql | 8 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 4 +- .../Extension/InstallScript.php | 388 ++++++++++++++++++ .../src/Componentbuilder/Extension/index.html | 1 + .../VDM.Joomla/src/Componentbuilder/Line.php | 40 ++ .../VDM.Joomla/src/Componentbuilder/Tab.php | 58 +++ .../src/Componentbuilder/index.html | 1 + script.php | 2 +- 14 files changed, 516 insertions(+), 244 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html diff --git a/README.md b/README.md index 8d145a9f3..3601367fb 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.4) 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.5) 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*: 9th July, 2022 -+ *Version*: 3.1.4 ++ *Last Build*: 20th August, 2022 ++ *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311349** ++ *Line count*: **311839** + *Field count*: **2002** -+ *File count*: **2050** -+ *Folder count*: **349** ++ *File count*: **2055** ++ *Folder count*: **351** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 8d145a9f3..3601367fb 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.4) 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.5) 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*: 9th July, 2022 -+ *Version*: 3.1.4 ++ *Last Build*: 20th August, 2022 ++ *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311349** ++ *Line count*: **311839** + *Field count*: **2002** -+ *File count*: **2050** -+ *Folder count*: **349** ++ *File count*: **2055** ++ *Folder count*: **351** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index e14b1c4a9..95ba6ef24 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -29271,227 +29271,6 @@ function vdm_dkim() { ); } - public function getExtensionInstallClass(&$extension) - { - // yes we are adding it - $script = PHP_EOL . '/**'; - $script .= PHP_EOL . ' * ' . $extension->official_name - . ' script file.'; - $script .= PHP_EOL . ' *'; - $script .= PHP_EOL . ' * @package ' . $extension->class_name; - $script .= PHP_EOL . ' */'; - $script .= PHP_EOL . 'class ' . $extension->installer_class_name; - $script .= PHP_EOL . '{'; - // set constructor - if (isset($extension->add_php_script_construct) - && $extension->add_php_script_construct == 1 - && StringHelper::check( - $extension->php_script_construct - )) - { - $script .= $this->setInstallMethodScript( - 'construct', $extension->php_script_construct - ); - } - // add PHP in extension install - $addScriptMethods = array('php_preflight', 'php_postflight', - 'php_method'); - $addScriptTypes = array('install', 'update', 'uninstall', - 'discover_install'); - // set some buckets for sorting - $function_install = array(); - $function_update = array(); - $function_uninstall = array(); - $has_php_preflight = false; - $function_php_preflight = array('install' => array(), - 'uninstall' => array(), - 'discover_install' => array(), - 'update' => array()); - $has_php_postflight = false; - $function_php_postflight = array('install' => array(), - 'uninstall' => array(), - 'discover_install' => array(), - 'update' => array()); - // the function sorter - foreach ($addScriptMethods as $scriptMethod) - { - foreach ($addScriptTypes as $scriptType) - { - if (isset( - $extension->{'add_' . $scriptMethod . '_' . $scriptType} - ) - && $extension->{'add_' . $scriptMethod . '_' . $scriptType} - == 1 - && StringHelper::check( - $extension->{$scriptMethod . '_' . $scriptType} - )) - { - // add to the main methods - if ('php_method' === $scriptMethod) - { - ${'function_' . $scriptType}[] - = $extension->{$scriptMethod . '_' . $scriptType}; - } - else - { - ${'function_' . $scriptMethod}[$scriptType][] - = $extension->{$scriptMethod - . '_' . $scriptType}; - ${'has_' . $scriptMethod} = true; - } - } - } - } - // now add the install script. - if (ArrayHelper::check($function_install)) - { - $script .= $this->setInstallMethodScript( - 'install', $function_install - ); - } - // now add the update script. - if (ArrayHelper::check($function_update)) - { - $script .= $this->setInstallMethodScript( - 'update', $function_update - ); - } - // now add the uninstall script. - if (ArrayHelper::check($function_uninstall)) - { - $script .= $this->setInstallMethodScript( - 'uninstall', $function_uninstall - ); - } - // now add the preflight script. - if ($has_php_preflight) - { - $script .= $this->setInstallMethodScript( - 'preflight', $function_php_preflight - ); - } - // now add the postflight script. - if ($has_php_postflight) - { - $script .= $this->setInstallMethodScript( - 'postflight', $function_php_postflight - ); - } - $script .= PHP_EOL . '}' . PHP_EOL; - - return $script; - } - - protected function setInstallMethodScript($function_name, &$scripts) - { - $script = ''; - // build function - switch ($function_name) - { - case 'install': - case 'update': - case 'uninstall': - // the main function types - $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $script .= PHP_EOL . $this->_t(1) . ' * Called on ' - . $function_name; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) - . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) - . ' * @return boolean True on success'; - $script .= PHP_EOL . $this->_t(1) . ' */'; - $script .= PHP_EOL . $this->_t(1) . 'public function ' - . $function_name . '($adapter)'; - $script .= PHP_EOL . $this->_t(1) . '{'; - $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $scripts); - // return true - if ('uninstall' !== $function_name) - { - $script .= PHP_EOL . $this->_t(2) . 'return true;'; - } - break; - case 'preflight': - case 'postflight': - // the pre/post function types - $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $script .= PHP_EOL . $this->_t(1) - . ' * Called before any type of action'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) - . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; - $script .= PHP_EOL . $this->_t(1) - . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) - . ' * @return boolean True on success'; - $script .= PHP_EOL . $this->_t(1) . ' */'; - $script .= PHP_EOL . $this->_t(1) . 'public function ' - . $function_name . '($route, $adapter)'; - $script .= PHP_EOL . $this->_t(1) . '{'; - $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( - __LINE__ - ) . ' get application'; - $script .= PHP_EOL . $this->_t(2) - . '$app = JFactory::getApplication();' . PHP_EOL; - // add the default version check (TODO) must make this dynamic - if ('preflight' === $function_name) - { - $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( - __LINE__ - ) . ' the default for both install and update'; - $script .= PHP_EOL . $this->_t(2) - . '$jversion = new JVersion();'; - $script .= PHP_EOL . $this->_t(2) - . "if (!\$jversion->isCompatible('3.8.0'))"; - $script .= PHP_EOL . $this->_t(2) . '{'; - $script .= PHP_EOL . $this->_t(3) - . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; - $script .= PHP_EOL . $this->_t(3) . 'return false;'; - $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; - } - // now add the scripts - foreach ($scripts as $route => $_script) - { - if (ArrayHelper::check($_script)) - { - // set the if and script - $script .= PHP_EOL . $this->_t(2) . "if ('" . $route - . "' === \$route)"; - $script .= PHP_EOL . $this->_t(2) . '{'; - $script .= PHP_EOL . implode( - PHP_EOL . PHP_EOL, $_script - ); - $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; - } - } - // return true - $script .= PHP_EOL . $this->_t(2) . 'return true;'; - break; - case 'construct': - // the __construct script - $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $script .= PHP_EOL . $this->_t(1) . ' * Constructor'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) - . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) . ' */'; - $script .= PHP_EOL . $this->_t(1) - . 'public function __construct($adapter)'; - $script .= PHP_EOL . $this->_t(1) . '{'; - $script .= PHP_EOL . $scripts; - break; - default: - // oops error - return ''; - } - // close the function - $script .= PHP_EOL . $this->_t(1) . '}'; - - return $script; - } - /** * check if a translation should be added * diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 88d2b1996..cd3acf537 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -19,6 +19,7 @@ use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Componentbuilder\Extension\InstallScript; /** * Infusion class @@ -2393,7 +2394,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$module->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = $this->getExtensionInstallClass($module); + = (new InstallScript($module))->get(); } // FIELDSET if (isset($module->form_files) @@ -2455,7 +2456,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$plugin->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = $this->getExtensionInstallClass($plugin); + = (new InstallScript($plugin))->get(); } // FIELDSET if (isset($plugin->form_files) diff --git a/admin/models/ajax.php b/admin/models/ajax.php index ffa98741d..86ab41226 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -392,7 +392,7 @@ class ComponentbuilderModelAjax extends ListModel else { // download link of the latest version - $download = "https://git.vdm.dev/api/v1/repos/joomla/Component-Builder/archive/" . $tags[0]->name . ".zip?access_token=" . $token; + $download = "https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/" . $tags[0]->name . ".zip?access_token=" . $token; return ['notice' => '' . JText::_('COM_COMPONENTBUILDER_OUT_OF_DATE') . '! ' . JText::_('COM_COMPONENTBUILDER_DOWNLOAD_UPDATE') . '!']; diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 9fd04d5ce..64a96020e 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1967,7 +1967,7 @@ INSERT INTO `#__componentbuilder_joomla_component` (`id`, `add_license`, `licens -- INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `extends`, `extends_custom`, `guid`, `head`, `implements`, `implements_custom`, `load_selection`, `main_class_code`, `method_selection`, `name`, `namespace`, `power_version`, `property_selection`, `system_name`, `type`, `use_selection`, `params`, `published`, `created`, `modified`, `version`, `ordering`) VALUES -(1, '', 'Basic shared utilities, a legacy implementation\r\n\r\n@since 3.0.9', '', '', '79d765b3-7319-4988-9730-446c7f347020', '', '', '', '{}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIGhhdmUgYSBzdHJpbmcgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0ICAgIHN0cmluZyAgJHN0cmluZyBUaGUgc3RyaW5nIHRvIGNoZWNrDQoJICoNCgkgKiBAcmV0dXJucyBib29sIHRydWUgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKg0KCSAqIEBkZXByZWNhdGVkICA0LjAgLSBVc2UgU3RyaW5nSGVscGVyOjpjaGVjaygkc3RyaW5nKTsNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGNoZWNrU3RyaW5nKCRzdHJpbmcpOiBib29sDQoJew0KCQlyZXR1cm4gU3RyaW5nSGVscGVyOjpjaGVjaygkc3RyaW5nKTsNCgl9DQoNCgkvKioNCgkgKiBTaG9ydGVuIGEgc3RyaW5nDQoJICoNCgkgKiBAaW5wdXQgICAgc3RyaW5nICAkc3RyaW5nIFRoYXQgeW91IHdvdWxkIGxpa2UgdG8gc2hvcnRlbg0KCSAqDQoJICogQHJldHVybnMgc3RyaW5nIG9uIHN1Y2Nlc3MNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICoNCgkgKiBAZGVwcmVjYXRlZCAgNC4wIC0gVXNlIFN0cmluZ0hlbHBlcjo6c2hvcnRlbigkc3RyaW5nLCAkbGVuZ3RoLCAkYWRkVGlwKTsNCgkgKi8NCglwdWJsaWMgc3Rhd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jYXRlZCAgNC4wIC0gVXNlIEZpbGVIZWxwZXI6OmV4aXN0cygkcGF0aCk7DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiB1cmxFeGlzdHMoJHBhdGgpDQoJew0KCQlyZXR1cm4gRmlsZUhlbHBlcjo6ZXhpc3RzKCRwYXRoKTsNCgl9DQoNCgkvKioNCgkgKiBTZXQgdGhlIGNvbXBvbmVudCBvcHRpb24NCgkgKg0KCSAqIEBwYXJhbSAgIFN0cmluZ3xudWxsICAgICAgICRvcHRpb24gICAgVGhlIG9wdGlvbiBmb3IgdGhlIGNvbXBvbmVudC4NCgkgKg0KCSAqIEBzaW5jZSAgMy4wLjExDQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBzZXRDb21wb25lbnRPcHRpb24oJG9wdGlvbiA9IG51bGwpDQoJew0KCQkvLyBzZXQgdGhlIGxvY2FsIGNvbXBvbmVudCBvcHRpb24NCgkJaWYgKGVtcHR5KCRvcHRpb24pKQ0KCQl7DQoJCQlpZiAoZW1wdHkoSGVscGVyOjokb3B0aW9uKSAmJiBwcm9wZXJ0eV9leGlzdHMoX19DTEFTU19fLCAnQ29tcG9uZW50Q29kZU5hbWUnKSkNCgkJCXsNCgkJCQlIZWxwZXI6OiRvcHRpb24gPSAnY29tXycgLiBzZWxmOjokQ29tcG9uZW50Q29kZU5hbWU7DQoJCQl9DQoJCX0NCgkJZWxzZQ0KCQl7DQoJCQlIZWxwZXI6OiRvcHRpb24gPSAkb3B0aW9uOw0KCQl9DQoJfQ0K', '{}', 'Utilities', 'VDM\\Joomla\\Utilities', '1.0.0', '{}', 'Utilities', 'trait', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"91004529-94a9-4590-b842-e7c6b624ecf5\",\"as\":\"default\"},\"use_selection4\":{\"use\":\"152c8793-8b75-4715-996a-257b9f65451c\",\"as\":\"default\"},\"use_selection5\":{\"use\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\",\"as\":\"default\"},\"use_selection6\":{\"use\":\"9c513baf-b279-43fd-ae29-a585c8cbc4f0\",\"as\":\"default\"},\"use_selection7\":{\"use\":\"a223b31e-ea1d-4cdf-92ae-5f9becffaff0\",\"as\":\"default\"},\"use_selection8\":{\"use\":\"9ef0eb24-aae4-4f5a-99af-d724db44808f\",\"as\":\"default\"},\"use_selection9\":{\"use\":\"a8935cbe-7701-40dc-bfd5-675f2d600954\",\"as\":\"default\"},\"use_selection10\":{\"use\":\"30c5b4c2-f75f-4d15-869a-f8bfedd87358\",\"as\":\"default\"},\"use_selection11\":{\"use\":\"ce8cf834-6bac-44fb-941c-861f7e046cc0\",\"as\":\"default\"},\"use_selection12\":{\"use\":\"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6\",\"as\":\"default\"},\"use_selection13\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2021-11-06 13:25:19', '2022-06-07 13:29:51', 69, 1), +(1, '', 'Basic shared utilities, a legacy implementation\r\n\r\n@since 3.0.9', '', '', '79d765b3-7319-4988-9730-446c7f347020', '', '', '', '{\"load_selection0\":{\"load\":\"1d929017-a5de-4e0f-9b5a-838934857e26\"}}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIGhhdmUgYSBzdHJpbmcgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0ICA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SAgMy4wLjExDQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBzZXRDb21wb25lbnRPcHRpb24oJG9wdGlvbiA9IG51bGwpDQoJew0KCQkvLyBzZXQgdGhlIGxvY2FsIGNvbXBvbmVudCBvcHRpb24NCgkJaWYgKGVtcHR5KCRvcHRpb24pKQ0KCQl7DQoJCQlpZiAoZW1wdHkoSGVscGVyOjokb3B0aW9uKSAmJiBwcm9wZXJ0eV9leGlzdHMoX19DTEFTU19fLCAnQ29tcG9uZW50Q29kZU5hbWUnKSkNCgkJCXsNCgkJCQlIZWxwZXI6OiRvcHRpb24gPSAnY29tXycgLiBzZWxmOjokQ29tcG9uZW50Q29kZU5hbWU7DQoJCQl9DQoJCX0NCgkJZWxzZQ0KCQl7DQoJCQlIZWxwZXI6OiRvcHRpb24gPSAkb3B0aW9uOw0KCQl9DQoJfQ0K', '{}', 'Utilities', 'VDM\\Joomla\\Utilities', '1.0.0', '{}', 'Utilities', 'trait', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"91004529-94a9-4590-b842-e7c6b624ecf5\",\"as\":\"default\"},\"use_selection4\":{\"use\":\"152c8793-8b75-4715-996a-257b9f65451c\",\"as\":\"default\"},\"use_selection5\":{\"use\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\",\"as\":\"default\"},\"use_selection6\":{\"use\":\"9c513baf-b279-43fd-ae29-a585c8cbc4f0\",\"as\":\"default\"},\"use_selection7\":{\"use\":\"a223b31e-ea1d-4cdf-92ae-5f9becffaff0\",\"as\":\"default\"},\"use_selection8\":{\"use\":\"9ef0eb24-aae4-4f5a-99af-d724db44808f\",\"as\":\"default\"},\"use_selection9\":{\"use\":\"a8935cbe-7701-40dc-bfd5-675f2d600954\",\"as\":\"default\"},\"use_selection10\":{\"use\":\"30c5b4c2-f75f-4d15-869a-f8bfedd87358\",\"as\":\"default\"},\"use_selection11\":{\"use\":\"ce8cf834-6bac-44fb-941c-861f7e046cc0\",\"as\":\"default\"},\"use_selection12\":{\"use\":\"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6\",\"as\":\"default\"},\"use_selection13\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2021-11-06 13:25:19', '2022-08-20 15:18:05', 70, 1), (2, 1, 'To extrude tables structures from lila', '', '', '050f5a27-3aab-4087-8a3d-e2302fcfd5db', 'dXNlIERpcmVjdG9yeUl0ZXJhdG9yOw0KdXNlIFNwbEZpbGVPYmplY3Q7DQp1c2Ugc3RkQ2xhc3M7DQp1c2UgZnVuY3Rpb24gYXJyYXlfcG9wOw0KdXNlIGZ1bmN0aW9uIGNvdW50Ow0KdXNlIGZ1bmN0aW9uIGV4cGxvZGU7DQp1c2UgZnVuY3Rpb24gZmlsZV9leGlzdHM7DQp1c2UgZnVuY3Rpb24gaXNfbnVsbDsNCnVzZSBmdW5jdGlvbiBhcnJheV9yZXZlcnNlOw0KdXNlIGZ1bmN0aW9uIHN0cl9yZXBsYWNlOw0KdXNlIGZ1bmN0aW9uIHN0cmxlbjsNCnVzZSBmdW5jdGlvbiBzdHJwb3M7DQp1c2UgZnVuY3Rpb24gc3RycnBvczsNCnVzZSBmdW5jdGlvbiBzdWJzdHI7DQp1c2UgZnVuY3Rpb24gdHJpbTsNCg==', '', '', '', 'CS8qKg0KCSAqIEFkZGluZyB0aGUgdXRpbGl0aWVzIHRyYWl0IHRvIHRoaXMgY2xhc3MNCgkgKiBTaW5jZSB3ZSBuZWVkIHNvbWUgb2YgaXRzIGZ1bmN0aW9ucw0KCSAqLw0KCXVzZSBVdGlsOw0KDQoJLyoqDQoJICogVGhlIG1vZHVsZSBuYW1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m9yY2Ugd2F5DQoJCWZvcmVhY2ggKCR0aGlzLT50YWJsZXMgYXMgJG1vZCA9PiAkbW9kcykNCgkJew0KCQkJaWYgKGlzc2V0KCRtb2RzWyR0YWJsZV0pKQ0KCQkJew0KCQkJCXJldHVybiAkbW9kOw0KCQkJfQ0KCQl9DQoNCgkJcmV0dXJuIGZhbHNlOw0KCX0NCg==', '{}', 'ExtrudeTables', '[[[COMPANY]]]\\[[[Component]]]\\ExtrudeTables', '1.0.0', '{}', 'Lila Extrude Tables', 'class', '{\"use_selection0\":{\"use\":\"79d765b3-7319-4988-9730-446c7f347020\"}}', '', 1, '2021-11-06 14:28:17', '2021-11-13 16:34:22', 33, 2), (3, '', '', '', '', '7e6e7fe8-725d-411e-889a-4f1618c11840', '', '', '', '', 'Ly8gaGVscA==', '{}', 'TestingInterface', '[[[Component]]]\\Power\\TestingInterface', '1.0.0', '{}', 'Testing Interface', 'interface', '{}', '', 1, '2021-11-07 15:54:41', '2021-11-09 04:37:44', 7, 3), (4, '', 'To store tables structures from lila', '', '', 'c4469632-3914-400e-b861-972b2d463963', '', '', '', '', 'CS8qKg0KCSAqIEFkZGluZyB0aGUgdXRpbGl0aWVzIHRyYWl0IHRvIHRoaXMgY2xhc3MNCgkgKiBTaW5jZSB3ZSBuZWVkIHNvbWUgb2YgaXRzIGZ1bmN0aW9ucw0KCSAqLw0KCXVzZSBVdGlsOw0KDQoJLyoqDQoJICogVGhlIGRhdGENCgkgKg0KCSAqIEB2YXIgRXh0cnVkZQ0KCSAqLw0KCXByb3RlY3RlZCAkZGF0YTsNCg0KCS8qKg0KCSAqIENvbnN0cnVjdG9yDQoJICoNCgkgKiBAcGFyYW0gICBFeHRydWRlICAkZGF0YSAgVGhlIGV4dHJ1ZGVkIGRhdGENCgkgKi8NCglwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoRXh0cnVkZVRhYmxlcyAkZGF0YSkNCgl7DQoJCSR0aGlzLT5kYXRhID0gJGRhdGE7DQo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0KCQl9DQoJCS8vIHJldHVybiBhbGwgb24gbnVsbCBhcmVhDQoJCXJldHVybiAkcGFyYW1zOw0KCX0NCg==', '{}', 'StoreTables', '[[[COMPANY]]]\\[[[Component]]]\\StoreTables', '1.0.0', '{}', 'Lila Store Tables', 'class', '{\"use_selection0\":{\"use\":\"79d765b3-7319-4988-9730-446c7f347020\"}}', '', 1, '2021-11-13 17:52:23', '2021-11-13 22:21:46', 14, 2), @@ -1995,7 +1995,11 @@ INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `exten (26, '', 'Mime Helper\r\n\r\n@since 3.0.11', '', '', 'f11dc790-713e-4706-9a85-a318ed3ad56e', '', '', '', '{}', 'W0VYVEVSTkFMQ09ERT1odHRwczovL2dpc3QuZ2l0aHVidXNlcmNvbnRlbnQuY29tL0xsZXdlbGx5bnZkbS83NGJlMzczMzU3ZTEzMWI4Nzc1YTc1ODJjM2RlNTA4Yi9yYXcvbWltZV90eXBlcy5waHBdDQoNCltFWFRFUk5BTENPREU9aHR0cHM6Ly9naXN0LmdpdGh1YnVzZXJjb250ZW50LmNvbS9MbGV3ZWxseW52ZG0vNzRiZTM3MzM1N2UxMzFiODc3NWE3NTgyYzNkZTUwOGIvcmF3L2dldC5waHBdDQoNCltFWFRFUk5BTENPREU9aHR0cHM6Ly9naXN0LmdpdGh1YnVzZXJjb250ZW50LmNvbS9MbGV3ZWxseW52ZG0vNzRiZTM3MzM1N2UxMzFiODc3NWE3NTgyYzNkZTUwOGIvcmF3L2V4dGVuc2lvbnMucGhwXQ==', '{}', 'MimeHelper', 'VDM\\Joomla\\Utilities.MimeHelper', '1.0.0', '{}', 'Utilities MimeHelper', 'abstract class', '{}', '', 1, '2022-05-16 14:27:38', '2022-05-21 13:27:39', 3, 9), (27, '', 'Just to link powers to the power updater component', '', '', '8025e71c-8e21-44cb-b23e-dce2fb5a1ab5', '', '', '', '{\"load_selection0\":{\"load\":\"db4a1e4d-be59-4e87-8b4d-c40512752232\"},\"load_selection1\":{\"load\":\"79d765b3-7319-4988-9730-446c7f347020\"},\"load_selection2\":{\"load\":\"d7600b43-771a-4747-9f5d-952765721799\"},\"load_selection3\":{\"load\":\"962b15d8-915f-4cd7-aea6-7cf82afdc20b\"},\"load_selection4\":{\"load\":\"f11dc790-713e-4706-9a85-a318ed3ad56e\"}}', '', '{}', 'Updater', 'VDM\\Powe\\Updater', '1.0.0', '{}', 'Power Updater', 'class', '{}', '', 1, '2022-05-21 13:15:55', '2022-06-11 16:54:51', 3, 13), (28, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoGetContents', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', 'ef011ee1-64f0-4048-b013-777473b727dd', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldHMgdGhlIG1ldGFkYXRhIGFuZCBjb250ZW50cyAoaWYgYSBmaWxlKSBvZiBhbiBlbnRyeSBpbiBhIHJlcG9zaXRvcnksIG9yIGEgbGlzdCBvZiBlbnRyaWVzIGlmIGEgZGlyDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICBSZXBvc2l0b3J5IG93bmVyLg0KCSAqIEBwYXJhbSAgIHN0cmluZyAgJHJlcG8gICAgICAgICBSZXBvc2l0b3J5IG5hbWUuDQoJICogQHBhcmFtICAgc3RyaW5nICAkZmlsZXBhdGggICAgUmVwb3NpdG9yeSBmaWxlIHBhdGguDQoJICoNCgkgKiBAcmV0dXJuICBvYmplY3QNCgkgKg0KCSAqIEBzaW5jZSAgIDEuMA0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiBnZXQoJG93bmVyLCAkcmVwbywgJGZpbGVwYXRoKQ0KCXsNCgkJLy8gQnVpbGQgdGhlIHJlcXVlc3QgcGF0aC4NCgkJJHBhdGggPSAnL3JlcG9zLycgLiAkb3duZXIgLiAnLycgLiAkcmVwbyAuICcvY29udGVudHMvJyAuICRmaWxlcGF0aDsNCg0KCQkvLyBTZW5kIHRoZSByZXF1ZXN0Lg0KCQlyZXR1cm4gJHRoaXMtPnByb2Nlc3NSZXNwb25zZSgNCgkJCSR0aGlzLT5jbGllbnQtPmdldCgkdGhpcy0+ZmV0Y2hVcmwoJHBhdGgpKQ0KCQkpOw0KCX0NCg==', '{}', 'File', 'VDM\\Gitea\\Package.Repo.File', '1.0.0', '{}', 'Gitea Repo File', 'class', '{}', '', 1, '2022-05-21 13:40:09', '2022-07-09 10:28:20', 10, 4), -(29, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoCreateWikiPage', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', 'c4a188de-ad78-4a6d-9d5b-01866846d701', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldCBhIHJlcG9zaXRvcnkgd2lraSBwYWdlDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICAgICAgICAgIFRoZSByZXBvc2l0b3J5IG93bmVyDQoJICogQHBhcmFtICAgc3RyaW5nICAkcmVwbyAgICAgICAgICAgICAgICAgVGhlIHJlcG9zaXRvcnkgbmFtZQ0KCSAqIEBwYXJhbSAgIHN0cmluZyAgJHBhZ2VOYW1lICAgICAgIFRoZSBwYWdlIG5hbWUNCgkgKg0KCSAqIEByZXR1cm4gIG9iamVjdA0KCSAqDQoJICogQHNpbmNlICAgMS4wDQoJICovDQoJcHVibGljIGZ1bmN0aW9uIGdldChzdHJpbmcgJG93bmVyLCBzdHJpbmcgJHJlcG8sIHN0cmluZyAkcGFnZU5hbWUpDQoJew0KCQkvLyBCdWlsZCB0aGUgcmVxdWVzdCBwYXRoLg0KCQkkcGF0aCA9ICcvcmVwb3MvJyAuICRvd25lciAuICcvJyAuIC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50LT5nZXRPcHRpb24oJ2hlYWRlcnMnLCBhcnJheSgpKTsNCg0KCQkkaGVhZGVyc1snYWNjZXB0J10gPSAndGV4dC9odG1sJzsNCgkJJGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gJ2FwcGxpY2F0aW9uL2pzb24nOw0KDQoJCS8vIGJ1aWxkIHRoZSBwb3N0IGJvZHkNCgkJJGRhdGEgPSBbDQoJCQknQ29udGV4dCcgPT4gJ3N0cmluZycsDQoJCQknTW9kZScgPT4gJ3N0cmluZycsDQoJCQknVGV4dCcgPT4gJHBhZ2UtPmNvbnRlbnQsDQoJCQknV2lraScgPT4gdHJ1ZQ0KCQldOw0KDQoJCS8vIFBvc3QgdGhlIHJlcXVlc3QuDQoJCXJldHVybiAkdGhpcy0+cHJvY2Vzc1Jlc3BvbnNlKA0KCQkJJHRoaXMtPmNsaWVudC0+cG9zdCgkdGhpcy0+ZmV0Y2hVcmwoJHBhdGgpLCBqc29uX2VuY29kZSgkZGF0YSksICRoZWFkZXJzKQ0KCQkpOw0KCX0NCg==', '{}', 'Wiki', 'VDM\\Gitea\\Package.Repo.Wiki', '1.0.0', '{}', 'Gitea Repo Wiki', 'class', '{}', '', 1, '2022-07-09 10:21:53', '2022-07-09 12:18:07', 9, 4); +(29, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoCreateWikiPage', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', 'c4a188de-ad78-4a6d-9d5b-01866846d701', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldCBhIHJlcG9zaXRvcnkgd2lraSBwYWdlDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICAgICAgICAgIFRoZSByZXBvc2l0b3J5IG93bmVyDQoJICogQHBhcmFtICAgc3RyaW5nICAkcmVwbyAgICAgICAgIC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://git.vdm.dev/api/swagger#/repository/repoGetContents', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', '6ad3beb1-a769-4a6c-b300-5cda7adc6c0d', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldHMgdGhlIG1ldGFkYXRhIGFuZCBjb250ZW50cyAoaWYgYSBmaWxlKSBvZiBhbiBlbnRyeSBpbiBhIHJlcG9zaXRvcnksIG9yIGEgbGlzdCBvZiBlbnRyaWVzIGlmIGEgZGlyDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICBSZXBvc2l0b3J5IG93bmVyLg0KCSAqIEBwYXJhbSAgIHN0cmluZyAgJHJlcG8gICAgICAgICBSZXBvc2l0b3J5IG5hbWUuDQoJICogQHBhcmFtICAgc3RyaW5nICAkZmlsZXBhdGggICAgUmVwb3NpdG9yeSBmaWxlIHBhdGguDQoJICoNCgkgKiBAcmV0dXJuICBvYmplY3QNCgkgKg0KCSAqIEBzaW5jZSAgIDEuMA0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiBnZXQoJG93bmVyLCAkcmVwbywgJGZpbGVwYXRoKQ0KCXsNCgkJLy8gQnVpbGQgdGhlIHJlcXVlc3QgcGF0aC4NCgkJJHBhdGggPSAnL3JlcG9zLycgLiAkb3duZXIgLiAnLycgLiAkcmVwbyAuICcvY29udGVudHMvJyAuICRmaWxlcGF0aDsNCg0KCQkvLyBTZW5kIHRoZSByZXF1ZXN0Lg0KCQlyZXR1cm4gJHRoaXMtPnByb2Nlc3NSZXNwb25zZSgNCgkJCSR0aGlzLT5jbGllbnQtPmdldCgkdGhpcy0+ZmV0Y2hVcmwoJHBhdGgpKQ0KCQkpOw0KCX0NCg==', '{}', 'File', 'VDM\\Gitea\\Package.Repo.File', '1.0.1', '{}', 'Gitea Repo File', 'class', '{}', '', -2, '2022-07-11 18:35:50', '2022-07-09 10:28:20', 1, 4), +(31, '', 'Loading the Extension Installation Script Class\r\n\r\n@since 3.1.5', '', '', '1d929017-a5de-4e0f-9b5a-838934857e26', '', '', '', '{}', 'CS8qKg0KCSAqIFRoZSBMaW5lIG51bWJlcmluZyBNZXRob2RzDQoJICoNCgkgKiBAc2luY2UgMy4xLjUNCgkgKi8NCgl1c2UgTGluZTsNCg0KCS8qKg0KCSAqIFRoZSBUYWIgQWRkaW5nIE1ldGhvZA0KCSAqDQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJdXNlIFRhYjsNCg0KCS8qKg0KCSAqIFRoZSBleHRlbnNpb24NCgkgKg0KCSAqIEB2YXIgICAgIG9iamVjdA0KCSAqIEBzaW5jZSAzLjEuNQ0KCSAqLw0KCXByb3RlY3RlZCBvYmplY3QgJGV4dGVuc2lvbjsNCg0KCS8qKg0KCSAqIFRoZSBtZXRob2RzDQoJICoNCgkgKiBAdmFyICAgICBhcnJheQ0KCSAqIEBzaW5jZSAzLjEuNQ0KCSAqLw0KCXByb3RlY3RlZCBhcnJheSAkbWV0aG9kcyA9IFsncGhwX3NjcmlwdCcsICdwaHBfcHJlZmxpZ2h0JywgJ3BocF9wb3N0ZmxpZ2h0JywgJ3BocF9tZXRob2QnXTsNCg0KCS8qKg0KCSAqIFRoZSB0eXBlcw0KCSAqDQoJICogQHZhciAgICAgYXJyYXkNCgkgKiBAc2luY2UgMy4xLjUNCgkgKi8NCglwcm90ZWN0ZWQgYXJyYXkgJHR5cGVzID0gWydjb25zdHJ1Y3QnLCAnaW5zdGFsbCcsICd1cGRhdGUnLCAndW5pbnN0YWxsJywgJ2Rpc2NvdmVyX2luc3RhbGwnXTsNCg0KCS8qKg0KCSAqIFRoZSBjb25zdHJ1Y3QgYnVja2V0DQoJICoNCgkgKiBAdmFyICAgICBhcnJheQ0KCSAqIEBzaW5jZSAzLjEuNQ0KCSAqLw0KCXByb3RlY3RlZCBhcnJheSAkY29uc3RydWN0ID0gW107DQ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KCQkJCQkpOw0KCQkJCSRzY3JpcHQgLj0gUEhQX0VPTCAuICR0aGlzLT5fdCgyKSAuICd9JyAuIFBIUF9FT0w7DQoJCQl9DQoJCX0NCg0KCQkvLyByZXR1cm4gdHJ1ZQ0KCQkkc2NyaXB0IC49IFBIUF9FT0wgLiAkdGhpcy0+X3QoMikgLiAncmV0dXJuIHRydWU7JzsNCgkJLy8gY2xvc2UgdGhlIGZ1bmN0aW9uDQoJCSRzY3JpcHQgLj0gUEhQX0VPTCAuICR0aGlzLT5fdCgxKSAuICd9JzsNCg0KCQlyZXR1cm4gJHNjcmlwdDsNCgl9', '{}', 'InstallScript', 'VDM\\Joomla\\Componentbuilder.Extension.InstallScript', '1.0.0', '{}', 'Componentbuilder.Extension.Install', 'class', '{\"use_selection0\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"4e6ff11d-bebf-42f5-8fd7-b2f882857222\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"a68c010b-e92e-47d5-8a44-d23cfddeb6c6\",\"as\":\"default\"}}', '', 1, '2022-08-20 13:45:05', '2022-08-20 15:47:55', 10, 14), +(32, '', 'Adds Tabs\r\n\r\n@since 3.1.5', '', '', 'a68c010b-e92e-47d5-8a44-d23cfddeb6c6', '', '', '', '{}', 'CS8qKg0KCSAqIFRhYi9zcGFjZXIgYnVja2V0ICh0byBzcGVlZC11cCB0aGUgYnVpbGQpDQoJICogDQoJICogQHZhciAgIGFycmF5DQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJcHJvdGVjdGVkICR0YWJTcGFjZXJCdWNrZXQgPSBhcnJheSgpOw0KDQoJLyoqDQoJICogU2V0IHRhYi9zcGFjZXINCgkgKiANCgkgKiBAdmFyICAgc3RyaW5nDQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJcHJvdGVjdGVkICR0YWJTcGFjZXIgPSAiXHQiOw0KDQoJLyoqDQoJICogU2V0IHRoZSB0YWIvc3BhY2UNCgkgKiANCgkgKiBAcGFyYW0gICBpbnQgICAkbnIgIFRoZSBudW1iZXIgb2YgdGFnL3NwYWNlDQoJICogDQoJICogQHJldHVybiAgc3RyaW5nDQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJcHVibGljIGZ1bmN0aW9uIF90KGludCAkbnIpIDogc3RyaW5nDQoJew0KCQkvLyBjaGVjayBpZiB3ZSBhbHJlYWR5IGhhdmUgdGhlIHN0cmluZw0KCQlpZiAoIWlzc2V0KCR0aGlzLT50YWJTcGFjZXJCdWNrZXRbJG5yXSkpDQoJCXsNCgkJCS8vIGdldCB0aGUgc3RyaW5nDQoJCQkkdGhpcy0+dGFiU3BhY2VyQnVja2V0WyRucl0gPSBzdHJfcmVwZWF0KCR0aGlzLT50YWJTcGFjZXIsIChpbnQpICRucik7DQoJCX0NCgkJLy8gcmV0dXJuIHN0b3JlZCBzdHJpbmcNCgkJcmV0dXJuICR0aGlzLT50YWJTcGFjZXJCdWNrZXRbJG5yXTsNCgl9', '{}', 'Tab', 'VDM\\Joomla\\Componentbuilder.Tab', '1.0.0', '{}', 'Componentbuilder.Tab', 'trait', '{}', '', 1, '2022-08-20 13:55:50', '2022-08-20 15:26:46', 5, 15), +(33, '', 'Add line comment\r\n\r\n@since 3.1.5', '', '', '4e6ff11d-bebf-42f5-8fd7-b2f882857222', '', '', '', '{}', 'CS8qKg0KCSAqIFNldCB0aGUgbGluZSBudW1iZXIgaW4gY29tbWVudHMNCgkgKg0KCSAqIEBwYXJhbSAgIGludCAgJG5yICBUaGUgbGluZSBudW1iZXINCgkgKg0KCSAqIEByZXR1cm4gIHN0cmluZw0KCSAqIEBzaW5jZSAzLjEuNQ0KCSAqLw0KCXByaXZhdGUgZnVuY3Rpb24gc2V0TGluZShpbnQgJG5yKTogc3RyaW5nDQoJew0KCQlpZiAoJHRoaXMtPmRlYnVnKQ0KCQl7DQoJCQlyZXR1cm4gJyBbJyAuIGdldF9jYWxsZWRfY2xhc3MoKSAuICcgJyAuICRuciAuICddJzsNCgkJfQ0KDQoJCXJldHVybiAnJzsNCgl9', '{}', 'Line', 'VDM\\Joomla\\Componentbuilder.Line', '1.0.0', '{}', 'Componentbuilder.Line', 'trait', '{}', '', 1, '2022-08-20 14:02:09', '2022-08-20 15:26:56', 4, 15); -- -- Dumping data for table `#__componentbuilder_admin_view` diff --git a/componentbuilder.xml b/componentbuilder.xml index 46eecc7b9..0f9ee68f5 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 9th July, 2022 + 20th August, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 3.1.4 + 3.1.5 Component Builder (v.3.1.4) +

Component Builder (v.3.1.5)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 2cd47afe7..afff5d7f6 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -1079,10 +1079,10 @@ pkg_component_builder package site - 3.1.4 + 3.1.5 https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.4.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.5.zip stable diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php new file mode 100644 index 000000000..0c72523fd --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php @@ -0,0 +1,388 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Extension; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Line; +use VDM\Joomla\Componentbuilder\Tab; + + +/** + * Loading the Extension Installation Script Class + * + * @since 3.1.5 + */ +class InstallScript +{ + /** + * The Line numbering Methods + * + * @since 3.1.5 + */ + use Line; + + /** + * The Tab Adding Method + * + * @since 3.1.5 + */ + use Tab; + + /** + * The extension + * + * @var object + * @since 3.1.5 + */ + protected object $extension; + + /** + * The methods + * + * @var array + * @since 3.1.5 + */ + protected array $methods = ['php_script', 'php_preflight', 'php_postflight', 'php_method']; + + /** + * The types + * + * @var array + * @since 3.1.5 + */ + protected array $types = ['construct', 'install', 'update', 'uninstall', 'discover_install']; + + /** + * The construct bucket + * + * @var array + * @since 3.1.5 + */ + protected array $construct = []; + + /** + * The install bucket + * + * @var array + * @since 3.1.5 + */ + protected array $install = []; + + /** + * The update bucket + * + * @var array + * @since 3.1.5 + */ + protected array $update = []; + + /** + * The uninstall bucket + * + * @var array + * @since 3.1.5 + */ + protected array $uninstall = []; + + /** + * The preflight switch + * + * @var bool + * @since 3.1.5 + */ + protected bool $preflightActive = false; + + /** + * The preflight bucket + * + * @var array + * @since 3.1.5 + */ + protected array $preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * The postflight switch + * + * @var bool + * @since 3.1.5 + */ + protected bool $postflightActive = false; + + /** + * The postflight bucket + * + * @var array + * @since 3.1.5 + */ + protected array $postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; + + /** + * Constructor + * @since 3.1.5 + */ + public function __construct(object $extension) + { + // loop over methods and types + foreach ($this->methods as $method) + { + foreach ($this->types as $type) + { + if (isset($extension->{'add_' . $method . '_' . $type}) + && $extension->{'add_' . $method . '_' . $type} == 1 + && StringHelper::check( + $extension->{$method . '_' . $type} + )) + { + // add to the main methods + if ('php_method' === $method || 'php_script' === $method) + { + $this->{$type}[] = $extension->{$method . '_' . $type}; + } + else + { + // get the flight key + $flight = str_replace('php_', '', $method); + // load the script to our bucket + $this->{$flight . 'Bucket'}[$type][] = $extension->{$method . '_' . $type}; + // show that the method is active + $this->{$flight . 'Active'} = true; + } + } + } + } + + $this->extension = $extension; + } + + /** + * get install script + * + * @return string + * @since 3.1.5 + */ + public function get(): string + { + // return the class + return $this->build(); + } + + /** + * build the install class + * + * @return string + * @since 3.1.5 + */ + protected function build(): string + { + // start build + $script = $this->head(); + + // load constructor if set + $script .= $this->construct(); + + // load install method if set + $script .= $this->main('install'); + + // load update method if set + $script .= $this->main('update'); + + // load uninstall method if set + $script .= $this->main('uninstall'); + + // load preflight method if set + $script .= $this->flight('preflight'); + + // load postflight method if set + $script .= $this->flight('postflight'); + + // close the class + $script .= PHP_EOL . '}' . PHP_EOL; + + return $script; + } + + /** + * get install script head + * + * @return string + * @since 3.1.5 + */ + protected function head(): string + { + // get the extension + $extension = $this->extension; + // start build + $script = PHP_EOL . '/**'; + $script .= PHP_EOL . ' * ' . $extension->official_name + . ' script file.'; + $script .= PHP_EOL . ' *'; + $script .= PHP_EOL . ' * @package ' . $extension->class_name; + $script .= PHP_EOL . ' */'; + $script .= PHP_EOL . 'class ' . $extension->installer_class_name; + $script .= PHP_EOL . '{'; + + return $script; + } + + /** + * get constructor + * + * @return string + * @since 3.1.5 + */ + protected function construct(): string + { + // return empty string if not set + if (!ArrayHelper::check($this->construct)) + { + return ''; + } + + // the __construct script + $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $script .= PHP_EOL . $this->_t(1) . ' * Constructor'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . $this->_t(1) . ' */'; + $script .= PHP_EOL . $this->_t(1) + . 'public function __construct($adapter)'; + $script .= PHP_EOL . $this->_t(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct); + // close the function + $script .= PHP_EOL . $this->_t(1) . '}'; + + return $script; + } + + /** + * build main methods + * + * @param string $name the method being called + * + * @return string + * @since 3.1.5 + */ + protected function main(string $name): string + { + // return empty string if not set + if (!ArrayHelper::check($this->{$name})) + { + return ''; + } + // load the install method + $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $script .= PHP_EOL . $this->_t(1) . " * Called on $name"; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . $this->_t(1) . ' */'; + $script .= PHP_EOL . $this->_t(1) . 'public function ' + . $name . '($adapter)'; + $script .= PHP_EOL . $this->_t(1) . '{'; + $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name}); + // return true + if ('uninstall' !== $name) + { + $script .= PHP_EOL . $this->_t(2) . 'return true;'; + } + // close the function + $script .= PHP_EOL . $this->_t(1) . '}'; + + return $script; + } + + /** + * build flight methods + * + * @param string $name the method being called + * + * @return string + * @since 3.1.5 + */ + protected function flight(string $name): string + { + // return empty string if not set + if (empty($this->{$name . 'Active'})) + { + return ''; + } + + // the pre/post function types + $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $script .= PHP_EOL . $this->_t(1) + . ' * Called before any type of action'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . $this->_t(1) . ' */'; + $script .= PHP_EOL . $this->_t(1) . 'public function ' + . $name . '($route, $adapter)'; + $script .= PHP_EOL . $this->_t(1) . '{'; + $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( + __LINE__ + ) . ' get application'; + $script .= PHP_EOL . $this->_t(2) + . '$app = JFactory::getApplication();' . PHP_EOL; + + // add the default version check (TODO) must make this dynamic + if ('preflight' === $name) + { + $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( + __LINE__ + ) . ' the default for both install and update'; + $script .= PHP_EOL . $this->_t(2) + . '$jversion = new JVersion();'; + $script .= PHP_EOL . $this->_t(2) + . "if (!\$jversion->isCompatible('3.8.0'))"; + $script .= PHP_EOL . $this->_t(2) . '{'; + $script .= PHP_EOL . $this->_t(3) + . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; + $script .= PHP_EOL . $this->_t(3) . 'return false;'; + $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; + } + + // now add the scripts + foreach ($this->{$name . 'Bucket'} as $route => $_script) + { + if (ArrayHelper::check($_script)) + { + // set the if and script + $script .= PHP_EOL . $this->_t(2) . "if ('" . $route + . "' === \$route)"; + $script .= PHP_EOL . $this->_t(2) . '{'; + $script .= PHP_EOL . implode( + PHP_EOL . PHP_EOL, $_script + ); + $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; + } + } + + // return true + $script .= PHP_EOL . $this->_t(2) . 'return true;'; + // close the function + $script .= PHP_EOL . $this->_t(1) . '}'; + + return $script; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php new file mode 100644 index 000000000..97b53b5e7 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php @@ -0,0 +1,40 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder; + + +/** + * Add line comment + * + * @since 3.1.5 + */ +trait Line +{ + /** + * Set the line number in comments + * + * @param int $nr The line number + * + * @return string + * @since 3.1.5 + */ + private function setLine(int $nr): string + { + if ($this->debug) + { + return ' [' . get_called_class() . ' ' . $nr . ']'; + } + + return ''; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php new file mode 100644 index 000000000..070435503 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php @@ -0,0 +1,58 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder; + + +/** + * Adds Tabs + * + * @since 3.1.5 + */ +trait Tab +{ + /** + * Tab/spacer bucket (to speed-up the build) + * + * @var array + * @since 3.1.5 + */ + protected $tabSpacerBucket = array(); + + /** + * Set tab/spacer + * + * @var string + * @since 3.1.5 + */ + protected $tabSpacer = "\t"; + + /** + * Set the tab/space + * + * @param int $nr The number of tag/space + * + * @return string + * @since 3.1.5 + */ + public function _t(int $nr) : string + { + // check if we already have the string + if (!isset($this->tabSpacerBucket[$nr])) + { + // get the string + $this->tabSpacerBucket[$nr] = str_repeat($this->tabSpacer, (int) $nr); + } + // return stored string + return $this->tabSpacerBucket[$nr]; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/script.php b/script.php index 26557c517..a6b8b4cb2 100644 --- a/script.php +++ b/script.php @@ -9422,7 +9422,7 @@ class com_componentbuilderInstallerScript echo ' -

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

'; +

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

'; // Set db if not set already. if (!isset($db)) -- 2.45.1 From e7500b76ebf09f2521434242549db4644a8039aa Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 20 Aug 2022 18:33:09 +0200 Subject: [PATCH 03/49] Add tmp debugging. --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/f_Infusion.php | 4 ++-- admin/sql/install.mysql.utf8.sql | 9 +-------- .../src/Componentbuilder/Extension/InstallScript.php | 8 +++++++- .../jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php | 8 ++++++++ 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3601367fb..2f5431f5c 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ TODO + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311839** ++ *Line count*: **311846** + *Field count*: **2002** + *File count*: **2055** + *Folder count*: **351** diff --git a/admin/README.txt b/admin/README.txt index 3601367fb..2f5431f5c 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,7 +144,7 @@ TODO + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311839** ++ *Line count*: **311846** + *Field count*: **2002** + *File count*: **2055** + *Folder count*: **351** diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index cd3acf537..4399be384 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -2394,7 +2394,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$module->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($module))->get(); + = (new InstallScript($module, ['debug' => $this->debugLinenr]))->get(); } // FIELDSET if (isset($module->form_files) @@ -2456,7 +2456,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$plugin->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($plugin))->get(); + = (new InstallScript($plugin, ['debug' => $this->debugLinenr]))->get(); } // FIELDSET if (isset($plugin->form_files) diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 64a96020e..a9422cda5 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1968,9 +1968,6 @@ INSERT INTO `#__componentbuilder_joomla_component` (`id`, `add_license`, `licens INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `extends`, `extends_custom`, `guid`, `head`, `implements`, `implements_custom`, `load_selection`, `main_class_code`, `method_selection`, `name`, `namespace`, `power_version`, `property_selection`, `system_name`, `type`, `use_selection`, `params`, `published`, `created`, `modified`, `version`, `ordering`) VALUES (1, '', 'Basic shared utilities, a legacy implementation\r\n\r\n@since 3.0.9', '', '', '79d765b3-7319-4988-9730-446c7f347020', '', '', '', '{\"load_selection0\":{\"load\":\"1d929017-a5de-4e0f-9b5a-838934857e26\"}}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIGhhd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G9wdGlvbiBmb3IgdGhlIGNvbXBvbmVudC4NCgkgKg0KCSAqIEBzaW5jZSAgMy4wLjExDQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBzZXRDb21wb25lbnRPcHRpb24oJG9wdGlvbiA9IG51bGwpDQoJew0KCQkvLyBzZXQgdGhlIGxvY2FsIGNvbXBvbmVudCBvcHRpb24NCgkJaWYgKGVtcHR5KCRvcHRpb24pKQ0KCQl7DQoJCQlpZiAoZW1wdHkoSGVscGVyOjokb3B0aW9uKSAmJiBwcm9wZXJ0eV9leGlzdHMoX19DTEFTU19fLCAnQ29tcG9uZW50Q29kZU5hbWUnKSkNCgkJCXsNCgkJCQlIZWxwZXI6OiRvcHRpb24gPSAnY29tXycgLiBzZWxmOjokQ29tcG9uZW50Q29kZU5hbWU7DQoJCQl9DQoJCX0NCgkJZWxzZQ0KCQl7DQoJCQlIZWxwZXI6OiRvcHRpb24gPSAkb3B0aW9uOw0KCQl9DQoJfQ0K', '{}', 'Utilities', 'VDM\\Joomla\\Utilities', '1.0.0', '{}', 'Utilities', 'trait', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"91004529-94a9-4590-b842-e7c6b624ecf5\",\"as\":\"default\"},\"use_selection4\":{\"use\":\"152c8793-8b75-4715-996a-257b9f65451c\",\"as\":\"default\"},\"use_selection5\":{\"use\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\",\"as\":\"default\"},\"use_selection6\":{\"use\":\"9c513baf-b279-43fd-ae29-a585c8cbc4f0\",\"as\":\"default\"},\"use_selection7\":{\"use\":\"a223b31e-ea1d-4cdf-92ae-5f9becffaff0\",\"as\":\"default\"},\"use_selection8\":{\"use\":\"9ef0eb24-aae4-4f5a-99af-d724db44808f\",\"as\":\"default\"},\"use_selection9\":{\"use\":\"a8935cbe-7701-40dc-bfd5-675f2d600954\",\"as\":\"default\"},\"use_selection10\":{\"use\":\"30c5b4c2-f75f-4d15-869a-f8bfedd87358\",\"as\":\"default\"},\"use_selection11\":{\"use\":\"ce8cf834-6bac-44fb-941c-861f7e046cc0\",\"as\":\"default\"},\"use_selection12\":{\"use\":\"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6\",\"as\":\"default\"},\"use_selection13\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2021-11-06 13:25:19', '2022-08-20 15:18:05', 70, 1), -(2, 1, 'To extrude tables structures from lila', '', '', '050f5a27-3aab-4087-8a3d-e2302fcfd5db', 'dXNlIERpcmVjdG9yeUl0ZXJhdG9yOw0KdXNlIFNwbEZpbGVPYmplY3Q7DQp1c2Ugc3RkQ2xhc3M7DQp1c2UgZnVuY3Rpb24gYXJyYXlfcG9wOw0KdXNlIGZ1bmN0aW9uIGNvdW50Ow0KdXNlIGZ1bmN0aW9uIGV4cGxvZGU7DQp1c2UgZnVuY3Rpb24gZmlsZV9leGlzdHM7DQp1c2UgZnVuY3Rpb24gaXNfbnVsbDsNCnVzZSBmdW5jdGlvbiBhcnJheV9yZXZlcnNlOw0KdXNlIGZ1bmN0aW9uIHN0cl9yZXBsYWNlOw0KdXNlIGZ1bmN0aW9uIHN0cmxlbjsNCnVzZSBmdW5jdGlvbiBzdHJwb3M7DQp1c2UgZnVuY3Rpb24gc3RycnBvczsNCnVzZSBmdW5jdGlvbiBzdWJzdHI7DQp1c2UgZnVuY3Rpb24gdHJpbTsNCg==', '', '', '', 'CS8qKg0KCSAqIEFkZGluZyB0aGUgdXRpbGl0aWVzIHRyYWl0IHRvIHRoaXMgY2xhc3MNCgkgKiBTaW5jZSB3ZSBuZWVkIHNvbWUgb2YgaXRzIGZ1bmN0aW9ucw0KC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JsZV9hcnJheVswXTsNCgkJfQ0KCQkvLyBub3cgd2UgZG8gdGhlIGJydXRlZm9yY2Ugd2F5DQoJCWZvcmVhY2ggKCR0aGlzLT50YWJsZXMgYXMgJG1vZCA9PiAkbW9kcykNCgkJew0KCQkJaWYgKGlzc2V0KCRtb2RzWyR0YWJsZV0pKQ0KCQkJew0KCQkJCXJldHVybiAkbW9kOw0KCQkJfQ0KCQl9DQoNCgkJcmV0dXJuIGZhbHNlOw0KCX0NCg==', '{}', 'ExtrudeTables', '[[[COMPANY]]]\\[[[Component]]]\\ExtrudeTables', '1.0.0', '{}', 'Lila Extrude Tables', 'class', '{\"use_selection0\":{\"use\":\"79d765b3-7319-4988-9730-446c7f347020\"}}', '', 1, '2021-11-06 14:28:17', '2021-11-13 16:34:22', 33, 2), -(3, '', '', '', '', '7e6e7fe8-725d-411e-889a-4f1618c11840', '', '', '', '', 'Ly8gaGVscA==', '{}', 'TestingInterface', '[[[Component]]]\\Power\\TestingInterface', '1.0.0', '{}', 'Testing Interface', 'interface', '{}', '', 1, '2021-11-07 15:54:41', '2021-11-09 04:37:44', 7, 3), -(4, '', 'To store tables structures from lila', '', '', 'c4469632-3914-400e-b861-972b2d463963', '', '', '', '', 'CS8qKg0KCSAqIEFkZGluZyB0aGUgdXRpbGl0aWVzIHRyYWl0IHRvIHRoaXMgY2xhc3MNCgkgKiBTaW5jZSB3ZSBuZWVkIHNvbWUgb2YgaXRzIGZ1bmN0aW9ucw0KCSAqLw0KCXVzZSBVdGlsOw0KDQoJLyoqDQoJICogVGhlIGRhdGENCgkgKg0KCSAqIEB2YXIgRXh0cnVkZQ0KCSAqLw0KCXByb3RlY3RlZCAkZGF0YTsNCg0KCS8qKg0KCSAqIENvbnN0cnVjdG9yDQoJICoNCgkgKiBAcGFyYW0gICBFeHRydWRlICAkZGF0YSAgVGhlIGV4dHJ1ZGVkIGRhdGENCgkgKi8NCglwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoRXh0cnVk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XN0DQoJCWVsc2VpZiAoJGFyZWEpDQoJCXsNCgkJCXJldHVybiBhcnJheSgpOw0KCQl9DQoJCS8vIHJldHVybiBhbGwgb24gbnVsbCBhcmVhDQoJCXJldHVybiAkcGFyYW1zOw0KCX0NCg==', '{}', 'StoreTables', '[[[COMPANY]]]\\[[[Component]]]\\StoreTables', '1.0.0', '{}', 'Lila Store Tables', 'class', '{\"use_selection0\":{\"use\":\"79d765b3-7319-4988-9730-446c7f347020\"}}', '', 1, '2021-11-13 17:52:23', '2021-11-13 22:21:46', 14, 2), (5, 1, '', '', '', 'db4a1e4d-be59-4e87-8b4d-c40512752232', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwIGFzIEJhc2VIdHRwOw0KdXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwRmFjdG9yeTsNCnVzZSBKb29tbGFcUmVnaXN0cnlcUmVnaXN0cnk7', '', '', '{\"load_selection0\":{\"load\":\"aa253bac-f4b4-41b4-8ace-071a73fc4d96\"},\"load_selection1\":{\"load\":\"c65aaf1f-817c-49a2-8202-282e3904f5b1\"},\"load_selection2\":{\"load\":\"51195163-1e87-4251-b755-a03c376798a6\"},\"load_selection3\":{\"load\":\"ef011ee1-64f0-4048-b013-777473b727dd\"},\"load_selection4\":{\"load\":\"c4a188de-ad78-4a6d-9d5b-01866846d701\"}}', 'CS8qKg0KCSAqIE9wdGlvbnMgZm9yIHRoZSBHaXRlYSBvYmplY3QuDQoJICoNCgkgKiBAdmFyICAgIGFycmF5DQoJICogQHNpbmNlICAxLjANCgkgKi8NCglwcm90ZWN0ZWQgJG9wdGlvbnM7DQoNCgkvKioNCgkgKiBUaGUgSFRUUCBjbGllbnQgb2JqZWN0IHRvIHVzZSBpbiBzZW5kaW5nIEhUVFAgcmVxdWVzdHMuDQoJICoNCgkgKiBAdmFyICAgIEJhc2VIdHRwDQoJICogQHNpbmNlICAxLjANCgkgKi8NCglwcm90ZWN0ZWQgJGNsaWVudDsNCg0KCS8qKg0KCS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KCQkJCSRib2R5LT5jb250ZW50ID0gYmFzZTY0X2RlY29kZSgkYm9keS0+Y29udGVudF9iYXNlNjQpOw0KCQkJfQ0KCQl9DQoJCWVsc2UNCgkJew0KCQkJJGJvZHkgPSAkcmVzcG9uc2UtPmJvZHk7DQoJCX0NCg0KCQlyZXR1cm4gJGJvZHk7DQoJfQ0K', '{}', 'AbstractGiteaObject', 'VDM\\Gitea\\AbstractGiteaObject', '1.0.0', '{}', 'Abstract Gitea Object', 'abstract class', '{\"use_selection0\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"}}', '', 1, '2021-12-03 16:00:26', '2022-07-09 12:15:49', 20, 4), (7, 1, '', 'aa253bac-f4b4-41b4-8ace-071a73fc4d96', '', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwIGFzIEJhc2VIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIENvbnN0cnVjdG9yLg0KCSAqDQoJICogQHBhcmFtICAgUmVnaXN0cnkgICRvcHRpb25zICBHaXRlYSBvcHRpb25zIG9iamVjdC4NCgkgKiBAcGFyYW0gICBIdHRwICAgICAgJGNsaWVudCAgIFRoZSBIVFRQIGNsaWVudCBvYmplY3QuDQoJICoNCgkgKiBAc2luY2UgICAxLjANCgkgKi8NCglwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoUmVnaXN0cnkgJG9wdGlvbnMgPSBudWxsLCBCYXNlSHR0cCAkY2xpZW50ID0gbnVsbCkNCgl7DQoJCXBhcmVudDo6X19jb25zdHJ1Y3QoJG9wdGlvbnMsICRjbGllbnQpOw0KDQoJCSR0aGlzLT5wYWNrYWdlID0gXGdldF9jbGFzcygkdGhpcyk7DQoJCSR0aGlzLT5wYWNrYWdlID0gc3Vic3RyKCR0aGlzLT5wYWNrYWdlLCBzdHJycG9zKCR0aG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', '1.0.0', '{}', 'Abstract Gitea Package', 'abstract class', '{}', '', 1, '2021-12-03 16:03:06', '2022-05-27 08:31:35', 15, 4), @@ -1995,11 +1992,7 @@ INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `exten (26, '', 'Mime Helper\r\n\r\n@since 3.0.11', '', '', 'f11dc790-713e-4706-9a85-a318ed3ad56e', '', '', '', '{}', 'W0VYVEVSTkFMQ09ERT1odHRwczovL2dpc3QuZ2l0aHVidXNlcmNvbnRlbnQuY29tL0xsZXdlbGx5bnZkbS83NGJlMzczMzU3ZTEzMWI4Nzc1YTc1ODJjM2RlNTA4Yi9yYXcvbWltZV90eXBlcy5waHBdDQoNCltFWFRFUk5BTENPREU9aHR0cHM6Ly9naXN0LmdpdGh1YnVzZXJjb250ZW50LmNvbS9MbGV3ZWxseW52ZG0vNzRiZTM3MzM1N2UxMzFiODc3NWE3NTgyYzNkZTUwOGIvcmF3L2dldC5waHBdDQoNCltFWFRFUk5BTENPREU9aHR0cHM6Ly9naXN0LmdpdGh1YnVzZXJjb250ZW50LmNvbS9MbGV3ZWxseW52ZG0vNzRiZTM3MzM1N2UxMzFiODc3NWE3NTgyYzNkZTUwOGIvcmF3L2V4dGVuc2lvbnMucGhwXQ==', '{}', 'MimeHelper', 'VDM\\Joomla\\Utilities.MimeHelper', '1.0.0', '{}', 'Utilities MimeHelper', 'abstract class', '{}', '', 1, '2022-05-16 14:27:38', '2022-05-21 13:27:39', 3, 9), (27, '', 'Just to link powers to the power updater component', '', '', '8025e71c-8e21-44cb-b23e-dce2fb5a1ab5', '', '', '', '{\"load_selection0\":{\"load\":\"db4a1e4d-be59-4e87-8b4d-c40512752232\"},\"load_selection1\":{\"load\":\"79d765b3-7319-4988-9730-446c7f347020\"},\"load_selection2\":{\"load\":\"d7600b43-771a-4747-9f5d-952765721799\"},\"load_selection3\":{\"load\":\"962b15d8-915f-4cd7-aea6-7cf82afdc20b\"},\"load_selection4\":{\"load\":\"f11dc790-713e-4706-9a85-a318ed3ad56e\"}}', '', '{}', 'Updater', 'VDM\\Powe\\Updater', '1.0.0', '{}', 'Power Updater', 'class', '{}', '', 1, '2022-05-21 13:15:55', '2022-06-11 16:54:51', 3, 13), (28, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoGetContents', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', 'ef011ee1-64f0-4048-b013-777473b727dd', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldHMgdGhlIG1ldGFkYXRhIGFuZCBjb250ZW50cyAoaWYgYSBmaWxlKSBvZiBhbiBlbnRyeSBpbiBhIHJlcG9zaXRvcnksIG9yIGEgbGlzdCBvZiBlbnRyaWVzIGlmIGEgZGlyDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICBSZXBvc2l0b3J5IG93bmVyLg0KCSAqIEBwYXJhbSAgIHN0cmluZyAgJHJlcG8gICAgICAgICBSZXBvc2l0b3J5IG5hbWUuDQoJICogQHBhcmFtICAgc3RyaW5nICAkZmlsZXBhdGggICAgUmVwb3NpdG9yeSBmaWxlIHBhdGguDQoJICoNCgkgKiBAcmV0dXJuICBvYmplY3QNCgkgKg0KCSAqIEBzaW5jZSAgIDEuMA0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiBnZXQoJG93bmVyLCAkcmVwbywgJGZpbGVwYXRoKQ0KCXsNCgkJLy8gQnVpbGQgdGhlIHJlcXVlc3QgcGF0aC4NCgkJJHBhdGggPSAnL3JlcG9zLycgLiAkb3duZXIgLiAnLycgLiAkcmVwbyAuICcvY29udGVudHMvJyAuICRmaWxlcGF0aDsNCg0KCQkvLyBTZW5kIHRoZSByZXF1ZXN0Lg0KCQlyZXR1cm4gJHRoaXMtPnByb2Nlc3NSZXNwb25zZSgNCgkJCSR0aGlzLT5jbGllbnQtPmdldCgkdGhpcy0+ZmV0Y2hVcmwoJHBhdGgpKQ0KCQkpOw0KCX0NCg==', '{}', 'File', 'VDM\\Gitea\\Package.Repo.File', '1.0.0', '{}', 'Gitea Repo File', 'class', '{}', '', 1, '2022-05-21 13:40:09', '2022-07-09 10:28:20', 10, 4), -(29, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoCreateWikiPage', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', 'c4a188de-ad78-4a6d-9d5b-01866846d701', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldCBhIHJlcG9zaXRvcnkgd2lraSBwYWdlDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICAgICAgICAgIFRoZSByZXBvc2l0b3J5IG93bmVyDQoJICogQHBhcmFtICAgc3RyaW5nICAkcmVwbyAgICAgICAgICAgICAgICAgVGhlIHJlcG9zaXRvcnkgbmFtZQ0KCSAqIEBwYXJhbSAgIHN0cmluZyAgJHBhZ2VOYW1lICAgICAgIFRoZSBwYWdlIG5hbWUNCgkgKg0KCSAqIEByZXR1cm4gIG9iamVjdA0KCSAqDQoJICogQHNpbmNlICAgMS4wDQoJICovDQoJcHVibGljIGZ1bmN0aW9uIGdldChzdHJpbmcgJG93bmVyLCBzdHJpbmcgJHJlcG8sIHN0cmluZyAkcGFnZU5hbWUpDQoJew0KCQkvLyBCdWlsZCB0aGUgcmVxdWVzdCBwYXRoLg0KCQkkcGF0aCA9ICcvcmVwb3MvJyAuICRvd25lciAuICcvJyAuICRyZXBvIC4gJy93aWtpL3BhZ2UvJyAuICRwYWdlTmFtZTsNCg0KCQkvLyBTZW5kIHRoZSByZXF1ZXN0Lg0KCQlyZXR1cm4gJHRoaXMtPnByb2Nlc3NSZXNwb25zZSgNCgkJCSR0aGlzLT5jbGllbnQtPmdldCg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nOw0KDQoJCS8vIGJ1aWxkIHRoZSBwb3N0IGJvZHkNCgkJJGRhdGEgPSBbDQoJCQknQ29udGV4dCcgPT4gJ3N0cmluZycsDQoJCQknTW9kZScgPT4gJ3N0cmluZycsDQoJCQknVGV4dCcgPT4gJHBhZ2UtPmNvbnRlbnQsDQoJCQknV2lraScgPT4gdHJ1ZQ0KCQldOw0KDQoJCS8vIFBvc3QgdGhlIHJlcXVlc3QuDQoJCXJldHVybiAkdGhpcy0+cHJvY2Vzc1Jlc3BvbnNlKA0KCQkJJHRoaXMtPmNsaWVudC0+cG9zdCgkdGhpcy0+ZmV0Y2hVcmwoJHBhdGgpLCBqc29uX2VuY29kZSgkZGF0YSksICRoZWFkZXJzKQ0KCQkpOw0KCX0NCg==', '{}', 'Wiki', 'VDM\\Gitea\\Package.Repo.Wiki', '1.0.0', '{}', 'Gitea Repo Wiki', 'class', '{}', '', 1, '2022-07-09 10:21:53', '2022-07-09 12:18:07', 9, 4), -(30, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoGetContents', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', '6ad3beb1-a769-4a6c-b300-5cda7adc6c0d', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldHMgdGhlIG1ldGFkYXRhIGFuZCBjb250ZW50cyAoaWYgYSBmaWxlKSBvZiBhbiBlbnRyeSBpbiBhIHJlcG9zaXRvcnksIG9yIGEgbGlzdCBvZiBlbnRyaWVzIGlmIGEgZGlyDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICBSZXBvc2l0b3J5IG93bmVyLg0KCSAqIEBwYXJhbSAgIHN0cmluZyAgJHJlcG8gICAgICAgICBSZXBvc2l0b3J5IG5hbWUuDQoJICogQHBhcmFtICAgc3RyaW5nICAkZmlsZXBhdGggICAgUmVwb3NpdG9yeSBmaWxlIHBhdGguDQoJICoNCgkgKiBAcmV0dXJuICBvYmplY3QNCgkgKg0KCSAqIEBzaW5jZSAgIDEuMA0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiBnZXQoJG93bmVyLCAkcmVwbywgJGZpbGVwYXRoKQ0KCXsNCgkJLy8gQnVpbGQgdGhlIHJlcXVlc3QgcGF0aC4NCgkJJHBhdGggPSAnL3JlcG9zLycgLiAkb3duZXIgLiAnLycgLiAkcmVwbyAuICcvY29udGVudHMvJyAuICRmaWxlcGF0aDsNCg0KCQkvLyBTZW5kIHRoZSByZXF1ZXN0Lg0KCQlyZXR1cm4gJHRoaXMtPnByb2Nlc3NSZXNwb25zZSgNCgkJCSR0aGlzLT5jbGllbnQtPmdldCgkdGhpcy0+ZmV0Y2hVcmwoJHBhdGgpKQ0KCQkpOw0KCX0NCg==', '{}', 'File', 'VDM\\Gitea\\Package.Repo.File', '1.0.1', '{}', 'Gitea Repo File', 'class', '{}', '', -2, '2022-07-11 18:35:50', '2022-07-09 10:28:20', 1, 4), -(31, '', 'Loading the Extension Installation Script Class\r\n\r\n@since 3.1.5', '', '', '1d929017-a5de-4e0f-9b5a-838934857e26', '', '', '', '{}', 'CS8qKg0KCSAqIFRoZSBMaW5lIG51bWJlcmluZyBNZXRob2RzDQoJICoNCgkgKiBAc2luY2UgMy4xLjUNCgkgKi8NCgl1c2UgTGluZTsNCg0KCS8qKg0KCSAqIFRoZSBUYWIgQWRkaW5nIE1ldGhvZA0KCSAqDQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJdXNlIFRhYjsNCg0KCS8qKg0KCSAqIFRoZSBleHRlbnNpb24NCgkgKg0KCSAqIEB2YXIgICAgIG9iamVjdA0KCSAqIEBzaW5jZSAzLjEuNQ0KCSAqLw0KCXByb3RlY3RlZCBvYmplY3QgJGV4dGVuc2lvbjsNCg0KCS8qKg0KCSAqIFRoZSBtZXRob2RzDQoJICoNCgkgKiBAdmFyICAgICBhcnJhe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R0aGlzLT5fdCgyKSAuICd9JyAuIFBIUF9FT0w7DQoJCX0NCg0KCQkvLyBub3cgYWRkIHRoZSBzY3JpcHRzDQoJCWZvcmVhY2ggKCR0aGlzLT57JG5hbWUgLiAnQnVja2V0J30gYXMgJHJvdXRlID0+ICRfc2NyaXB0KQ0KCQl7DQoJCQlpZiAoQXJyYXlIZWxwZXI6OmNoZWNrKCRfc2NyaXB0KSkNCgkJCXsNCgkJCQkvLyBzZXQgdGhlIGlmIGFuZCBzY3JpcHQNCgkJCQkkc2NyaXB0IC49IFBIUF9FT0wgLiAkdGhpcy0+X3QoMikgLiAiaWYgKCciIC4gJHJvdXRlDQoJCQkJCS4gIicgPT09IFwkcm91dGUpIjsNCgkJCQkkc2NyaXB0IC49IFBIUF9FT0wgLiAkdGhpcy0+X3QoMikgLiAneyc7DQoJCQkJJHNjcmlwdCAuPSBQSFBfRU9MIC4gaW1wbG9kZSgNCgkJCQkJCVBIUF9FT0wgLiBQSFBfRU9MLCAkX3NjcmlwdA0KCQkJCQkpOw0KCQkJCSRzY3JpcHQgLj0gUEhQX0VPTCAuICR0aGlzLT5fdCgyKSAuICd9JyAuIFBIUF9FT0w7DQoJCQl9DQoJCX0NCg0KCQkvLyByZXR1cm4gdHJ1ZQ0KCQkkc2NyaXB0IC49IFBIUF9FT0wgLiAkdGhpcy0+X3QoMikgLiAncmV0dXJuIHRydWU7JzsNCgkJLy8gY2xvc2UgdGhlIGZ1bmN0aW9uDQoJCSRzY3JpcHQgLj0gUEhQX0VPTCAuICR0aGlzLT5fdCgxKSAuICd9JzsNCg0KCQlyZXR1cm4gJHNjcmlwdDsNCgl9', '{}', 'InstallScript', 'VDM\\Joomla\\Componentbuilder.Extension.InstallScript', '1.0.0', '{}', 'Componentbuilder.Extension.Install', 'class', '{\"use_selection0\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"4e6ff11d-bebf-42f5-8fd7-b2f882857222\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"a68c010b-e92e-47d5-8a44-d23cfddeb6c6\",\"as\":\"default\"}}', '', 1, '2022-08-20 13:45:05', '2022-08-20 15:47:55', 10, 14), -(32, '', 'Adds Tabs\r\n\r\n@since 3.1.5', '', '', 'a68c010b-e92e-47d5-8a44-d23cfddeb6c6', '', '', '', '{}', 'CS8qKg0KCSAqIFRhYi9zcGFjZXIgYnVja2V0ICh0byBzcGVlZC11cCB0aGUgYnVpbGQpDQoJICogDQoJICogQHZhciAgIGFycmF5DQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJcHJvdGVjdGVkICR0YWJTcGFjZXJCdWNrZXQgPSBhcnJheSgpOw0KDQoJLyoqDQoJICogU2V0IHRhYi9zcGFjZXINCgkgKiANCgkgKiBAdmFyICAgc3RyaW5nDQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJcHJvdGVjdGVkICR0YWJTcGFjZXIgPSAiXHQiOw0KDQoJLyoqDQoJICogU2V0IHRoZSB0YWIvc3BhY2UNCgkgKiANCgkgKiBAcGFyYW0gICBpbnQgICAkbnIgIFRoZSBudW1iZXIgb2YgdGFnL3NwYWNlDQoJICogDQoJICogQHJldHVybiAgc3RyaW5nDQoJICogQHNpbmNlIDMuMS41DQoJICovDQoJcHVibGljIGZ1bmN0aW9uIF90KGludCAkbnIpIDogc3RyaW5nDQoJew0KCQkvLyBjaGVjayBpZiB3ZSBhbHJlYWR5IGhhdmUgdGhlIHN0cmluZw0KCQlpZiAoIWlzc2V0KCR0aGlzLT50YWJTcGFjZXJCdWNrZXRbJG5yXSkpDQoJCXsNCgkJCS8vIGdldCB0aGUgc3RyaW5nDQoJCQkkdGhpcy0+dGFiU3BhY2VyQnVja2V0WyRucl0gPSBzdHJfcmVwZWF0KCR0aGlzLT50YWJTcGFjZXIsIChpbnQpICRucik7DQoJCX0NCgkJLy8gcmV0dXJuIHN0b3JlZCBzdHJpbmcNCgkJcmV0dXJuICR0aGlzLT50YWJTcGFjZXJCdWNrZXRbJG5yXTsNCgl9', '{}', 'Tab', 'VDM\\Joomla\\Componentbuilder.Tab', '1.0.0', '{}', 'Componentbuilder.Tab', 'trait', '{}', '', 1, '2022-08-20 13:55:50', '2022-08-20 15:26:46', 5, 15), -(33, '', 'Add line comment\r\n\r\n@since 3.1.5', '', '', '4e6ff11d-bebf-42f5-8fd7-b2f882857222', '', '', '', '{}', 'CS8qKg0KCSAqIFNldCB0aGUgbGluZSBudW1iZXIgaW4gY29tbWVudHMNCgkgKg0KCSAqIEBwYXJhbSAgIGludCAgJG5yICBUaGUgbGluZSBudW1iZXINCgkgKg0KCSAqIEByZXR1cm4gIHN0cmluZw0KCSAqIEBzaW5jZSAzLjEuNQ0KCSAqLw0KCXByaXZhdGUgZnVuY3Rpb24gc2V0TGluZShpbnQgJG5yKTogc3RyaW5nDQoJew0KCQlpZiAoJHRoaXMtPmRlYnVnKQ0KCQl7DQoJCQlyZXR1cm4gJyBbJyAuIGdldF9jYWxsZWRfY2xhc3MoKSAuICcgJyAuICRuciAuICddJzsNCgkJfQ0KDQoJCXJldHVybiAnJzsNCgl9', '{}', 'Line', 'VDM\\Joomla\\Componentbuilder.Line', '1.0.0', '{}', 'Componentbuilder.Line', 'trait', '{}', '', 1, '2022-08-20 14:02:09', '2022-08-20 15:26:56', 4, 15); +(29, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoCreateWikiPage', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', 'c4a188de-ad78-4a6d-9d5b-01866846d701', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldCBhIHJlcG9zaXRvcnkgd2lraSBwYWdlDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25l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', 'Gitea Repo Wiki', 'class', '{}', '', 1, '2022-07-09 10:21:53', '2022-07-09 12:18:07', 9, 4); -- -- Dumping data for table `#__componentbuilder_admin_view` diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php index 0c72523fd..b4287f1c3 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php @@ -131,8 +131,14 @@ class InstallScript * Constructor * @since 3.1.5 */ - public function __construct(object $extension) + public function __construct(object $extension, ?array $config = null) { + // check if we have the debug switch TODO - move to global registry - singleton + if (isset($config['debug'])) + { + $this->debug = $config['debug']; + } + // loop over methods and types foreach ($this->methods as $method) { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php index 97b53b5e7..ee26fabef 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php @@ -19,6 +19,14 @@ namespace VDM\Joomla\Componentbuilder; */ trait Line { + /** + * The debug switch + * + * @var bool + * @since 3.1.5 + */ + protected bool $debug = false; + /** * Set the line number in comments * -- 2.45.1 From f8ac24737799f63a8358a967a4c0b1982cd98394 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 21 Aug 2022 19:21:03 +0200 Subject: [PATCH 04/49] Initial move of configuration to its own class and factory. #951 --- README.md | 6 +- admin/README.txt | 6 +- admin/helpers/compiler.php | 19 +- admin/helpers/compiler/a_Get.php | 520 +++++++++--------- admin/helpers/compiler/b_Structure.php | 37 +- admin/helpers/compiler/c_Fields.php | 41 +- admin/helpers/compiler/e_Interpretation.php | 186 +++---- admin/helpers/compiler/f_Infusion.php | 72 +-- admin/models/forms/power.xml | 4 +- admin/sql/install.mysql.utf8.sql | 2 +- componentbuilder.xml | 2 +- .../src/Componentbuilder/Compiler/Config.php | 178 ++++++ .../{ => Compiler}/index.html | 0 .../Extension/InstallScript.php | 8 +- .../Factory/Compiler/Config.php | 257 +++++++++ .../Factory/Compiler}/index.html | 0 .../VDM.Joomla/src/Componentbuilder/Line.php | 13 +- 17 files changed, 885 insertions(+), 466 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/{ => Compiler}/index.html (100%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php rename libraries/jcb_powers/VDM.Joomla/src/{Utilities => Componentbuilder/Factory/Compiler}/index.html (100%) diff --git a/README.md b/README.md index 2f5431f5c..680ab3df8 100644 --- a/README.md +++ b/README.md @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th August, 2022 ++ *Last Build*: 21st August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311846** ++ *Line count*: **312270** + *Field count*: **2002** -+ *File count*: **2055** ++ *File count*: **2057** + *Folder count*: **351** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 2f5431f5c..680ab3df8 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th August, 2022 ++ *Last Build*: 21st August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **311846** ++ *Line count*: **312270** + *Field count*: **2002** -+ *File count*: **2055** ++ *File count*: **2057** + *Folder count*: **351** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 41aadbf30..e4760daf5 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -20,6 +20,7 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\MathHelper; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; // Use the component builder autoloader ComponentbuilderHelper::autoLoader(); @@ -183,7 +184,7 @@ class Compiler extends Infusion 'because more then %s% of the strings have been translated.', $this->percentageLanguageAdd ); - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { $whyAddedLang = JText::_( 'because the debugging mode is on. (debug line numbers)' @@ -214,12 +215,12 @@ class Compiler extends Infusion 'The SQL fix updates the #__assets table\'s column size on installation of the component and reverses it back to the Joomla default on uninstall of the component.' ); // set assets table rules column notice - if ($this->addAssetsTableFix) + if (Config::get('add_assets_table_fix')) { $this->app->enqueueMessage( JText::_('

Assets Table Notice

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

Field Notice

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

Field Notice

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

Upgrade to Version " @@ -8091,7 +8092,7 @@ class Interpretation extends Fields $this->uninstallScriptBuilder )) { - $component = $this->componentCodeName; + $component = Config::get('component_code_name'); // start loading the data to delet $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get Application object"; @@ -8574,7 +8575,7 @@ class Interpretation extends Fields // column size is varchar(5120) // check if we should add the intelligent fix treatment for the assets table - if ($this->addAssetsTableFix == 2) + if (Config::get('add_assets_table_fix') == 2) { // get the type we will convert to $data_type = ($this->accessWorseCase > 64000) ? "MEDIUMTEXT" @@ -8621,7 +8622,7 @@ class Interpretation extends Fields protected function getAssetsTableIntelligentUninstall() { // check if we should add the intelligent uninstall treatment for the assets table - if ($this->addAssetsTableFix == 2) + if (Config::get('add_assets_table_fix') == 2) { // the if statement about $rule_length $codeIF = "\$rule_length < 5120"; @@ -9000,7 +9001,7 @@ class Interpretation extends Fields $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the link"; $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" - . $this->componentCodeName . "&view=" . $nameSingleCode + . Config::get('component_code_name') . "&view=" . $nameSingleCode . "&id='. \$id;"; $routeHelper[] = $this->_t(2) . "}"; $routeHelper[] = $this->_t(2) . "else"; @@ -9014,7 +9015,7 @@ class Interpretation extends Fields $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the link but don't add the id."; $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" - . $this->componentCodeName . "&view=" . $nameSingleCode + . Config::get('component_code_name') . "&view=" . $nameSingleCode . "';"; $routeHelper[] = $this->_t(2) . "}"; if ('category' != $nameSingleCode @@ -9024,7 +9025,7 @@ class Interpretation extends Fields $routeHelper[] = $this->_t(2) . "{"; $routeHelper[] = $this->_t(3) . "\$categories = JCategories::getInstance('" - . $this->componentCodeName . "." . $nameListCode . "');"; + . Config::get('component_code_name') . "." . $nameListCode . "');"; $routeHelper[] = $this->_t(3) . "\$category = \$categories->get(\$catid);"; $routeHelper[] = $this->_t(3) . "if (\$category)"; @@ -9120,7 +9121,7 @@ class Interpretation extends Fields if (isset($get['selection']['table'])) { $viewTable = str_replace( - '#__' . $this->componentCodeName . '_', '', + '#__' . Config::get('component_code_name') . '_', '', $get['selection']['table'] ); } @@ -9977,7 +9978,7 @@ class Interpretation extends Fields $fixUnique[] = $this->_t(4) . "}"; $fixUnique[] = PHP_EOL . $this->_t(4) . "\$table = JTable::getInstance('" . $nameSingleCode . "', '" - . $this->componentCodeName . "Table');"; + . Config::get('component_code_name') . "Table');"; if ($setCategory && count($titles) == 1) { $fixUnique[] = PHP_EOL . $this->_t(4) @@ -10701,7 +10702,7 @@ class Interpretation extends Fields // also check if the developer will allow this // the access actions length must be checked before this // only add this option if set to SQL fix - if ($this->addAssetsTableFix == 1) + if (Config::get('add_assets_table_fix') == 1) { // 400 actions worse case is larger the 65535 characters if ($this->accessSize > 400) @@ -10718,7 +10719,7 @@ class Interpretation extends Fields . "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; } // smaller then 400 makes TEXT large enough - elseif ($this->addAssetsTableFix == 1) + elseif (Config::get('add_assets_table_fix') == 1) { $db .= PHP_EOL; $db .= PHP_EOL . '--'; @@ -10737,7 +10738,7 @@ class Interpretation extends Fields // also check if the developer will allow this // the config length must be checked before this // only add this option if set to SQL fix - if ($this->addAssetsTableFix && $this->addAssetsTableNameFix) + if (Config::get('add_assets_table_fix') && $this->addAssetsTableNameFix) { $db .= PHP_EOL; $db .= PHP_EOL . '--'; @@ -10786,7 +10787,7 @@ class Interpretation extends Fields // check if this component used larger rules // now revert them back on uninstall // only add this option if set to SQL fix - if ($this->addAssetsTableFix == 1) + if (Config::get('add_assets_table_fix') == 1) { // https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L22 // Checked 1st December 2020 (let us know if this changes) @@ -10805,7 +10806,7 @@ class Interpretation extends Fields // check if this component used larger names // now revert them back on uninstall // only add this option if set to SQL fix - if ($this->addAssetsTableFix == 1 && $this->addAssetsTableNameFix) + if (Config::get('add_assets_table_fix') == 1 && $this->addAssetsTableNameFix) { // https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L20 // Checked 1st December 2020 (let us know if this changes) @@ -11102,7 +11103,7 @@ class Interpretation extends Fields // sort the strings ksort($this->langContent['admin']); // load to global languages - $this->languages['components'][$this->langTag]['admin'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] = $this->langContent['admin']; // remove tmp array unset($this->langContent['admin']); @@ -11197,7 +11198,7 @@ class Interpretation extends Fields // sort the strings ksort($this->langContent['site']); // load to global languages - $this->languages['components'][$this->langTag]['site'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] = $this->langContent['site']; // remove tmp array unset($this->langContent['site']); @@ -11254,7 +11255,7 @@ class Interpretation extends Fields // sort strings ksort($this->langContent['sitesys']); // load to global languages - $this->languages['components'][$this->langTag]['sitesys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] = $this->langContent['sitesys']; // remove tmp array unset($this->langContent['sitesys']); @@ -11300,7 +11301,7 @@ class Interpretation extends Fields // sort strings ksort($this->langContent['adminsys']); // load to global languages - $this->languages['components'][$this->langTag]['adminsys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] = $this->langContent['adminsys']; // remove tmp array unset($this->langContent['adminsys']); @@ -16972,7 +16973,7 @@ class Interpretation extends Fields = ''; } // minfy the script - if ($this->minify && isset($list_fileScript) + if (Config::get('minify', 0) && isset($list_fileScript) && StringHelper::check($list_fileScript)) { // minify the fielScript javscript @@ -16981,7 +16982,7 @@ class Interpretation extends Fields $list_fileScript = $minifier->minify(); } // minfy the script - if ($this->minify && isset($fileScript) + if (Config::get('minify', 0) && isset($fileScript) && StringHelper::check($fileScript)) { // minify the fielScript javscript @@ -16990,7 +16991,7 @@ class Interpretation extends Fields $fileScript = $minifier->minify(); } // minfy the script - if ($this->minify && isset($footerScript) + if (Config::get('minify', 0) && isset($footerScript) && StringHelper::check($footerScript)) { // minify the footerScript javscript @@ -27688,6 +27689,7 @@ function vdm_dkim() { // since we have less than 30 actions // we do not need the fix for this component $this->addAssetsTableFix = 0; + Config::set('add_assets_table_fix', $this->addAssetsTableFix); } else { @@ -28389,8 +28391,8 @@ function vdm_dkim() { $this->multiLangString = $this->getMultiLangStrings($values); // start the modules language bucket (must rest every time) $this->languages['modules'] = array(); - $this->languages['modules'][$this->langTag] = array(); - $this->languages['modules'][$this->langTag]['all'] + $this->languages['modules'][Config::get('lang_tag', 'en-GB')] = array(); + $this->languages['modules'][Config::get('lang_tag', 'en-GB')]['all'] = $this->langContent[$module->key]; unset($this->langContent[$module->key]); // update insert the current lang in to DB @@ -28774,8 +28776,8 @@ function vdm_dkim() { $this->multiLangString = $this->getMultiLangStrings($values); // start the plugins language bucket (must rest every time) $this->languages['plugins'] = array(); - $this->languages['plugins'][$this->langTag] = array(); - $this->languages['plugins'][$this->langTag]['all'] + $this->languages['plugins'][Config::get('lang_tag', 'en-GB')] = array(); + $this->languages['plugins'][Config::get('lang_tag', 'en-GB')]['all'] = $this->langContent[$plugin->key]; unset($this->langContent[$plugin->key]); // update insert the current lang in to DB @@ -29176,11 +29178,11 @@ function vdm_dkim() { // don't add the ending comma on last value if ($size == $counter) { - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'$this->jcbPowersPath/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'" . Config::get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; } else { - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'$this->jcbPowersPath/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'" . Config::get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; } $counter++; } @@ -29281,8 +29283,8 @@ function vdm_dkim() { &$file_name ) { - // only log messages for none $this->langTag translations - if ($this->langTag !== $tag) + // only log messages for none Config::get('lang_tag', 'en-GB') translations + if (Config::get('lang_tag', 'en-GB') !== $tag) { $langStringNr = count($languageStrings); $langStringSum = MathHelper::bc( @@ -29295,7 +29297,7 @@ function vdm_dkim() { . $tag . ' translated)' : '(strings ' . $tag . ' translated)'; // force load if debug lines are added - if (!$this->debugLinenr) + if (!Config::get('debug_line_nr', false)) { // check if we should install this translation if ($percentage < $this->percentageLanguageAdd) @@ -29303,7 +29305,7 @@ function vdm_dkim() { // dont add $this->langNot[$file_name] = '' . $total . '(total ' - . $this->langTag . ' strings) only ' + . Config::get('lang_tag', 'en-GB') . ' strings) only ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; @@ -29313,7 +29315,7 @@ function vdm_dkim() { // show if it was added as well $this->langSet[$file_name] = '' . $total . '(total ' - . $this->langTag . ' strings) and ' + . Config::get('lang_tag', 'en-GB') . ' strings) and ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 4399be384..c92c44c3e 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -20,6 +20,7 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Componentbuilder\Extension\InstallScript; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; /** * Infusion class @@ -55,7 +56,7 @@ class Infusion extends Interpretation */ private function setLine($nr) { - if ($this->debugLinenr) + if (Config::get('debug_line_nr', false)) { return ' [Infusion ' . $nr . ']'; } @@ -189,7 +190,7 @@ class Infusion extends Interpretation // set the joomla target xml version $this->fileContentStatic[$this->hhh . 'XMLVERSION' . $this->hhh] - = $this->joomlaVersions[$this->joomlaVersion]['xml_version']; + = $this->joomlaVersions[Config::get('version', 3)]['xml_version']; // Component_name $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] @@ -440,7 +441,7 @@ class Infusion extends Interpretation $this->fileContentDynamic[$nameSingleCode][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet( - $view, $this->componentCodeName, + $view, Config::get('component_code_name'), $nameSingleCode, $nameListCode ); @@ -774,7 +775,7 @@ class Infusion extends Interpretation . 'AUTOCHECKIN' . $this->hhh] = $this->setAutoCheckin( $nameSingleCode, - $this->componentCodeName + Config::get('component_code_name') ); // CHECKINCALL <<>> $this->fileContentDynamic[$nameListCode][$this->hhh @@ -1038,7 +1039,7 @@ class Infusion extends Interpretation && StringHelper::check($footerScript)) { // only minfy if no php is added to the footer script - if ($this->minify + if (Config::get('minify', 0) && strpos($footerScript, 'setLangContent( $this->lang, - $this->langPrefix . '_' . $view['settings']->CODE, + Config::get('lang_prefix') . '_' . $view['settings']->CODE, $view['settings']->name ); $this->setLangContent( $this->lang, - $this->langPrefix . '_' . $view['settings']->CODE + Config::get('lang_prefix') . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description ); // ICOMOON <<>> @@ -1677,47 +1678,47 @@ class Infusion extends Interpretation // DASHBOARDVIEW $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] - = $this->componentCodeName; + = Config::get('component_code_name'); // DASHBOARDICONS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASHBOARDICONS' . $this->hhh] = $this->setDashboardIcons(); // DASHBOARDICONACCESS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASHBOARDICONACCESS' . $this->hhh] = $this->setDashboardIconAccess(); // DASH_MODEL_METHODS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_MODEL_METHODS' . $this->hhh] = $this->setDashboardModelMethods(); // DASH_GET_CUSTOM_DATA - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_GET_CUSTOM_DATA' . $this->hhh] = $this->setDashboardGetCustomData(); // DASH_DISPLAY_DATA - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_DISPLAY_DATA' . $this->hhh] = $this->setDashboardDisplayData(); // DASH_VIEW_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_VIEW_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.view', 'dashboard'); // DASH_VIEW_HTML_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_VIEW_HTML_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.view.html', 'dashboard'); // DASH_MODEL_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_MODEL_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.model', 'dashboard'); // DASH_CONTROLLER_HEADER - $this->fileContentDynamic[$this->componentCodeName][$this->hhh + $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh . 'DASH_CONTROLLER_HEADER' . $this->hhh] = $this->setFileHeader('dashboard.controller', 'dashboard'); } @@ -2018,12 +2019,12 @@ class Infusion extends Interpretation // add to lang array $this->setLangContent( 'site', - $this->langPrefix . '_' . $view['settings']->CODE, + Config::get('lang_prefix') . '_' . $view['settings']->CODE, $view['settings']->name ); $this->setLangContent( 'site', - $this->langPrefix . '_' . $view['settings']->CODE + Config::get('lang_prefix') . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description ); // SITE_CUSTOM_METHODS <<>> @@ -2351,7 +2352,7 @@ class Infusion extends Interpretation // tweak system to set stuff to the module domain $_backup_target = $this->target; $_backup_lang = $this->lang; - $_backup_langPrefix = $this->langPrefix; + $_backup_langPrefix = Config::get('lang_prefix'); // infuse module data if set if (ArrayHelper::check($this->joomlaModules)) { @@ -2367,6 +2368,7 @@ class Infusion extends Interpretation $this->target = $module->key; $this->lang = $module->key; $this->langPrefix = $module->lang_prefix; + Config::set('lang_prefix', $module->lang_prefix); // MODCODE $this->fileContentDynamic[$module->key][$this->hhh . 'MODCODE' . $this->hhh] @@ -2394,7 +2396,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$module->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($module, ['debug' => $this->debugLinenr]))->get(); + = (new InstallScript($module))->get(); } // FIELDSET if (isset($module->form_files) @@ -2446,6 +2448,7 @@ class Infusion extends Interpretation $this->target = $plugin->key; $this->lang = $plugin->key; $this->langPrefix = $plugin->lang_prefix; + Config::set('lang_prefix', $plugin->lang_prefix); // MAINCLASS $this->fileContentDynamic[$plugin->key][$this->hhh . 'MAINCLASS' . $this->hhh] @@ -2456,7 +2459,7 @@ class Infusion extends Interpretation // INSTALLCLASS $this->fileContentDynamic[$plugin->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($plugin, ['debug' => $this->debugLinenr]))->get(); + = (new InstallScript($plugin))->get(); } // FIELDSET if (isset($plugin->form_files) @@ -2497,6 +2500,7 @@ class Infusion extends Interpretation $this->target = $_backup_target; $this->lang = $_backup_lang; $this->langPrefix = $_backup_langPrefix; + Config::set('lang_prefix', $_backup_langPrefix); // Trigger Event: jcb_ce_onAfterBuildFilesContent $this->triggerEvent( 'jcb_ce_onAfterBuildFilesContent', @@ -2649,20 +2653,20 @@ class Infusion extends Interpretation if ($this->setLangAdmin()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['admin'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] ); $mainLangLoader['admin'] = count( - $this->languages['components'][$this->langTag]['admin'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] ); } // check the admin system lang is set if ($this->setLangAdminSys()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['adminsys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] ); $mainLangLoader['adminsys'] = count( - $this->languages['components'][$this->langTag]['adminsys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] ); } // check the site lang is set @@ -2670,10 +2674,10 @@ class Infusion extends Interpretation && $this->setLangSite()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['site'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] ); $mainLangLoader['site'] = count( - $this->languages['components'][$this->langTag]['site'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] ); } // check the site system lang is set @@ -2681,19 +2685,19 @@ class Infusion extends Interpretation && $this->setLangSiteSys()) { $values[] = array_values( - $this->languages['components'][$this->langTag]['sitesys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] ); $mainLangLoader['sitesys'] = count( - $this->languages['components'][$this->langTag]['sitesys'] + $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] ); } $values = array_unique(ArrayHelper::merge($values)); // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); // update insert the current lang in to DB - $this->setLangPlaceholders($values, $this->componentID); + $this->setLangPlaceholders($values, Config::get('component_id')); // remove old unused language strings - $this->purgeLanuageStrings($values, $this->componentID); + $this->purgeLanuageStrings($values, Config::get('component_id')); // path to INI file $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles @@ -2730,7 +2734,7 @@ class Infusion extends Interpretation $t = '.sys'; } // build the file name - $file_name = $tag . '.com_' . $this->componentCodeName . $t + $file_name = $tag . '.com_' . Config::get('component_code_name') . $t . '.ini'; // check if language should be added if ($this->shouldLanguageBeAdded( @@ -2796,7 +2800,7 @@ class Infusion extends Interpretation = implode(PHP_EOL . $this->_t(2), $langXML['site']); } // build xml path - $xmlPath = $this->componentPath . '/' . $this->componentCodeName + $xmlPath = $this->componentPath . '/' . Config::get('component_code_name') . '.xml'; // get the content in xml $componentXML = FileHelper::getContent( diff --git a/admin/models/forms/power.xml b/admin/models/forms/power.xml index 718caf46b..1b98c8959 100644 --- a/admin/models/forms/power.xml +++ b/admin/models/forms/power.xml @@ -297,8 +297,8 @@ type="text" name="implements_custom" label="COM_COMPONENTBUILDER_POWER_IMPLEMENTS_CUSTOM_LABEL" - size="10" - maxlength="50" + size="50" + maxlength="150" description="COM_COMPONENTBUILDER_POWER_IMPLEMENTS_CUSTOM_DESCRIPTION" class="text_area span12" filter="STRING" diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index a9422cda5..15782757b 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1967,7 +1967,7 @@ INSERT INTO `#__componentbuilder_joomla_component` (`id`, `add_license`, `licens -- INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `extends`, `extends_custom`, `guid`, `head`, `implements`, `implements_custom`, `load_selection`, `main_class_code`, `method_selection`, `name`, `namespace`, `power_version`, `property_selection`, `system_name`, `type`, `use_selection`, `params`, `published`, `created`, `modified`, `version`, `ordering`) VALUES -(1, '', 'Basic shared utilities, a legacy implementation\r\n\r\n@since 3.0.9', '', '', '79d765b3-7319-4988-9730-446c7f347020', '', '', '', '{\"load_selection0\":{\"load\":\"1d929017-a5de-4e0f-9b5a-838934857e26\"}}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIGhhdmUgYSBzdHJpbmcgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0ICAgIHN0cmluZyAgJHN0cmluZyBUaGUgc3RyaW5nIHRvIGNoZWNrDQoJICoNCgkgKiBAcmV0dXJucyBib29sIHRydWUgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKg0KCSAqIEBkZXByZWNhdGVkICA0LjAgLSBVc2UgU3RyaW5nSGVscGVyOjpjaGVjaygkc3RyaW5nKTsNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGNoZWNrU3RyaW5nKCRzdHJpbmcpOiBib29sDQoJew0KCQlyZXR1cm4gU3RyaW5nSGVscGVyOjpjaGVjaygkc3RyaW5nKTsNCgl9DQoNCgkvKioNCgkgKiBTaG9ydGVuIGEgc3RyaW5nDQoJICoNCgkgKiBAaW5wdXQgICAgc3Rya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OiRvcHRpb24gPSAkb3B0aW9uOw0KCQl9DQoJfQ0K', '{}', 'Utilities', 'VDM\\Joomla\\Utilities', '1.0.0', '{}', 'Utilities', 'trait', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"91004529-94a9-4590-b842-e7c6b624ecf5\",\"as\":\"default\"},\"use_selection4\":{\"use\":\"152c8793-8b75-4715-996a-257b9f65451c\",\"as\":\"default\"},\"use_selection5\":{\"use\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\",\"as\":\"default\"},\"use_selection6\":{\"use\":\"9c513baf-b279-43fd-ae29-a585c8cbc4f0\",\"as\":\"default\"},\"use_selection7\":{\"use\":\"a223b31e-ea1d-4cdf-92ae-5f9becffaff0\",\"as\":\"default\"},\"use_selection8\":{\"use\":\"9ef0eb24-aae4-4f5a-99af-d724db44808f\",\"as\":\"default\"},\"use_selection9\":{\"use\":\"a8935cbe-7701-40dc-bfd5-675f2d600954\",\"as\":\"default\"},\"use_selection10\":{\"use\":\"30c5b4c2-f75f-4d15-869a-f8bfedd87358\",\"as\":\"default\"},\"use_selection11\":{\"use\":\"ce8cf834-6bac-44fb-941c-861f7e046cc0\",\"as\":\"default\"},\"use_selection12\":{\"use\":\"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6\",\"as\":\"default\"},\"use_selection13\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2021-11-06 13:25:19', '2022-08-20 15:18:05', 70, 1), +(1, '', 'Basic shared utilities, a legacy implementation\r\n\r\n@since 3.0.9', '', '', '79d765b3-7319-4988-9730-446c7f347020', '', '', '', '{\"load_selection1\":{\"load\":\"d910d8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GVIZWxwZXI6OmV4aXN0cygkcGF0aCk7DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiB1cmxFeGlzdHMoJHBhdGgpDQoJew0KCQlyZXR1cm4gRmlsZUhlbHBlcjo6ZXhpc3RzKCRwYXRoKTsNCgl9DQoNCgkvKioNCgkgKiBTZXQgdGhlIGNvbXBvbmVudCBvcHRpb24NCgkgKg0KCSAqIEBwYXJhbSAgIFN0cmluZ3xudWxsICAgICAgICRvcHRpb24gICAgVGhlIG9wdGlvbiBmb3IgdGhlIGNvbXBvbmVudC4NCgkgKg0KCSAqIEBzaW5jZSAgMy4wLjExDQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBzZXRDb21wb25lbnRPcHRpb24oJG9wdGlvbiA9IG51bGwpDQoJew0KCQkvLyBzZXQgdGhlIGxvY2FsIGNvbXBvbmVudCBvcHRpb24NCgkJaWYgKGVtcHR5KCRvcHRpb24pKQ0KCQl7DQoJCQlpZiAoZW1wdHkoSGVscGVyOjokb3B0aW9uKSAmJiBwcm9wZXJ0eV9leGlzdHMoX19DTEFTU19fLCAnQ29tcG9uZW50Q29kZU5hbWUnKSkNCgkJCXsNCgkJCQlIZWxwZXI6OiRvcHRpb24gPSAnY29tXycgLiBzZWxmOjokQ29tcG9uZW50Q29kZU5hbWU7DQoJCQl9DQoJCX0NCgkJZWxzZQ0KCQl7DQoJCQlIZWxwZXI6OiRvcHRpb24gPSAkb3B0aW9uOw0KCQl9DQoJfQ0K', '{}', 'Utilities', 'VDM\\Joomla\\Utilities', '1.0.0', '{}', 'Utilities', 'trait', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"},\"use_selection2\":{\"use\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\",\"as\":\"default\"},\"use_selection3\":{\"use\":\"91004529-94a9-4590-b842-e7c6b624ecf5\",\"as\":\"default\"},\"use_selection4\":{\"use\":\"152c8793-8b75-4715-996a-257b9f65451c\",\"as\":\"default\"},\"use_selection5\":{\"use\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\",\"as\":\"default\"},\"use_selection6\":{\"use\":\"9c513baf-b279-43fd-ae29-a585c8cbc4f0\",\"as\":\"default\"},\"use_selection7\":{\"use\":\"a223b31e-ea1d-4cdf-92ae-5f9becffaff0\",\"as\":\"default\"},\"use_selection8\":{\"use\":\"9ef0eb24-aae4-4f5a-99af-d724db44808f\",\"as\":\"default\"},\"use_selection9\":{\"use\":\"a8935cbe-7701-40dc-bfd5-675f2d600954\",\"as\":\"default\"},\"use_selection10\":{\"use\":\"30c5b4c2-f75f-4d15-869a-f8bfedd87358\",\"as\":\"default\"},\"use_selection11\":{\"use\":\"ce8cf834-6bac-44fb-941c-861f7e046cc0\",\"as\":\"default\"},\"use_selection12\":{\"use\":\"3cf76fbf-fd95-4a33-878e-7aff6d36b7f6\",\"as\":\"default\"},\"use_selection13\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2021-11-06 13:25:19', '2022-08-20 21:09:53', 71, 1), (5, 1, '', '', '', 'db4a1e4d-be59-4e87-8b4d-c40512752232', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwIGFzIEJhc2VIdHRwOw0KdXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwRmFjdG9yeTsNCnVzZSBKb29tbGFcUmVnaXN0cnlcUmVnaXN0cnk7', '', '', '{\"load_selection0\":{\"load\":\"aa253bac-f4b4-41b4-8ace-071a73fc4d96\"},\"load_selection1\":{\"load\":\"c65aaf1f-817c-49a2-8202-282e3904f5b1\"},\"load_selection2\":{\"load\":\"51195163-1e87-4251-b755-a03c376798a6\"},\"load_selection3\":{\"load\":\"ef011ee1-64f0-4048-b013-777473b727dd\"},\"load_selection4\":{\"load\":\"c4a188de-ad78-4a6d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cHJvZHVjZWQgYW4gaW52YWxpZCBjbGFzcyBuYW1lOiAlcycsICRuYW1lLCAkY2xhc3MpKTsNCgl9DQoNCgkvKioNCgkgKiBHZXQgYW4gb3B0aW9uIGZyb20gdGhlIEdpdGVhIGluc3RhbmNlLg0KCSAqDQoJICogQHBhcmFtICAgc3RyaW5nICAka2V5ICBUaGUgbmFtZSBvZiB0aGUgb3B0aW9uIHRvIGdldC4NCgkgKg0KCSAqIEByZXR1cm4gIG1peGVkICBUaGUgb3B0aW9uIHZhbHVlLg0KCSAqDQoJICogQHNpbmNlICAgMS4wDQoJICovDQoJcHVibGljIGZ1bmN0aW9uIGdldE9wdGlvbigka2V5KQ0KCXsNCgkJcmV0dXJuIGlzc2V0KCR0aGlzLT5vcHRpb25zWyRrZXldKSA/ICR0aGlzLT5vcHRpb25zWyRrZXldIDogbnVsbDsNCgl9DQoNCgkvKioNCgkgKiBTZXQgYW4gb3B0aW9uIGZvciB0aGUgR2l0ZWEgaW5zdGFuY2UuDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRrZXkgICAgVGhlIG5hbWUgb2YgdGhlIG9wdGlvbiB0byBzZXQuDQoJICogQHBhcmFtICAgbWl4ZWQgICAkdmFsdWUgIFRoZSBvcHRpb24gdmFsdWUgdG8gc2V0Lg0KCSAqDQoJICogQHJldHVybiAgR2l0ZWEgIFRoaXMgb2JqZWN0IGZvciBtZXRob2QgY2hhaW5pbmcuDQoJICoNCgkgKiBAc2luY2UgICAxLjANCgkgKi8NCglwdWJsaWMgZnVuY3Rpb24gc2V0T3B0aW9uKCRrZXksICR2YWx1ZSkNCgl7DQoJCSR0aGlzLT5vcHRpb25zWyRrZXldID0gJHZhbHVlOw0KDQoJCXJldHVybiAkdGhpczsNCgl9DQo=', '{}', 'Gitea', 'VDM\\Gitea\\Gitea', '1.0.0', '{}', 'Gitea', 'class', '{}', '', 1, '2021-12-03 14:18:38', '2022-07-09 13:56:22', 27, 4), (6, 1, '', '', '', 'aa253bac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Z2UpID8gJGVycm9yLT5tZXNzYWdlIDogJ0ludmFsaWQgcmVzcG9uc2UgcmVjZWl2ZWQgZnJvbSBHaXRlYS4nOw0KDQoJCQl0aHJvdyBuZXcgXERvbWFpbkV4Y2VwdGlvbigkbWVzc2FnZSwgJHJlc3BvbnNlLT5jb2RlKTsNCgkJfQ0KDQoJCWlmIChKc29uSGVscGVyOjpjaGVjaygkcmVzcG9uc2UtPmJvZHkpKQ0KCQl7DQoJCQkkYm9keSA9IGpzb25fZGVjb2RlKCRyZXNwb25zZS0+Ym9keSk7DQoNCgkJCWlmIChpc3NldCgkYm9keS0+Y29udGVudF9iYXNlNjQpKQ0KCQkJew0KCQkJCSRib2R5LT5jb250ZW50ID0gYmFzZTY0X2RlY29kZSgkYm9keS0+Y29udGVudF9iYXNlNjQpOw0KCQkJfQ0KCQl9DQoJCWVsc2UNCgkJew0KCQkJJGJvZHkgPSAkcmVzcG9uc2UtPmJvZHk7DQoJCX0NCg0KCQlyZXR1cm4gJGJvZHk7DQoJfQ0K', '{}', 'AbstractGiteaObject', 'VDM\\Gitea\\AbstractGiteaObject', '1.0.0', '{}', 'Abstract Gitea Object', 'abstract class', '{\"use_selection0\":{\"use\":\"4b225c51-d293-48e4-b3f6-5136cf5c3f18\",\"as\":\"default\"}}', '', 1, '2021-12-03 16:00:26', '2022-07-09 12:15:49', 20, 4), (7, 1, '', 'aa253bac-f4b4-41b4-8ace-071a73fc4d96', '', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwIGFzIEJhc2VIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIENvbnN0cnVjdG9yLg0KCSAqDQoJICogQHBhcmFtICAgUmVnaXN0cnkgICRvcHRpb25zICBHaXRlYSBvcHRpb25zIG9iamVjdC4NCgkgKiBAcGFyYW0gICBIdHRwICAgICAgJGNsaWVudCAgIFRoZS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ludmFsaWQgY2xhc3MgbmFtZTogJTIkcyBpbiBwYWNrYWdlICUzJHMnLA0KCQkJCQkkbmFtZSwgJGNsYXNzLCAkdGhpcy0+cGFja2FnZQ0KCQkJCSkNCgkJCSk7DQoJCX0NCg0KCQlpZiAoaXNzZXQoJHRoaXMtPiRuYW1lKSA9PSBmYWxzZSkNCgkJew0KCQkJJHRoaXMtPiRuYW1lID0gbmV3ICRjbGFzcygkdGhpcy0+b3B0aW9ucywgJHRoaXMtPmNsaWVudCk7DQoJCX0NCg0KCQlyZXR1cm4gJHRoaXMtPiRuYW1lOw0KCX0NCg==', '{}', 'AbstractPackage', 'VDM\\Gitea\\AbstractPackage', '1.0.0', '{}', 'Abstract Gitea Package', 'abstract class', '{}', '', 1, '2021-12-03 16:03:06', '2022-05-27 08:31:35', 15, 4), diff --git a/componentbuilder.xml b/componentbuilder.xml index 0f9ee68f5..4a6de3979 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 20th August, 2022 + 21st August, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php new file mode 100644 index 000000000..96d8cbcbb --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -0,0 +1,178 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\Registry\Registry; +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\StringHelper; + + +/** + * Compiler Configurations Registry + * + * @since 3.1.6 + */ +class Config extends Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable +{ + /** + * The Params + * + * @var Registry + * @since 3.1.6 + */ + protected Registry $params; + + /** + * Constructor + * + * @param array $config The data to bind to the new Config object. + * @param Registry $params The component parameters + * + * @since 3.1.6 + */ + public function __construct(array $config, ?Registry $params = null) + { + // Set the params + $this->params = $params ?: Helper::getParams('com_componentbuilder'); + + // Instantiate the internal data object. + $this->data = new \stdClass; + + // Load the config to the data object + $this->bindData($this->data, $this->modelConfig($config)); + } + + /** + * model the configuration data array + * + * @param array $config The data to bind to the new Config object. + * + * @return array + * @since 3.1.6 + */ + protected function modelConfig(array $config): array + { + // we do not yet have this set as an option + $config['remove_line_breaks'] + = 2; // 2 is global (use the components value) + + // set the minfy switch of the JavaScript + $config['minify'] = (isset($config['minify']) && $config['minify'] != 2) + ? $config['minify'] : $this->params->get('minify', 0); + + // set the global language + $config['lang_tag'] = $this->params->get('language', 'en-GB'); + + // check if we have Tidy enabled + $config['tidy'] = extension_loaded('Tidy'); + + // set the field type builder + $config['field_builder_type'] = $this->params->get( + 'compiler_field_builder_type', 2 + ); + + // load the compiler path + $config['compiler_path'] = $this->params->get( + 'compiler_folder_path', + JPATH_COMPONENT_ADMINISTRATOR . '/compiler' + ); + + // load the jcb powers path + $config['jcb_powers_path'] = $this->params->get( + 'jcb_powers_path', + 'libraries/jcb_powers'); + + // set the component ID + $config['component_id'] = (int)$config['component']; + // TODO set up stream correctly + unset($config['component']); + + // set this components code name + if ($name_code = GetHelper::var( + 'joomla_component', $config['component_id'], 'id', 'name_code' + )) { + // set lang prefix + $config['lang_prefix'] = 'COM_' . StringHelper::safe( + $name_code, 'U' + ); + + // set component code name + $config['component_code_name'] = StringHelper::safe( + $name_code + ); + + // set component context + $config['component_context'] = $config['component_code_name'] . '.' + . $config['component_id']; + + // set the component name length + $config['component_code_name_length'] = strlen( + $config['component_code_name'] + ); + + // add assets table fix + $global = (int)$this->params->get( + 'assets_table_fix', 1 + ); + $config['add_assets_table_fix'] = (($add_assets_table_fix + = (int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'assets_table_fix' + )) == 3) ? $global : $add_assets_table_fix; + + // set if language strings line breaks should be removed + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'remove_line_breaks' + ) == 1) ? true : false; + $config['remove_line_breaks'] = ((int)$config['remove_line_breaks'] + == 0) + ? false + : (((int)$config['remove_line_breaks'] == 1) ? true + : $global); + + // set if placeholders should be added to customcode + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'add_placeholders' + ) == 1) ? true : false; + $config['add_placeholders'] = ((int)$config['placeholders'] == 0) + ? false + : (((int)$config['placeholders'] == 1) ? true : $global); + // TODO set up stream correctly + unset($config['placeholders']); + + // set if line numbers should be added to comments + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'debug_linenr' + ) == 1) ? true : false; + $config['debug_line_nr'] = ((int)$config['debuglinenr'] == 0) ? false + : (((int)$config['debuglinenr'] == 1) ? true : $global); + + // set if powers should be added to component (default is true) + $global = ((int)GetHelper::var( + 'joomla_component', $config['component_id'], 'id', + 'add_powers' + ) == 1) ? true : false; + $config['add_power'] = (isset($config['powers']) && (int)$config['powers'] == 0) + ? false : ((isset($config['powers']) && (int)$config['powers'] == 1) ? true : $global); + // TODO set up stream correctly + unset($config['powers']); + } + + return $config; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/index.html similarity index 100% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/index.html rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/index.html diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php index b4287f1c3..0c72523fd 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php @@ -131,14 +131,8 @@ class InstallScript * Constructor * @since 3.1.5 */ - public function __construct(object $extension, ?array $config = null) + public function __construct(object $extension) { - // check if we have the debug switch TODO - move to global registry - singleton - if (isset($config['debug'])) - { - $this->debug = $config['debug']; - } - // loop over methods and types foreach ($this->methods as $method) { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php new file mode 100644 index 000000000..20fdeb033 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php @@ -0,0 +1,257 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Factory\Compiler; + + +use Joomla\CMS\Factory; +use Joomla\Registry\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Config as CompilerConfig; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Factory to load the compiler config + */ +abstract class Config +{ + /** + * Global Config object + * + * @var CompilerConfig + * @since 3.1.6 + **/ + protected static $CompilerConfig = null; + + /** + * Get a value. + * + * @param string $path Registry path (e.g. version) + * @param mixed $default Optional default value, returned if the internal value is null. + * + * @return mixed Value of entry or null + * + * @since 3.1.6 + */ + public static function get(string $path, $default = null) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + // return the value or default if none is found + return self::$CompilerConfig->get($path, $default); + } + + /** + * Check if a registry path exists. + * + * @param string $path Registry path (e.g. guid.main.0.path) + * + * @return boolean + * + * @since 3.1.6 + */ + public static function exists($path) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + // check if exists + return self::$CompilerConfig->exists($path); + } + + /** + * Method to extract a sub-registry from path + * + * @param string $path Registry path (e.g. guid.main) + * + * @return Registry Registry object (empty if no data is present) + * + * @since 3.1.6 + */ + public function extract($path) + { + if (!self::exists($path)) + { + // create config registry + return new Registry(); + } + + return self::$CompilerConfig->extract($path); + } + + /** + * Gets this object represented as an ArrayIterator. + * + * This allows the data properties to be accessed via a foreach statement. + * + * @return \ArrayIterator This object represented as an ArrayIterator. + * + * @see IteratorAggregate::getIterator() + * @since 3.1.6 + */ + #[\ReturnTypeWillChange] + public static function getIterator() + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + return self::$CompilerConfig->getIterator(); + } + + /** + * Set a registry value. + * + * @param string $path Registry Path (e.g. guid.main.0.url) + * @param mixed $value Value of entry + * @param string $separator The key separator + * + * @return mixed The value of the that has been set. + * + * @since 3.1.6 + */ + public static function set($path, $value, $separator = null) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + self::$CompilerConfig->set($path, $value, $separator); + } + + /** + * Delete a registry value + * + * @param string $path Registry Path (e.g. guid.main.0.url) + * + * @return mixed The value of the removed node or null if not set + * + * @since 3.1.6 + */ + public static function remove($path) + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + // remove the actual value + return self::$CompilerConfig->remove($path); + } + + /** + * Transforms a namespace to an array + * + * @return array An associative array holding the namespace data + * + * @since 3.1.6 + */ + public static function toArray() + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + return self::$CompilerConfig->toArray(); + } + + /** + * Transforms a namespace to an object + * + * @return object An an object holding the namespace data + * + * @since 3.1.6 + */ + public static function toObject() + { + // check that if we already have config registry set + if (!self::$CompilerConfig) + { + // create config registry + self::$CompilerConfig = self::create(); + } + + return self::$CompilerConfig->toObject(); + } + + /** + * Initialize a CompilerConfig object if id does not exist. + * + * Returns the global {@link CompilerConfig} object, only creating it if it doesn't already exist. + * + * @param array $config The data to bind to the new Config object. + * + * + * @return CompilerConfig object + * + * @see Session + * @since 3.1.6 + **/ + public static function init($config = null): CompilerConfig + { + if (!self::$CompilerConfig) + { + self::$CompilerConfig = self::create($config); + } + + return self::$CompilerConfig; + } + + /** + * Create a CompilerConfig object + * + * @param array $config The data to bind to the new Config object. + * + * @return CompilerConfig object + * @since 3.1.6 + * @throws \Exception + **/ + protected static function create($config = null): CompilerConfig + { + // get the session + $session = Factory::getSession(); + + // check if we have config + if (ArrayHelper::check($config)) + { + // save for later should we call this out of scope + $session->set('Componentbuilder.Compiler.Config', $config); + } + // if not found try loading it from the session + elseif (($config = $session->get('Componentbuilder.Compiler.Config', false)) === false) + { + throw new \Exception('Compiler configuration not found.'); + } + + return new CompilerConfig($config); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/index.html similarity index 100% rename from libraries/jcb_powers/VDM.Joomla/src/Utilities/index.html rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/index.html diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php index ee26fabef..e4ae1c346 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php @@ -12,6 +12,9 @@ namespace VDM\Joomla\Componentbuilder; +use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; + + /** * Add line comment * @@ -19,14 +22,6 @@ namespace VDM\Joomla\Componentbuilder; */ trait Line { - /** - * The debug switch - * - * @var bool - * @since 3.1.5 - */ - protected bool $debug = false; - /** * Set the line number in comments * @@ -37,7 +32,7 @@ trait Line */ private function setLine(int $nr): string { - if ($this->debug) + if (Config::get('debug_line_nr', false)) { return ' [' . get_called_class() . ' ' . $nr . ']'; } -- 2.45.1 From 4928a8baaf9920925722dcd8239ebc2cad3c6246 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 30 Aug 2022 17:28:41 +0200 Subject: [PATCH 05/49] Moves multiple class methods to their own power classes. Moves many compiler config values to its own config class. Updated the Expantion method to use the new config class. --- README.md | 8 +- admin/README.txt | 8 +- admin/config.xml | 14 +- admin/controllers/compiler.php | 15 +- admin/helpers/compiler.php | 228 +- admin/helpers/compiler/a_Get.php | 2814 +-- admin/helpers/compiler/b_Structure.php | 300 +- admin/helpers/compiler/c_Fields.php | 1542 +- admin/helpers/compiler/e_Interpretation.php | 15639 ++++++++-------- admin/helpers/compiler/f_Infusion.php | 1399 +- .../en-GB/en-GB.com_componentbuilder.ini | 23 +- admin/models/compiler.php | 12 +- admin/models/powers.php | 2 + admin/views/compiler/tmpl/default.php | 8 +- admin/views/compiler/view.html.php | 6 +- admin/views/powers/tmpl/default_body.php | 5 +- componentbuilder.xml | 2 +- .../Compiler/Component/Placeholder.php | 144 + .../Component}/index.html | 0 .../src/Componentbuilder/Compiler/Config.php | 543 +- .../Componentbuilder/Compiler/Customcode.php | 635 + .../Compiler/Customcode/External.php | 406 + .../Compiler/Customcode/Gui.php | 256 + .../Customcode}/index.html | 0 .../Extension/JoomlaThree}/InstallScript.php | 175 +- .../Compiler/Extension/JoomlaThree/index.html | 1 + .../src/Componentbuilder/Compiler/Factory.php | 111 + .../Compiler/Interfaces/EventInterface.php | 33 + .../Interfaces/GetScriptInterface.php} | 27 +- .../Compiler/Interfaces/InstallInterface.php | 44 + .../Compiler/Interfaces/index.html | 1 + .../Compiler/JoomlaThree/Event.php | 98 + .../Compiler/JoomlaThree/index.html | 1 + .../Componentbuilder/Compiler/Language.php | 201 + .../Compiler/Language/Extractor.php | 254 + .../Compiler/Language/index.html | 1 + .../Componentbuilder/Compiler/Placeholder.php | 262 + .../Compiler/Placeholder/Reverse.php | 243 + .../Compiler/Placeholder/index.html | 1 + .../src/Componentbuilder/Compiler/Power.php | 517 + .../Compiler/Service/Component.php | 56 + .../Compiler/Service/Config.php | 54 + .../Compiler/Service/Customcode.php | 99 + .../Compiler/Service/Event.php | 55 + .../Compiler/Service/Extension.php | 55 + .../Compiler/Service/Language.php | 78 + .../Compiler/Service/Placeholder.php | 78 + .../Compiler/Service/Power.php | 59 + .../Compiler/Service/index.html | 1 + .../Compiler/Utilities/Indent.php | 90 + .../Compiler/Utilities/Line.php | 79 + .../Compiler/Utilities/Placefix.php | 106 + .../Compiler/Utilities/index.html | 1 + .../Factory/Compiler/Config.php | 257 - .../VDM.Joomla/src/Componentbuilder/Tab.php | 58 - .../jcb_powers/VDM.Joomla/src/index.html | 1 + .../en-GB/en-GB.com_componentbuilder.ini | 15 + site/models/api.php | 27 +- 58 files changed, 14568 insertions(+), 12580 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/{Extension => Compiler/Component}/index.html (100%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/External.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Gui.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/{Factory/Compiler => Compiler/Customcode}/index.html (100%) rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/{Extension => Compiler/Extension/JoomlaThree}/InstallScript.php (66%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/{Line.php => Compiler/Interfaces/GetScriptInterface.php} (51%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/InstallInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/Extractor.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/Reverse.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Config.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Language.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Placeholder.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Line.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Placefix.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/index.html delete mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php delete mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/index.html diff --git a/README.md b/README.md index 680ab3df8..84cd3b690 100644 --- a/README.md +++ b/README.md @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st August, 2022 ++ *Last Build*: 30th August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **312270** ++ *Line count*: **319334** + *Field count*: **2002** -+ *File count*: **2057** -+ *Folder count*: **351** ++ *File count*: **2087** ++ *Folder count*: **359** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 680ab3df8..84cd3b690 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st August, 2022 ++ *Last Build*: 30th August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **312270** ++ *Line count*: **319334** + *Field count*: **2002** -+ *File count*: **2057** -+ *Folder count*: **351** ++ *File count*: **2087** ++ *Folder count*: **359** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/config.xml b/admin/config.xml index 4535b441b..974a94e8f 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -930,11 +930,11 @@ min="1" showon="development_method:2"> - + - + diff --git a/admin/controllers/compiler.php b/admin/controllers/compiler.php index 0274d1e0e..e4411c370 100644 --- a/admin/controllers/compiler.php +++ b/admin/controllers/compiler.php @@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; /** * Compiler Admin Controller @@ -89,20 +90,10 @@ class ComponentbuilderControllerCompiler extends AdminController // currently only those with admin access can compile a component if($user->authorise('core.manage', 'com_componentbuilder')) { - // get the post values - $jinput = JFactory::getApplication()->input; - $componentId = $jinput->post->get('component', 0, 'INT'); - $version = $jinput->post->get('version', 0, 'INT'); - $addBackup = $jinput->post->get('backup', 0, 'INT'); - $addRepo = $jinput->post->get('repository', 0, 'INT'); - $addPlaceholders = $jinput->post->get('placeholders', 2, 'INT'); - $addPowers = $jinput->post->get('powers', 2, 'INT'); - $debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT'); - $minify = $jinput->post->get('minify', 2, 'INT'); // include component compiler require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php'; $model = $this->getModel('compiler'); - if ($model->builder($version, $componentId, $addBackup, $addRepo, $addPlaceholders, $addPowers, $debugLinenr, $minify)) + if ($model->builder()) { $cache = JFactory::getCache('mod_menu'); $cache->clean(); @@ -123,7 +114,7 @@ class ComponentbuilderControllerCompiler extends AdminController $redirect_url = $app->getUserState('com_componentbuilder.redirect_url'); // get system messages $message = $app->getUserState('com_componentbuilder.message'); - if (empty($redirect_url) && $componentId > 0) + if (empty($redirect_url) && CFactory::_('Config')->component_id > 0) { // start new message $message = array(); diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index e4760daf5..9a37ffa38 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -20,7 +20,10 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\MathHelper; -use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; // Use the component builder autoloader ComponentbuilderHelper::autoLoader(); @@ -30,6 +33,8 @@ ComponentbuilderHelper::autoLoader(); */ class Compiler extends Infusion { + + /** * The Temp path * @@ -75,13 +80,13 @@ class Compiler extends Infusion // to check the compiler speed $this->time_start = microtime(true); // first we run the perent constructors - if (parent::__construct($config)) + if (parent::__construct()) { // set temp directory $comConfig = JFactory::getConfig(); $this->tempPath = $comConfig->get('tmp_path'); // set some folder paths in relation to distribution - if ($config['backup']) + if (CFactory::_('Config')->backup) { $this->backupPath = $this->params->get( 'backup_folder_path', $this->tempPath @@ -89,7 +94,7 @@ class Compiler extends Infusion $this->dynamicIntegration = true; } // set local repos switch - if ($config['repository']) + if (CFactory::_('Config')->repository) { $this->repoPath = $this->params->get('git_folder_path', null); } @@ -100,8 +105,7 @@ class Compiler extends Infusion $this->removeFolder($this->componentPath . '/site'); // clear form component xml $xmlPath = $this->componentPath . '/' - . $this->fileContentStatic[$this->hhh . 'component' - . $this->hhh] . '.xml'; + . $this->fileContentStatic[Placefix::_h('component')] . '.xml'; $componentXML = ComponentbuilderHelper::getFileContents( $xmlPath ); @@ -119,7 +123,7 @@ class Compiler extends Infusion $this->writeFile($xmlPath, $componentXML); } // Trigger Event: jcb_ce_onBeforeUpdateFiles - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeUpdateFiles', array(&$this->componentContext, &$this) ); @@ -129,15 +133,15 @@ class Compiler extends Infusion return false; } // Trigger Event: jcb_ce_onBeforeGetCustomCode - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeGetCustomCode', array(&$this->componentContext, &$this) ); // now insert into the new files - if ($this->getCustomCode()) + if (CFactory::_('Customcode')->load()) { // Trigger Event: jcb_ce_onBeforeAddCustomCode - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeAddCustomCode', array(&$this->componentContext, &$this) ); @@ -145,7 +149,7 @@ class Compiler extends Infusion $this->addCustomCode(); } // Trigger Event: jcb_ce_onBeforeSetLangFileData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeSetLangFileData', array(&$this->componentContext, &$this) ); @@ -184,7 +188,7 @@ class Compiler extends Infusion 'because more then %s% of the strings have been translated.', $this->percentageLanguageAdd ); - if (Config::get('debug_line_nr', false)) + if (CFactory::_('Config')->get('debug_line_nr', false)) { $whyAddedLang = JText::_( 'because the debugging mode is on. (debug line numbers)' @@ -215,12 +219,12 @@ class Compiler extends Infusion 'The SQL fix updates the #__assets table\'s column size on installation of the component and reverses it back to the Joomla default on uninstall of the component.' ); // set assets table rules column notice - if (Config::get('add_assets_table_fix')) + if (CFactory::_('Config')->add_assets_table_fix) { $this->app->enqueueMessage( JText::_('

Assets Table Notice

'), 'Notice' ); - $asset_table_fix_type = (Config::get('add_assets_table_fix') == 2) + $asset_table_fix_type = (CFactory::_('Config')->add_assets_table_fix == 2) ? 'intelligent' : 'sql'; $this->app->enqueueMessage( JText::sprintf( @@ -245,7 +249,7 @@ class Compiler extends Infusion ); } // set assets table name column warning if not set - if (!Config::get('add_assets_table_fix') && $this->addAssetsTableNameFix) + if (!CFactory::_('Config')->add_assets_table_fix && $this->addAssetsTableNameFix) { // only add if not already added if ($this->accessSize < 30) @@ -282,18 +286,18 @@ class Compiler extends Infusion // if there are plugins zip them $this->zipPlugins(); // do lang mismatch check - if (ArrayHelper::check($this->langMismatch)) + if (ArrayHelper::check(CFactory::_('Language.Extractor')->langMismatch)) { - if (ArrayHelper::check($this->langMatch)) + if (ArrayHelper::check(CFactory::_('Language.Extractor')->langMatch)) { $mismatch = array_diff( - array_unique($this->langMismatch), - array_unique($this->langMatch) + array_unique(CFactory::_('Language.Extractor')->langMismatch), + array_unique(CFactory::_('Language.Extractor')->langMatch) ); } else { - $mismatch = array_unique($this->langMismatch); + $mismatch = array_unique(CFactory::_('Language.Extractor')->langMismatch); } // set a notice if we have a mismatch if (isset($mismatch) @@ -323,7 +327,7 @@ class Compiler extends Infusion // add the mismatching issues foreach ($mismatch as $string) { - $constant = Config::get('lang_prefix') . '_' + $constant = CFactory::_('Config')->lang_prefix . '_' . StringHelper::safe($string, 'U'); $this->app->enqueueMessage( JText::sprintf( @@ -365,24 +369,6 @@ class Compiler extends Infusion return false; } - /** - * Set the line number in comments - * - * @param int $nr The line number - * - * @return void - * - */ - private function setLine($nr) - { - if (Config::get('debug_line_nr', false)) - { - return ' [Compiler ' . $nr . ']'; - } - - return ''; - } - /** * Set the dynamic data to the created fils * @@ -598,9 +584,9 @@ class Compiler extends Infusion } } // do powers if found - if (ArrayHelper::check($this->powers)) + if (ArrayHelper::check(CFactory::_('Power')->active)) { - foreach ($this->powers as $power) + foreach (CFactory::_('Power')->active as $power) { if (ObjectHelper::check($power) && isset($this->newFiles[$power->key]) @@ -641,12 +627,12 @@ class Compiler extends Infusion protected function setFileContent(&$name, &$path, &$bom, $view = null) { // Trigger Event: jcb_ce_onBeforeSetFileContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeSetFileContent', array(&$this->componentContext, &$name, &$path, &$bom, &$view) ); // set the file name - $this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $name; + $this->fileContentStatic[Placefix::_h('FILENAME')] = $name; // check if the file should get PHP opening $php = ''; if (ComponentbuilderHelper::checkFileType($name, 'php')) @@ -656,35 +642,35 @@ class Compiler extends Infusion // get content of the file $string = ComponentbuilderHelper::getFileContents($path); // Trigger Event: jcb_ce_onGetFileContents - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onGetFileContents', array(&$this->componentContext, &$string, &$name, &$path, &$bom, &$view) ); // see if we should add a BOM - if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false) + if (strpos($string, Placefix::_h('BOM')) !== false) { list($wast, $code) = explode( - $this->hhh . 'BOM' . $this->hhh, $string + Placefix::_h('BOM'), $string ); $string = $php . $bom . $code; } // set the answer - $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); + $answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic, 3); // set the dynamic answer if ($view) { - $answer = $this->setPlaceholders( + $answer = CFactory::_('Placeholder')->update( $answer, $this->fileContentDynamic[$view], 3 ); } // check if this file needs extra care :) if (isset($this->updateFileContent[$path])) { - $answer = $this->setDynamicValues($answer); + $answer = CFactory::_('Customcode')->add($answer); } // Trigger Event: jcb_ce_onBeforeSetFileContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeWriteFileContent', array(&$this->componentContext, &$answer, &$name, &$path, &$bom, &$view) @@ -805,7 +791,7 @@ class Compiler extends Infusion { foreach ($data['config'] as $key => $value) { - if ($this->hhh . 'VERSION' . $this->hhh === $key) + if (Placefix::_h('VERSION') === $key) { // hmm we sould in some way make it known that this version number // is not in relation the the project but to the file only... any ideas? @@ -825,14 +811,14 @@ class Compiler extends Infusion return true; } // else insure to reset to global - $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] - = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh + $this->fileContentStatic[Placefix::_h('CREATIONDATE')] + = $this->fileContentStatic[Placefix::_h('CREATIONDATE') . 'GLOBAL']; - $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] - = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh + $this->fileContentStatic[Placefix::_h('BUILDDATE')] + = $this->fileContentStatic[Placefix::_h('BUILDDATE') . 'GLOBAL']; - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] - = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh + $this->fileContentStatic[Placefix::_h('VERSION')] + = $this->fileContentStatic[Placefix::_h('VERSION') . 'GLOBAL']; } @@ -898,9 +884,9 @@ class Compiler extends Infusion { // set readme data if not set already if (!isset( - $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('LINE_COUNT')] ) - || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] + || $this->fileContentStatic[Placefix::_h('LINE_COUNT')] != $this->lineCount) { $this->buildReadMeData(); @@ -908,7 +894,7 @@ class Compiler extends Infusion // get the file $string = ComponentbuilderHelper::getFileContents($path); // update the file - $answer = $this->setPlaceholders($string, $this->fileContentStatic); + $answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic); // add to zip array $this->writeFile($path, $answer); } @@ -916,71 +902,71 @@ class Compiler extends Infusion private function buildReadMeData() { // set some defaults - $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('LINE_COUNT')] = $this->lineCount; - $this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('FIELD_COUNT')] = $this->fieldCount; - $this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('FILE_COUNT')] = $this->fileCount; - $this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('FOLDER_COUNT')] = $this->folderCount; - $this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('PAGE_COUNT')] = $this->pageCount; - $this->fileContentStatic[$this->hhh . 'folders' . $this->hhh] + $this->fileContentStatic[Placefix::_h('folders')] = $this->folderSeconds; - $this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh] + $this->fileContentStatic[Placefix::_h('foldersSeconds')] = $this->folderSeconds; - $this->fileContentStatic[$this->hhh . 'files' . $this->hhh] + $this->fileContentStatic[Placefix::_h('files')] = $this->fileSeconds; - $this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh] + $this->fileContentStatic[Placefix::_h('filesSeconds')] = $this->fileSeconds; - $this->fileContentStatic[$this->hhh . 'lines' . $this->hhh] + $this->fileContentStatic[Placefix::_h('lines')] = $this->lineSeconds; - $this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh] + $this->fileContentStatic[Placefix::_h('linesSeconds')] = $this->lineSeconds; - $this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh] + $this->fileContentStatic[Placefix::_h('seconds')] = $this->actualSeconds; - $this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh] + $this->fileContentStatic[Placefix::_h('actualSeconds')] = $this->actualSeconds; - $this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh] + $this->fileContentStatic[Placefix::_h('totalHours')] = $this->totalHours; - $this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh] + $this->fileContentStatic[Placefix::_h('totalDays')] = $this->totalDays; - $this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh] + $this->fileContentStatic[Placefix::_h('debugging')] = $this->secondsDebugging; - $this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh] + $this->fileContentStatic[Placefix::_h('secondsDebugging')] = $this->secondsDebugging; - $this->fileContentStatic[$this->hhh . 'planning' . $this->hhh] + $this->fileContentStatic[Placefix::_h('planning')] = $this->secondsPlanning; - $this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh] + $this->fileContentStatic[Placefix::_h('secondsPlanning')] = $this->secondsPlanning; - $this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh] + $this->fileContentStatic[Placefix::_h('mapping')] = $this->secondsMapping; - $this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh] + $this->fileContentStatic[Placefix::_h('secondsMapping')] = $this->secondsMapping; - $this->fileContentStatic[$this->hhh . 'office' . $this->hhh] + $this->fileContentStatic[Placefix::_h('office')] = $this->secondsOffice; - $this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh] + $this->fileContentStatic[Placefix::_h('secondsOffice')] = $this->secondsOffice; - $this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh] + $this->fileContentStatic[Placefix::_h('actualTotalHours')] = $this->actualTotalHours; - $this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh] + $this->fileContentStatic[Placefix::_h('actualTotalDays')] = $this->actualTotalDays; - $this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh] + $this->fileContentStatic[Placefix::_h('debuggingHours')] = $this->debuggingHours; - $this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh] + $this->fileContentStatic[Placefix::_h('planningHours')] = $this->planningHours; - $this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh] + $this->fileContentStatic[Placefix::_h('mappingHours')] = $this->mappingHours; - $this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh] + $this->fileContentStatic[Placefix::_h('officeHours')] = $this->officeHours; - $this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh] + $this->fileContentStatic[Placefix::_h('actualHoursSpent')] = $this->actualHoursSpent; - $this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh] + $this->fileContentStatic[Placefix::_h('actualDaysSpent')] = $this->actualDaysSpent; - $this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh] + $this->fileContentStatic[Placefix::_h('projectWeekTime')] = $this->projectWeekTime; - $this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh] + $this->fileContentStatic[Placefix::_h('projectMonthTime')] = $this->projectMonthTime; } @@ -995,9 +981,9 @@ class Compiler extends Infusion // set the repo path $repoFullPath = $this->repoPath . '/com_' . $this->componentData->sales_name . '__joomla_' - . Config::get('version', 3); + . CFactory::_('Config')->get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData) @@ -1007,7 +993,7 @@ class Compiler extends Infusion // set the new data Folder::copy($this->componentPath, $repoFullPath, '', true); // Trigger Event: jcb_ce_onAfterUpdateRepo - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData) @@ -1026,9 +1012,9 @@ class Compiler extends Infusion // set the repo path $repoFullPath = $this->repoPath . '/' . $module->folder_name . '__joomla_' - . Config::get('version', 3); + . CFactory::_('Config')->get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module) @@ -1042,7 +1028,7 @@ class Compiler extends Infusion $module->folder_path, $repoFullPath, '', true ); // Trigger Event: jcb_ce_onAfterUpdateRepo - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module) @@ -1063,9 +1049,9 @@ class Compiler extends Infusion // set the repo path $repoFullPath = $this->repoPath . '/' . $plugin->folder_name . '__joomla_' - . Config::get('version', 3); + . CFactory::_('Config')->get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeUpdateRepo', array(&$plugin_context, &$plugin->folder_path, &$repoFullPath, &$plugin) @@ -1079,7 +1065,7 @@ class Compiler extends Infusion $plugin->folder_path, $repoFullPath, '', true ); // Trigger Event: jcb_ce_onAfterUpdateRepo - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterUpdateRepo', array(&$plugin_context, &$plugin->folder_path, &$repoFullPath, &$plugin) @@ -1098,7 +1084,7 @@ class Compiler extends Infusion $this->filepath['component'] = $this->tempPath . '/' . $this->filepath['component-folder'] . '.zip'; // Trigger Event: jcb_ce_onBeforeZipComponent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeZipComponent', array(&$this->componentContext, &$this->componentPath, &$this->filepath['component'], &$this->tempPath, @@ -1113,7 +1099,7 @@ class Compiler extends Infusion if ($this->backupPath && $this->dynamicIntegration) { // Trigger Event: jcb_ce_onBeforeBackupZip - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBackupZip', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, @@ -1135,7 +1121,7 @@ class Compiler extends Infusion if (isset($this->componentData->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeMoveToServer', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, @@ -1151,7 +1137,7 @@ class Compiler extends Infusion } } // Trigger Event: jcb_ce_onAfterZipComponent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterZipComponent', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, &$this->componentFolderName, @@ -1190,7 +1176,7 @@ class Compiler extends Infusion $this->filepath['modules'][$module->id] = $this->tempPath . '/' . $module->zip_name . '.zip'; // Trigger Event: jcb_ce_onBeforeZipModule - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeZipModule', array(&$module_context, &$module->folder_path, &$this->filepath['modules'][$module->id], @@ -1207,7 +1193,7 @@ class Compiler extends Infusion { $__module_context = 'module.' . $module_context; // Trigger Event: jcb_ce_onBeforeBackupZip - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBackupZip', array(&$__module_context, &$this->filepath['modules'][$module->id], @@ -1229,7 +1215,7 @@ class Compiler extends Infusion if (isset($module->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeMoveToServer', array(&$__module_context, &$this->filepath['modules'][$module->id], @@ -1246,7 +1232,7 @@ class Compiler extends Infusion } } // Trigger Event: jcb_ce_onAfterZipModule - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterZipModule', array(&$module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, @@ -1284,7 +1270,7 @@ class Compiler extends Infusion $this->filepath['plugins'][$plugin->id] = $this->tempPath . '/' . $plugin->zip_name . '.zip'; // Trigger Event: jcb_ce_onBeforeZipPlugin - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeZipPlugin', array(&$plugin_context, &$plugin->folder_path, &$this->filepath['plugins'][$plugin->id], @@ -1301,7 +1287,7 @@ class Compiler extends Infusion { $__plugin_context = 'plugin.' . $plugin_context; // Trigger Event: jcb_ce_onBeforeBackupZip - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBackupZip', array(&$__plugin_context, &$this->filepath['plugins'][$plugin->id], @@ -1323,7 +1309,7 @@ class Compiler extends Infusion if (isset($plugin->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeMoveToServer', array(&$__plugin_context, &$this->filepath['plugins'][$plugin->id], @@ -1340,7 +1326,7 @@ class Compiler extends Infusion } } // Trigger Event: jcb_ce_onAfterZipPlugin - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterZipPlugin', array(&$plugin_context, &$this->filepath['plugins'][$plugin->id], &$this->tempPath, @@ -1358,9 +1344,9 @@ class Compiler extends Infusion protected function addCustomCode() { // reset all these - $this->clearFromPlaceHolders('view'); - $this->clearFromPlaceHolders('arg'); - foreach ($this->customCode as $nr => $target) + CFactory::_('Placeholder')->clearType('view'); + CFactory::_('Placeholder')->clearType('arg'); + foreach (CFactory::_('Customcode')->active as $nr => $target) { // reset each time per custom code $fingerPrint = array(); @@ -1471,13 +1457,13 @@ class Compiler extends Infusion } if ($found) { - $placeholder = $this->getPlaceHolder( + $placeholder = CFactory::_('Placeholder')->keys( (int) $target['comment_type'] . $target['type'], $target['id'] ); $data = $placeholder['start'] . PHP_EOL - . $this->setPlaceholders( - $target['code'], $this->placeholders + . CFactory::_('Placeholder')->update( + $target['code'], CFactory::_('Placeholder')->active ) . $placeholder['end'] . PHP_EOL; if ($target['type'] == 2) { @@ -1566,7 +1552,7 @@ class Compiler extends Infusion $_commentType . PHP_EOL . $commentType, $code ) . $_commentType . PHP_EOL; // get place holders - $placeholder = $this->getPlaceHolder( + $placeholder = CFactory::_('Placeholder')->keys( (int) $target['comment_type'] . $target['type'], $target['id'] ); // build the data diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index fe7727f3d..5da9bf912 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -27,7 +27,10 @@ use VDM\Joomla\Utilities\String\TypeHelper; use VDM\Joomla\Utilities\String\ClassfunctionHelper; use VDM\Joomla\Utilities\String\NamespaceHelper; use VDM\Joomla\Utilities\String\PluginHelper; -use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; /** * Get class as the main compilers class @@ -39,7 +42,7 @@ class Get * The Joomla Version * * @var string - * @deprecated 4.0 Use Config::get('version'); + * @deprecated 3.3 Use CFactory::_('Config')->joomla_version; */ public $joomlaVersion; @@ -57,6 +60,7 @@ class Get * The hash placeholder * * @var string + * @deprecated 3.3 Use Placefix::h(); */ public $hhh = '#' . '#' . '#'; @@ -64,6 +68,7 @@ class Get * The open bracket placeholder * * @var string + * @deprecated 3.3 Use Placefix::b(); */ public $bbb = '[' . '[' . '['; @@ -71,6 +76,7 @@ class Get * The close bracket placeholder * * @var string + * @deprecated 3.3 Use Placefix::d(); */ public $ddd = ']' . ']' . ']'; @@ -106,6 +112,7 @@ class Get * The global placeholders * * @var array + * @deprecated 3.3 Use CFactory::_('Component.Placeholder')->get(); */ public $globalPlaceholders = array(); @@ -113,6 +120,7 @@ class Get * The placeholders * * @var array + * @deprecated 3.3 Use CFactory::_('Placeholder')->active[]; */ public $placeholders = array(); @@ -120,7 +128,7 @@ class Get * The Compiler Path * * @var object - * @deprecated 4.0 Use Config::get('compiler_path'); + * @deprecated 3.3 Use CFactory::_('Config')->compiler_path; */ public $compilerPath; @@ -128,7 +136,7 @@ class Get * The JCB Powers Path * * @var object - * @deprecated 4.0 Use Config::get('jcb_powers_path'); + * @deprecated 3.3 Use CFactory::_('Config')->jcb_powers_path; */ public $jcbPowersPath; @@ -136,7 +144,7 @@ class Get * Switch to add assets table fix * * @var int - * @deprecated 4.0 Use Config::get('add_assets_table_fix'); + * @deprecated 3.3 Use CFactory::_('Config')->add_assets_table_fix; */ public $addAssetsTableFix = 1; @@ -158,7 +166,7 @@ class Get * Switch to add custom code placeholders * * @var bool - * @deprecated 4.0 Use Config::get('add_placeholders'); + * @deprecated 3.3 Use CFactory::_('Config')->add_placeholders; */ public $addPlaceholders = false; @@ -166,7 +174,7 @@ class Get * Switch to remove line breaks from language strings * * @var bool - * @deprecated 4.0 Use Config::get('remove_line_breaks'); + * @deprecated 3.3 Use CFactory::_('Config')->remove_line_breaks; */ public $removeLineBreaks = false; @@ -174,6 +182,7 @@ class Get * The placeholders for custom code keys * * @var array + * @deprecated 3.3 */ protected $customCodeKeyPlacholders = array( @@ -195,7 +204,7 @@ class Get * The Switch to add Powers data * * @var boolean - * @deprecated 4.0 Use Config::get('add_power'); + * @deprecated 3.3 Use CFactory::_('Config')->add_power; */ public $addPower; @@ -203,6 +212,7 @@ class Get * The Powers data * * @var array + * @deprecated 3.3 Use CFactory::_('Power')->active; */ public $powers = array(); @@ -210,6 +220,7 @@ class Get * The state of all Powers * * @var array + * @deprecated 3.3 */ public $statePowers = array(); @@ -279,6 +290,7 @@ class Get * The custom code to be added * * @var array + * @deprecated 3.3 Use CFactory::_('Customcode')->active */ public $customCode; @@ -286,6 +298,7 @@ class Get * The custom code to be added * * @var array + * @deprecated 3.3 */ protected $customCodeData = array(); @@ -293,6 +306,7 @@ class Get * The function name memory ids * * @var array + * @deprecated 3.3 Use CFactory::_('Customcode')->functionNameMemory */ public $functionNameMemory = array(); @@ -300,6 +314,7 @@ class Get * The custom code for local memory * * @var array + * @deprecated 3.3 Use CFactory::_('Customcode')->memory */ public $customCodeMemory = array(); @@ -328,6 +343,7 @@ class Get * The external code/string to be added * * @var array + * @deprecated 3.3 */ protected $externalCodeString = array(); @@ -335,6 +351,7 @@ class Get * The external code/string cutter * * @var array + * @deprecated 3.3 */ protected $externalCodeCutter = array(); @@ -342,7 +359,7 @@ class Get * The line numbers Switch * * @var boolean - * @deprecated 4.0 Use Config::get('debug_line_nr'); + * @deprecated 3.3 Use CFactory::_('Config')->debug_line_nr; */ public $debugLinenr = false; @@ -357,7 +374,7 @@ class Get * The Placholder Language prefix * * @var string - * @deprecated 4.0 Use Config::get('lang_prefix'); + * @deprecated 3.3 Use CFactory::_('Config')->lang_prefix; */ public $langPrefix; @@ -365,6 +382,7 @@ class Get * The Language content * * @var array + * @deprecated 3.3 */ public $langContent = array(); @@ -381,7 +399,7 @@ class Get * The Main Languages * * @var string - * @deprecated 4.0 Use Config::get('lang_tag'); + * @deprecated 3.3 Use CFactory::_('Config')->lang_tag; */ public $langTag = 'en-GB'; @@ -410,6 +428,7 @@ class Get * The Language JS matching check * * @var array + * @deprecated 3.3 Use CFactory::_('Language.Extractor')->langMismatch; */ public $langMismatch = array(); @@ -417,6 +436,7 @@ class Get * The Language SC matching check * * @var array + * @deprecated 3.3 Use CFactory::_('Language.Extractor')->langMatch; */ public $langMatch = array(); @@ -424,6 +444,7 @@ class Get * The Language string targets * * @var array + * @deprecated 3.3 Use CFactory::_('Config')->lang_string_targets; */ public $langStringTargets = array( @@ -438,7 +459,7 @@ class Get * The Component Code Name * * @var string - * @deprecated 4.0 Use Config::get('component_code_name'); + * @deprecated 3.3 Use CFactory::_('Config')->component_code_name; */ public $componentCodeName; @@ -446,7 +467,7 @@ class Get * The Component Context * * @var string - * @deprecated 4.0 Use Config::get('component_context'); + * @deprecated 3.3 Use CFactory::_('Config')->component_context; */ public $componentContext; @@ -454,7 +475,7 @@ class Get * The Component Code Name Length * * @var int - * @deprecated 4.0 Use Config::get('component_code_name_length'); + * @deprecated 3.3 Use CFactory::_('Config')->component_code_name_length; */ public $componentCodeNameLength; @@ -462,7 +483,7 @@ class Get * The Component ID * * @var int - * @deprecated 4.0 Use Config::get('component_id'); + * @deprecated 3.3 Use CFactory::_('Config')->component_id; */ public $componentID; @@ -582,6 +603,7 @@ class Get * The Language target * * @var string + * @deprecated 3.3 Use CFactory::_('Config')->lang_target; */ public $lang = 'admin'; @@ -589,6 +611,7 @@ class Get * The lang keys for extentions * * @var array + * @deprecated 3.3 Use CFactory::_('Language.Extractor')->langKeys; */ public $langKeys = array(); @@ -596,6 +619,7 @@ class Get * The Build target Switch * * @var string + * @deprecated 3.3 Use CFactory::_('Config')->build_target; */ public $target; @@ -690,7 +714,7 @@ class Get * 2 = SimpleXMLElement * * @var int - * @deprecated 4.0 Use Config::get('field_builder_type'); + * @deprecated 3.3 Use CFactory::_('Config')->field_builder_type; */ public $fieldBuilderType; @@ -903,7 +927,7 @@ class Get * Is minify Enabled * * @var int - * @deprecated 4.0 Use Config::get('minify'); + * @deprecated 3.3 Use CFactory::_('Config')->minify; */ public $minify = 0; @@ -911,7 +935,7 @@ class Get * Is Tidy Enabled * * @var bool - * @deprecated 4.0 Use Config::get('tidy'); + * @deprecated 3.3 Use CFactory::_('Config')->tidy; */ public $tidy = false; @@ -942,18 +966,12 @@ class Get */ public $mysqlTableSetting = array(); - /** - * event plugin trigger switch - * - * @var boolean - */ - protected $active_plugins = false; - /** * Constructor */ - public function __construct($config = array()) + public function __construct() { + echo '
';
 		// we do not yet have this set as an option
 		$config['remove_line_breaks']
 			= 2; // 2 is global (use the components value)
@@ -961,42 +979,24 @@ class Get
 		$this->app = JFactory::getApplication();
 		// Set the params
 		$this->params = JComponentHelper::getParams('com_componentbuilder');
-		// get active plugins
-		if (($plugins = $this->params->get('compiler_plugin', false))
-			!== false)
-		{
-			foreach ($plugins as $plugin)
-			{
-				// get possible plugins
-				if (\JPluginHelper::isEnabled('extension', $plugin))
-				{
-					// Import the appropriate plugin group.
-					\JPluginHelper::importPlugin('extension', $plugin);
-					// activate events
-					$this->active_plugins = true;
-				}
-			}
-		}
 		// Trigger Event: jcb_ce_onBeforeGet
-		$this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, &$this));
-		// load the global config
-		Config::init($config);
+		CFactory::_J('Event')->trigger('jcb_ce_onBeforeGet', array(&$config, &$this));
 		// set the Joomla version @deprecated
-		$this->joomlaVersion = Config::get('version', 3);
+		$this->joomlaVersion = CFactory::_('Config')->joomla_version;
 		// set the minfy switch of the JavaScript @deprecated
-		$this->minify = Config::get('minify', 0);
+		$this->minify = CFactory::_('Config')->get('minify', 0);
 		// set the global language @deprecated @deprecated
-		$this->langTag = Config::get('lang_tag', 'en-GB');
+		$this->langTag = CFactory::_('Config')->get('lang_tag', 'en-GB');
 		// also set the helper class langTag (for safeStrings)
-		ComponentbuilderHelper::$langTag = Config::get('lang_tag', 'en-GB');
+		ComponentbuilderHelper::$langTag = CFactory::_('Config')->get('lang_tag', 'en-GB');
 		// setup the main language array
-		$this->languages['components'][Config::get('lang_tag', 'en-GB')] = array();
+		$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')] = array();
 		// check if we have Tidy enabled @deprecated
-		$this->tidy = Config::get('tidy', false);
+		$this->tidy = CFactory::_('Config')->get('tidy', false);
 		// set the field type builder @deprecated
-		$this->fieldBuilderType = Config::get('field_builder_type', 2);
+		$this->fieldBuilderType = CFactory::_('Config')->get('field_builder_type', 2);
 		// check the field builder type logic
-		if (!Config::get('tidy', false) && Config::get('field_builder_type', 2) == 2)
+		if (!CFactory::_('Config')->get('tidy', false) && CFactory::_('Config')->get('field_builder_type', 2) == 2)
 		{
 			// we do not have the tidy extension set fall back to StringManipulation
 			$this->fieldBuilderType = 1;
@@ -1010,37 +1010,37 @@ class Get
 				), 'Notice'
 			);
 		}
-		Config::set('field_builder_type', $this->fieldBuilderType);
+		CFactory::_('Config')->set('field_builder_type', $this->fieldBuilderType);
 		// load the compiler path @deprecated
-		$this->compilerPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler');
+		$this->compilerPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler');
 		// load the jcb powers path @deprecated
-		$this->jcbPowersPath = Config::get('jcb_powers_path', 'libraries/jcb_powers');
+		$this->jcbPowersPath = CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers');
 		// set the component ID @deprecated
-		$this->componentID = Config::get('component_id');
+		$this->componentID = CFactory::_('Config')->component_id;
 		// set lang prefix @deprecated
-		$this->langPrefix = Config::get('lang_prefix');
+		$this->langPrefix = CFactory::_('Config')->lang_prefix;
 		// set component code name @deprecated
-		$this->componentCodeName = Config::get('component_code_name');
+		$this->componentCodeName = CFactory::_('Config')->component_code_name;
 		// set component context @deprecated
-		$this->componentContext = Config::get('component_context');
+		$this->componentContext = CFactory::_('Config')->component_context;
 		// set the component name length @deprecated
-		$this->componentCodeNameLength = Config::get('component_code_name_length');
+		$this->componentCodeNameLength = CFactory::_('Config')->component_code_name_length;
 		// add assets table fix @deprecated
-		$this->addAssetsTableFix = Config::get('add_assets_table_fix');
+		$this->addAssetsTableFix = CFactory::_('Config')->add_assets_table_fix;
 		// set if language strings line breaks should be removed @deprecated
-		$this->removeLineBreaks = Config::get('remove_line_breaks');
+		$this->removeLineBreaks = CFactory::_('Config')->remove_line_breaks;
 		// set if placeholders should be added to customcode @deprecated
-		$this->addPlaceholders = Config::get('add_placeholders', false);
+		$this->addPlaceholders = CFactory::_('Config')->get('add_placeholders', false);
 		// set if line numbers should be added to comments @deprecated
-		$this->debugLinenr = Config::get('debug_line_nr', false);
+		$this->debugLinenr = CFactory::_('Config')->get('debug_line_nr', false);
 		// set if powers should be added to component (default is true) @deprecated
-		$this->addPower = Config::get('add_power', true);
+		$this->addPower = CFactory::_('Config')->get('add_power', true);
 		// set the current user
 		$this->user = JFactory::getUser();
 		// Get a db connection.
 		$this->db = JFactory::getDbo();
-		// get global placeholders
-		$this->globalPlaceholders = $this->getGlobalPlaceholders();
+		// get global placeholders @deprecated
+		$this->globalPlaceholders = CFactory::_('Component.Placeholder')->get();
 		// check if this component is installed on the current website
 		if ($paths = $this->getLocalInstallPaths())
 		{
@@ -1050,14 +1050,14 @@ class Get
 			$this->customCodeFactory($paths, $today);
 		}
 		// Trigger Event: jcb_ce_onBeforeGetComponentData
-		$this->triggerEvent(
+		CFactory::_J('Event')->trigger(
 			'jcb_ce_onBeforeGetComponentData',
 			array(&$this->componentContext, &$this)
 		);
 		// get the component data
 		$this->componentData = $this->getComponentData();
 		// Trigger Event: jcb_ce_onAfterGetComponentData
-		$this->triggerEvent(
+		CFactory::_J('Event')->trigger(
 			'jcb_ce_onAfterGetComponentData',
 			array(&$this->componentContext, &$this)
 		);
@@ -1092,14 +1092,14 @@ class Get
 			);
 		}
 		// get powers *+*+*+*+*+*+*+*PRO
-		$this->getPowers($this->linkedPowers);
+		CFactory::_('Power')->load($this->linkedPowers);
 		// set the percentage when a language can be added
 		$this->percentageLanguageAdd = (int) $this->params->get(
 			'percentagelanguageadd', 50
 		);
 
 		// Trigger Event: jcb_ce_onBeforeGet
-		$this->triggerEvent(
+		CFactory::_J('Event')->trigger(
 			'jcb_ce_onAfterGet', array(&$this->componentContext, &$this)
 		);
 
@@ -1120,24 +1120,6 @@ class Get
 		return ComponentbuilderHelper::_t($nr);
 	}
 
-	/**
-	 * Set the line number in comments
-	 *
-	 * @param   int  $nr  The line number
-	 *
-	 * @return  void
-	 *
-	 */
-	private function setLine($nr)
-	{
-		if (Config::get('debug_line_nr', false))
-		{
-			return ' [Get ' . $nr . ']';
-		}
-
-		return '';
-	}
-
 	/**
 	 * Trigger events
 	 *
@@ -1145,99 +1127,22 @@ class Get
 	 * @param   mix     $data   The values to pass to the event/plugin
 	 *
 	 * @return  void
-	 *
+	 * @deprecated 3.3 Use CFactory::_J('Event')->trigger($event, $data);
 	 */
 	public function triggerEvent($event, $data)
 	{
-		// only exicute if plugins were loaded (active)
-		if ($this->active_plugins)
-		{
-			// Get the dispatcher.
-			$dispatcher = \JEventDispatcher::getInstance();
-
-			// Trigger this compiler event.
-			$results = $dispatcher->trigger($event, $data);
-
-			// Check for errors encountered while trigger the event
-			if (count((array) $results) && in_array(false, $results, true))
-			{
-				// Get the last error.
-				$error = $dispatcher->getError();
-
-				if (!($error instanceof \Exception))
-				{
-					throw new \Exception($error);
-				}
-			}
-		}
+		return CFactory::_J('Event')->trigger($event, $data);
 	}
 
 	/**
 	 * get all System Placeholders
 	 *
 	 * @return  array The global placeholders
-	 *
+	 * @deprecated 3.3 Use CFactory::_('Component.Placeholder')->get();
 	 */
 	public function getGlobalPlaceholders()
 	{
-		// reset bucket
-		$bucket = array();
-		// Create a new query object.
-		$query = $this->db->getQuery(true);
-		$query->select($this->db->quoteName(array('a.target', 'a.value')));
-		// from these tables
-		$query->from('#__componentbuilder_placeholder AS a');
-		// Reset the query using our newly populated query object.
-		$this->db->setQuery($query);
-		// Load the items
-		$this->db->execute();
-		if ($this->db->getNumRows())
-		{
-			$bucket = $this->db->loadAssocList('target', 'value');
-			// open all the code
-			foreach ($bucket as $key => &$code)
-			{
-				$code = base64_decode($code);
-			}
-		}
-		// set component place holders
-		$bucket[$this->hhh . 'component' . $this->hhh]
-			                                             = Config::get('component_code_name');
-		$bucket[$this->hhh . 'Component' . $this->hhh]
-			                                             = StringHelper::safe(
-			Config::get('component_code_name'), 'F'
-		);
-		$bucket[$this->hhh . 'COMPONENT' . $this->hhh]
-			                                             = StringHelper::safe(
-			Config::get('component_code_name'), 'U'
-		);
-		$bucket[$this->bbb . 'component' . $this->ddd]   = $bucket[$this->hhh
-		. 'component' . $this->hhh];
-		$bucket[$this->bbb . 'Component' . $this->ddd]   = $bucket[$this->hhh
-		. 'Component' . $this->hhh];
-		$bucket[$this->bbb . 'COMPONENT' . $this->ddd]   = $bucket[$this->hhh
-		. 'COMPONENT' . $this->hhh];
-		$bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh] = Config::get('lang_prefix');
-		$bucket[$this->bbb . 'LANG_PREFIX' . $this->ddd] = $bucket[$this->hhh
-		. 'LANG_PREFIX' . $this->hhh];
-		// get the current components overides
-		if (($_placeholders = GetHelper::var(
-				'component_placeholders', Config::get('component_id'),
-				'joomla_component', 'addplaceholders'
-			)) !== false
-			&& JsonHelper::check($_placeholders))
-		{
-			$_placeholders = json_decode($_placeholders, true);
-			if (ArrayHelper::check($_placeholders))
-			{
-				foreach ($_placeholders as $row)
-				{
-					$bucket[$row['target']] = $row['value'];
-				}
-			}
-		}
-
-		return $bucket;
+		return CFactory::_('Component.Placeholder')->get();
 	}
 
 	/**
@@ -1307,11 +1212,11 @@ class Get
 			);
 		}
 		$query->where(
-			$this->db->quoteName('a.id') . ' = ' . (int) Config::get('component_id')
+			$this->db->quoteName('a.id') . ' = ' . (int) CFactory::_('Config')->component_id
 		);
 
 		// Trigger Event: jcb_ce_onBeforeQueryComponentData
-		$this->triggerEvent(
+		CFactory::_J('Event')->trigger(
 			'jcb_ce_onBeforeQueryComponentData',
 			array(&$this->componentContext, &$this->componentID, &$query,
 				&$this->db)
@@ -1324,7 +1229,7 @@ class Get
 		$component = $this->db->loadObject();
 
 		// Trigger Event: jcb_ce_onBeforeModelComponentData
-		$this->triggerEvent(
+		CFactory::_J('Event')->trigger(
 			'jcb_ce_onBeforeModelComponentData',
 			array(&$this->componentContext, &$component)
 		);
@@ -1336,36 +1241,36 @@ class Get
 				                                 'val'   => (int) $component->addadmin_views_id,
 				                                 'key'   => 'id'),
 				'addconfig'             => array('table' => 'component_config',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'addcustom_admin_views' => array('table' => 'component_custom_admin_views',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'addcustommenus'        => array('table' => 'component_custom_admin_menus',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'addfiles'              => array('table' => 'component_files_folders',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'addfolders'            => array('table' => 'component_files_folders',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'addsite_views'         => array('table' => 'component_site_views',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'dashboard_tab'         => array('table' => 'component_dashboard',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'sql_tweak'             => array('table' => 'component_mysql_tweaks',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component'),
 				'version_update'        => array('table' => 'component_updates',
-				                                 'val'   => (int) Config::get('component_id'),
+				                                 'val'   => (int) CFactory::_('Config')->component_id,
 				                                 'key'   => 'joomla_component')
 			),
 			'table'  => 'joomla_component',
 			'key'    => 'id',
-			'val'    => (int) Config::get('component_id')
+			'val'    => (int) CFactory::_('Config')->component_id
 		);
 		// repeatable fields to update
 		$searchRepeatables = array(
@@ -1390,7 +1295,7 @@ class Get
 		// load the global placeholders
 		if (ArrayHelper::check($this->globalPlaceholders))
 		{
-			$this->placeholders = $this->globalPlaceholders;
+			CFactory::_('Placeholder')->active = $this->globalPlaceholders;
 		}
 
 		// set component sales name
@@ -1542,8 +1447,8 @@ class Get
 			? json_decode($component->addadmin_views, true) : null;
 		if (ArrayHelper::check($component->addadmin_views))
 		{
-			$this->lang   = 'admin';
-			$this->target = 'admin';
+			CFactory::_('Config')->lang_target = 'admin';
+			CFactory::_('Config')->build_target = 'admin';
 			// sort the views according to order
 			usort(
 				$component->addadmin_views, function ($a, $b) {
@@ -1586,7 +1491,7 @@ class Get
 						&& $array['edit_create_site_view'] > 0)
 					{
 						$this->siteEditView[$array['adminview']] = true;
-						$this->lang                              = 'both';
+						CFactory::_('Config')->lang_target = 'both';
 					}
 					// set the import/export option for this view
 					if (isset($array['port']) && $array['port']
@@ -1636,8 +1541,8 @@ class Get
 			? json_decode($component->addsite_views, true) : null;
 		if (ArrayHelper::check($component->addsite_views))
 		{
-			$this->lang   = 'site';
-			$this->target = 'site';
+			CFactory::_('Config')->lang_target = 'site';
+			CFactory::_('Config')->build_target = 'site';
 			// build the site_views settings
 			$component->site_views = array_map(
 				function ($array) {
@@ -1675,8 +1580,8 @@ class Get
 			$component->addcustom_admin_views
 		))
 		{
-			$this->lang   = 'admin';
-			$this->target = 'custom_admin';
+			CFactory::_('Config')->lang_target = 'admin';
+			CFactory::_('Config')->build_target = 'custom_admin';
 			// build the custom_admin_views settings
 			$component->custom_admin_views = array_map(
 				function ($array) {
@@ -1764,7 +1669,7 @@ class Get
 			'component_admin_views', $component->addadmin_views_id
 		);
 		$old_component   = $this->getHistoryWatch(
-			'joomla_component', Config::get('component_id')
+			'joomla_component', CFactory::_('Config')->component_id
 		);
 		if ($old_component || $old_admin_views)
 		{
@@ -1805,7 +1710,7 @@ class Get
 
 		// set GUI mapper
 		$guiMapper = array('table' => 'joomla_component',
-		                   'id'    => (int) Config::get('component_id'),
+		                   'id'    => (int) CFactory::_('Config')->component_id,
 		                   'field' => 'javascript', 'type' => 'js');
 
 		// add_javascript
@@ -1849,7 +1754,7 @@ class Get
 			unset($component->{'css_' . $area});
 		}
 		// set the lang target
-		$this->lang = 'admin';
+		CFactory::_('Config')->lang_target = 'admin';
 		// add PHP in ADMIN
 		$addScriptMethods = array('php_preflight', 'php_postflight',
 			'php_method');
@@ -1892,7 +1797,7 @@ class Get
 				$component->php_helper_admin
 			))
 		{
-			$this->lang = 'admin';
+			CFactory::_('Config')->lang_target = 'admin';
 			// update GUI mapper
 			$guiMapper['field']  = 'php_helper_admin';
 			$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
@@ -1914,7 +1819,7 @@ class Get
 		if ($component->add_admin_event == 1
 			&& StringHelper::check($component->php_admin_event))
 		{
-			$this->lang = 'admin';
+			CFactory::_('Config')->lang_target = 'admin';
 			// update GUI mapper field
 			$guiMapper['field'] = 'php_admin_event';
 			$this->setCustomScriptBuilder(
@@ -1934,7 +1839,7 @@ class Get
 		if ($component->add_php_helper_both == 1
 			&& StringHelper::check($component->php_helper_both))
 		{
-			$this->lang = 'both';
+			CFactory::_('Config')->lang_target = 'both';
 			// update GUI mapper field
 			$guiMapper['field']  = 'php_helper_both';
 			$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
@@ -1955,7 +1860,7 @@ class Get
 		if ($component->add_php_helper_site == 1
 			&& StringHelper::check($component->php_helper_site))
 		{
-			$this->lang = 'site';
+			CFactory::_('Config')->lang_target = 'site';
 			// update GUI mapper field
 			$guiMapper['field']  = 'php_helper_site';
 			$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
@@ -1977,7 +1882,7 @@ class Get
 		if ($component->add_site_event == 1
 			&& StringHelper::check($component->php_site_event))
 		{
-			$this->lang = 'site';
+			CFactory::_('Config')->lang_target = 'site';
 			// update GUI mapper field
 			$guiMapper['field'] = 'php_site_event';
 			$this->setCustomScriptBuilder(
@@ -2015,17 +1920,17 @@ class Get
 		// bom
 		if (StringHelper::check($component->bom))
 		{
-			$this->bomPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $component->bom;
+			$this->bomPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $component->bom;
 		}
 		else
 		{
-			$this->bomPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/default.txt';
+			$this->bomPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/default.txt';
 		}
 		unset($component->bom);
 		// README
 		if ($component->addreadme)
 		{
-			$component->readme = $this->setDynamicValues(
+			$component->readme = CFactory::_('Customcode')->add(
 				base64_decode($component->readme)
 			);
 		}
@@ -2035,8 +1940,8 @@ class Get
 		}
 
 		// set lang now
-		$nowLang    = $this->lang;
-		$this->lang = 'admin';
+		$nowLang    = CFactory::_('Config')->lang_target;
+		CFactory::_('Config')->lang_target = 'admin';
 		// dashboard methods
 		$component->dashboard_tab = (isset($component->dashboard_tab)
 			&& JsonHelper::check($component->dashboard_tab))
@@ -2045,7 +1950,7 @@ class Get
 		{
 			$component->dashboard_tab = array_map(
 				function ($array) {
-					$array['html'] = $this->setDynamicValues($array['html']);
+					$array['html'] = CFactory::_('Customcode')->add($array['html']);
 
 					return $array;
 				}, array_values($component->dashboard_tab)
@@ -2062,8 +1967,8 @@ class Get
 			))
 		{
 			// load the php for the dashboard model
-			$component->php_dashboard_methods = $this->setGuiCodePlaceholder(
-				$this->setDynamicValues(
+			$component->php_dashboard_methods = CFactory::_('Customcode.Gui')->set(
+				CFactory::_('Customcode')->add(
 					base64_decode($component->php_dashboard_methods)
 				),
 				array(
@@ -2078,7 +1983,7 @@ class Get
 			$component->php_dashboard_methods = '';
 		}
 		// reset back to nowlang
-		$this->lang = $nowLang;
+		CFactory::_('Config')->lang_target = $nowLang;
 
 		// add the update/sales server FTP details if that is the expected protocol
 		$serverArray = array('update_server', 'sales_server');
@@ -2173,7 +2078,7 @@ class Get
 		unset($component->addjoomla_plugins);
 
 		// Trigger Event: jcb_ce_onAfterModelComponentData
-		$this->triggerEvent(
+		CFactory::_J('Event')->trigger(
 			'jcb_ce_onAfterModelComponentData',
 			array(&$this->componentContext, &$component)
 		);
@@ -2191,26 +2096,14 @@ class Get
 	 * @param   boolean  $addPrefix  The switch to add langPrefix
 	 *
 	 * @return  void
+	 * @deprecated 3.3 Use CFactory::_('Language')->set($target, $language, $string, $addPrefix);
 	 *
 	 */
 	public function setLangContent($target, $language, $string,
 	                               $addPrefix = false
 	)
 	{
-		if ($addPrefix
-			&& !isset(
-				$this->langContent[$target][Config::get('lang_prefix') . '_' . $language]
-			))
-		{
-			$this->langContent[$target][Config::get('lang_prefix') . '_' . $language]
-				= $this->fixLangString($string);
-		}
-		elseif (!isset($this->langContent[$target][$language]))
-		{
-			$this->langContent[$target][$language] = $this->fixLangString(
-				$string
-			);
-		}
+		CFactory::_('Language')->set($target, $language, $string, $addPrefix);
 	}
 
 	/**
@@ -2219,11 +2112,12 @@ class Get
 	 * @param   string  $string  The language string
 	 *
 	 * @return  string
+	 * @deprecated 3.3
 	 *
 	 */
 	public function fixLangString(&$string)
 	{
-		if (Config::get('remove_line_breaks'))
+		if (CFactory::_('Config')->remove_line_breaks)
 		{
 			return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string));
 		}
@@ -2294,7 +2188,7 @@ class Get
 			$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
 
 			// Trigger Event: jcb_ce_onBeforeQueryViewData
-			$this->triggerEvent(
+			CFactory::_J('Event')->trigger(
 				'jcb_ce_onBeforeQueryViewData',
 				array(&$this->componentContext, &$id, &$query, &$this->db)
 			);
@@ -2324,7 +2218,7 @@ class Get
 			}
 
 			// check the length of the view name (+5 for com_ and _)
-			$name_length = Config::get('component_code_name_length') + strlen(
+			$name_length = CFactory::_('Config')->component_code_name_length + strlen(
 					$view->name_single_code
 				) + 5;
 			// when the name is larger then 49 we need to add the assets table name fix
@@ -2373,44 +2267,48 @@ class Get
 				                                                       = false;
 			$this->customScriptBuilder['token'][$view->name_list_code] = false;
 			// set some placeholders
-			$this->placeholders[$this->hhh . 'view' . $this->hhh]
+			CFactory::_('Placeholder')->active[Placefix::_h('view')]
 				= $view->name_single_code;
-			$this->placeholders[$this->hhh . 'views' . $this->hhh]
+			CFactory::_('Placeholder')->active[Placefix::_h('views')]
 				= $view->name_list_code;
-			$this->placeholders[$this->hhh . 'View' . $this->hhh]
+			CFactory::_('Placeholder')->active[Placefix::_h('View')]
 				= StringHelper::safe(
 				$view->name_single, 'F'
 			);
-			$this->placeholders[$this->hhh . 'Views' . $this->hhh]
+			CFactory::_('Placeholder')->active[Placefix::_h('Views')]
 				= StringHelper::safe(
 				$view->name_list, 'F'
 			);
-			$this->placeholders[$this->hhh . 'VIEW' . $this->hhh]
+			CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]
 				= StringHelper::safe(
 				$view->name_single, 'U'
 			);
-			$this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]
+			CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]
 				= StringHelper::safe(
 				$view->name_list, 'U'
 			);
-			$this->placeholders[$this->bbb . 'view' . $this->ddd]
-				= $this->placeholders[$this->hhh . 'view' . $this->hhh];
-			$this->placeholders[$this->bbb . 'views' . $this->ddd]
-				= $this->placeholders[$this->hhh . 'views' . $this->hhh];
-			$this->placeholders[$this->bbb . 'View' . $this->ddd]
-				= $this->placeholders[$this->hhh . 'View' . $this->hhh];
-			$this->placeholders[$this->bbb . 'Views' . $this->ddd]
-				= $this->placeholders[$this->hhh . 'Views' . $this->hhh];
-			$this->placeholders[$this->bbb . 'VIEW' . $this->ddd]
-				= $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
-			$this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]
-				= $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
+			CFactory::_('Placeholder')->active[Placefix::_('view')]
+				= CFactory::_('Placeholder')->active[Placefix::_h('view')];
+			CFactory::_('Placeholder')->active[Placefix::_('views')]
+				= CFactory::_('Placeholder')->active[Placefix::_h('views')];
+			CFactory::_('Placeholder')->active[Placefix::_('View')]
+				= CFactory::_('Placeholder')->active[Placefix::_h('View')];
+			CFactory::_('Placeholder')->active[Placefix::_('Views')]
+				= CFactory::_('Placeholder')->active[Placefix::_h('Views')];
+			CFactory::_('Placeholder')->active[Placefix::_('VIEW')]
+				= CFactory::_('Placeholder')->active[Placefix::_h('VIEW')];
+			CFactory::_('Placeholder')->active[Placefix::_('VIEWS')]
+				= CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')];
 
+			// for plugin event TODO change event api signatures
+			$this->placeholders = CFactory::_('Placeholder')->active;
 			// Trigger Event: jcb_ce_onBeforeModelViewData
-			$this->triggerEvent(
+			CFactory::_J('Event')->trigger(
 				'jcb_ce_onBeforeModelViewData',
 				array(&$this->componentContext, &$view, &$this->placeholders)
 			);
+			// for plugin event TODO change event api signatures
+			CFactory::_('Placeholder')->active = $this->placeholders;
 
 			// add the tables
 			$view->addtables = (isset($view->addtables)
@@ -2436,9 +2334,9 @@ class Get
 						// set the view name
 						$tab['view'] = $view->name_single_code;
 						// load the dynamic data
-						$tab['html'] = $this->setPlaceholders(
-							$this->setDynamicValues($tab['html']),
-							$this->placeholders
+						$tab['html'] = CFactory::_('Placeholder')->update(
+							CFactory::_('Customcode')->add($tab['html']),
+							CFactory::_('Placeholder')->active
 						);
 						// set the tab name
 						$tab['name'] = (isset($tab['name'])
@@ -2446,13 +2344,13 @@ class Get
 								$tab['name']
 							)) ? $tab['name'] : 'Tab';
 						// set lang
-						$tab['lang'] = Config::get('lang_prefix') . '_'
+						$tab['lang'] = CFactory::_('Config')->lang_prefix . '_'
 							. StringHelper::safe(
 								$tab['view'], 'U'
 							) . '_' . StringHelper::safe(
 								$tab['name'], 'U'
 							);
-						$this->setLangContent(
+						CFactory::_('Language')->set(
 							'both', $tab['lang'], $tab['name']
 						);
 						// set code name
@@ -2464,7 +2362,7 @@ class Get
 						if (isset($tab['permission'])
 							&& $tab['permission'] == 1)
 						{
-							$_tab = $this->_t(1);
+							$_tab = Indent::_(1);
 						}
 						// check if the php of the tab is set, if not load it now
 						if (strpos($tab['html'], 'bootstrap.addTab') === false
@@ -2472,31 +2370,31 @@ class Get
 							=== false)
 						{
 							// add the tab
-							$tmp = PHP_EOL . $_tab . $this->_t(1)
+							$tmp = PHP_EOL . $_tab . Indent::_(1)
 								. "";
-							$tmp .= PHP_EOL . $_tab . $this->_t(2)
+							$tmp .= PHP_EOL . $_tab . Indent::_(2)
 								. '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(3) + $tmp .= PHP_EOL . $_tab . Indent::_(3) . '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(4) . implode( - PHP_EOL . $_tab . $this->_t(4), + $tmp .= PHP_EOL . $_tab . Indent::_(4) . implode( + PHP_EOL . $_tab . Indent::_(4), (array) explode(PHP_EOL, trim($tab['html'])) ); - $tmp .= PHP_EOL . $_tab . $this->_t(3) . '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(2) . '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(1) + $tmp .= PHP_EOL . $_tab . Indent::_(3) . ''; + $tmp .= PHP_EOL . $_tab . Indent::_(2) . ''; + $tmp .= PHP_EOL . $_tab . Indent::_(1) . ""; // update html $tab['html'] = $tmp; } else { - $tab['html'] = PHP_EOL . $_tab . $this->_t(1) + $tab['html'] = PHP_EOL . $_tab . Indent::_(1) . implode( - PHP_EOL . $_tab . $this->_t(1), + PHP_EOL . $_tab . Indent::_(1), (array) explode(PHP_EOL, trim($tab['html'])) ); } @@ -2504,12 +2402,12 @@ class Get if (isset($tab['permission']) && $tab['permission'] == 1) { - $tmp = PHP_EOL . $this->_t(1) + $tmp = PHP_EOL . Indent::_(1) . "canDo->get('" . $tab['view'] . "." . $tab['code'] . ".viewtab')) : ?>"; $tmp .= $tab['html']; - $tmp .= PHP_EOL . $this->_t(1) . ""; + $tmp .= PHP_EOL . Indent::_(1) . ""; // update html $tab['html'] = $tmp; // set lang for permissions @@ -2518,19 +2416,17 @@ class Get $tab['lang_permission_desc'] = $tab['lang'] . '_TAB_PERMISSION_DESC'; $tab['lang_permission_title'] - = $this->placeholders[$this->hhh - . 'Views' . $this->hhh] . ' View ' + = CFactory::_('Placeholder')->active[Placefix::_h('Views')] . ' View ' . $tab['name'] . ' Tab'; - $this->setLangContent( + CFactory::_('Language')->set( 'both', $tab['lang_permission'], $tab['lang_permission_title'] ); - $this->setLangContent( + CFactory::_('Language')->set( 'both', $tab['lang_permission_desc'], 'Allow the users in this group to view ' . $tab['name'] . ' Tab of ' - . $this->placeholders[$this->hhh . 'views' - . $this->hhh] + . CFactory::_('Placeholder')->active[Placefix::_h('views')] ); // set the sort key $tab['sortKey'] @@ -2712,7 +2608,7 @@ class Get $tmpfield['settings'] = new stdClass(); // convert the xml json string to normal string $tmpfield['settings']->xml - = $this->setDynamicValues( + = CFactory::_('Customcode')->add( json_decode( $field['settings']->history->xml ) @@ -2944,7 +2840,7 @@ class Get $relationsValue['set'] )) { - $relationsValue['set'] = $this->setDynamicValues( + $relationsValue['set'] = CFactory::_('Customcode')->add( $relationsValue['set'] ); } @@ -2984,14 +2880,14 @@ class Get // confirm it should really make the over ride if ('default' !== $check_column_name) { - $column_name_lang = Config::get('lang_prefix') . '_' + $column_name_lang = CFactory::_('Config')->lang_prefix . '_' . StringHelper::safe( $view->name_list_code, 'U' ) . '_' . StringHelper::safe( $relationsValue['column_name'], 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'admin', $column_name_lang, $relationsValue['column_name'] ); @@ -3019,10 +2915,10 @@ class Get } unset($view->addlinked_views); // set the lang target - $this->lang = 'admin'; + CFactory::_('Config')->lang_target = 'admin'; if (isset($this->siteEditView[$id])) { - $this->lang = 'both'; + CFactory::_('Config')->lang_target = 'both'; } // set GUI mapper $guiMapper = array('table' => 'admin_view', 'id' => (int) $id, @@ -3147,8 +3043,8 @@ class Get // set field $guiMapper['field'] = $button_code_field; $view->{$button_code_field} - = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($view->{$button_code_field}) ), $guiMapper @@ -3364,25 +3260,29 @@ class Get unset($view->{'mysql_table_' . $_mysqlTableKey}); } + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterModelViewData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterModelViewData', array(&$this->componentContext, &$view, &$this->placeholders) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // clear placeholders - unset($this->placeholders[$this->hhh . 'view' . $this->hhh]); - unset($this->placeholders[$this->hhh . 'views' . $this->hhh]); - unset($this->placeholders[$this->hhh . 'View' . $this->hhh]); - unset($this->placeholders[$this->hhh . 'Views' . $this->hhh]); - unset($this->placeholders[$this->hhh . 'VIEW' . $this->hhh]); - unset($this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]); - unset($this->placeholders[$this->bbb . 'view' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'views' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'View' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'Views' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'VIEW' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]); + unset(CFactory::_('Placeholder')->active[Placefix::_h('view')]); + unset(CFactory::_('Placeholder')->active[Placefix::_h('views')]); + unset(CFactory::_('Placeholder')->active[Placefix::_h('View')]); + unset(CFactory::_('Placeholder')->active[Placefix::_h('Views')]); + unset(CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]); + unset(CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('view')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('views')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('View')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('Views')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('VIEW')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('VIEWS')]); // store this view to class object $this->_adminViewData[$id] = $view; @@ -3411,7 +3311,7 @@ class Get $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Trigger Event: jcb_ce_onBeforeQueryCustomViewData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeQueryCustomViewData', array(&$this->componentContext, &$id, &$table, &$query, &$this->db) ); @@ -3428,14 +3328,14 @@ class Get $view->Code = StringHelper::safe($view->code, 'F'); $view->CODE = StringHelper::safe($view->code, 'U'); // Trigger Event: jcb_ce_onBeforeModelCustomViewData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeModelCustomViewData', array(&$this->componentContext, &$view, &$id, &$table) ); if ($table === 'site_view') { - $this->lang = 'site'; + CFactory::_('Config')->lang_target = 'site'; // repeatable fields to update $searchRepeatables = array( // repeatablefield => checker @@ -3445,7 +3345,7 @@ class Get } else { - $this->lang = 'admin'; + CFactory::_('Config')->lang_target = 'admin'; // repeatable fields to update $searchRepeatables = array( // repeatablefield => checker @@ -3468,8 +3368,8 @@ class Get 'field' => 'default', 'type' => 'html'); // set the default data - $view->default = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($view->default)), + $view->default = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add(base64_decode($view->default)), $guiMapper ); // load context if not set @@ -3486,13 +3386,13 @@ class Get $view->context = StringHelper::safe($view->context); } // load the library - if (!isset($this->libManager[$this->target])) + if (!isset($this->libManager[CFactory::_('Config')->build_target])) { - $this->libManager[$this->target] = array(); + $this->libManager[CFactory::_('Config')->build_target] = array(); } - if (!isset($this->libManager[$this->target][$view->code])) + if (!isset($this->libManager[CFactory::_('Config')->build_target][$view->code])) { - $this->libManager[$this->target][$view->code] = array(); + $this->libManager[CFactory::_('Config')->build_target][$view->code] = array(); } // make sure json become array if (JsonHelper::check($view->libraries)) @@ -3504,27 +3404,27 @@ class Get { foreach ($view->libraries as $library) { - if (!isset($this->libManager[$this->target][$view->code][$library])) + if (!isset($this->libManager[CFactory::_('Config')->build_target][$view->code][$library])) { if ($this->getMediaLibrary((int) $library)) { - $this->libManager[$this->target][$view->code][(int) $library] + $this->libManager[CFactory::_('Config')->build_target][$view->code][(int) $library] = true; } } } } elseif (is_numeric($view->libraries) - && !isset($this->libManager[$this->target][$view->code][(int) $view->libraries])) + && !isset($this->libManager[CFactory::_('Config')->build_target][$view->code][(int) $view->libraries])) { if ($this->getMediaLibrary((int) $view->libraries)) { - $this->libManager[$this->target][$view->code][(int) $view->libraries] + $this->libManager[CFactory::_('Config')->build_target][$view->code][(int) $view->libraries] = true; } } // setup template array - $this->templateData[$this->target][$view->code] = array(); + $this->templateData[CFactory::_('Config')->build_target][$view->code] = array(); // setup template and layout data $this->setTemplateAndLayoutData($view->default, $view->code); // insure the uikit components are loaded @@ -3540,13 +3440,13 @@ class Get ); } // check for footable - if (!isset($this->footableScripts[$this->target][$view->code]) - || !$this->footableScripts[$this->target][$view->code]) + if (!isset($this->footableScripts[CFactory::_('Config')->build_target][$view->code]) + || !$this->footableScripts[CFactory::_('Config')->build_target][$view->code]) { $foundFoo = $this->getFootableScripts($view->default); if ($foundFoo) { - $this->footableScripts[$this->target][$view->code] = true; + $this->footableScripts[CFactory::_('Config')->build_target][$view->code] = true; } if ($foundFoo && !$this->footableScripts) { @@ -3554,13 +3454,13 @@ class Get } } // check for get module - if (!isset($this->getModule[$this->target][$view->code]) - || !$this->getModule[$this->target][$view->code]) + if (!isset($this->getModule[CFactory::_('Config')->build_target][$view->code]) + || !$this->getModule[CFactory::_('Config')->build_target][$view->code]) { $found = $this->getGetModule($view->default); if ($found) { - $this->getModule[$this->target][$view->code] = true; + $this->getModule[CFactory::_('Config')->build_target][$view->code] = true; } } // set the main get data @@ -3589,8 +3489,8 @@ class Get { // set field $guiMapper['field'] = $scripter; - $view->$scripter = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + $view->$scripter = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($view->$scripter) ), $guiMapper @@ -3598,7 +3498,7 @@ class Get } else { - $view->$scripter = $this->setDynamicValues( + $view->$scripter = CFactory::_('Customcode')->add( base64_decode($view->$scripter) ); } @@ -3618,13 +3518,13 @@ class Get $this->setTemplateAndLayoutData($view->$scripter, $view->code); // check for footable - if (!isset($this->footableScripts[$this->target][$view->code]) - || !$this->footableScripts[$this->target][$view->code]) + if (!isset($this->footableScripts[CFactory::_('Config')->build_target][$view->code]) + || !$this->footableScripts[CFactory::_('Config')->build_target][$view->code]) { $foundFoo = $this->getFootableScripts($view->$scripter); if ($foundFoo) { - $this->footableScripts[$this->target][$view->code] + $this->footableScripts[CFactory::_('Config')->build_target][$view->code] = true; } if ($foundFoo && !$this->footable) @@ -3633,13 +3533,13 @@ class Get } } // check for google chart - if (!isset($this->googleChart[$this->target][$view->code]) - || !$this->googleChart[$this->target][$view->code]) + if (!isset($this->googleChart[CFactory::_('Config')->build_target][$view->code]) + || !$this->googleChart[CFactory::_('Config')->build_target][$view->code]) { $found = $this->getGoogleChart($view->$scripter); if ($found) { - $this->googleChart[$this->target][$view->code] = true; + $this->googleChart[CFactory::_('Config')->build_target][$view->code] = true; } if ($found && !$this->googlechart) { @@ -3647,13 +3547,13 @@ class Get } } // check for get module - if (!isset($this->getModule[$this->target][$view->code]) - || !$this->getModule[$this->target][$view->code]) + if (!isset($this->getModule[CFactory::_('Config')->build_target][$view->code]) + || !$this->getModule[CFactory::_('Config')->build_target][$view->code]) { $found = $this->getGetModule($view->$scripter); if ($found) { - $this->getModule[$this->target][$view->code] = true; + $this->getModule[CFactory::_('Config')->build_target][$view->code] = true; } } } @@ -3662,7 +3562,7 @@ class Get if (isset($view->add_php_ajax) && $view->add_php_ajax == 1) { // ajax target (since we only have two options really) - if ('site' === $this->target) + if ('site' === CFactory::_('Config')->build_target) { $target = 'site'; } @@ -3702,7 +3602,7 @@ class Get if ($setAjax) { // turn on ajax area - if ('site' === $this->target) + if ('site' === CFactory::_('Config')->build_target) { $this->addSiteAjax = true; } @@ -3729,8 +3629,8 @@ class Get { // set field $guiMapper['field'] = $button_code_field; - $view->{$button_code_field} = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + $view->{$button_code_field} = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($view->{$button_code_field}) ), $guiMapper @@ -3749,7 +3649,7 @@ class Get } // Trigger Event: jcb_ce_onAfterModelCustomViewData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterModelCustomViewData', array(&$this->componentContext, &$view) ); @@ -3795,7 +3695,7 @@ class Get ); // Trigger Event: jcb_ce_onBeforeQueryFieldData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeQueryFieldData', array(&$this->componentContext, &$id, &$query, &$this->db) ); @@ -3809,7 +3709,7 @@ class Get $field = $this->db->loadObject(); // Trigger Event: jcb_ce_onBeforeModelFieldData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeModelFieldData', array(&$this->componentContext, &$field) ); @@ -3834,7 +3734,7 @@ class Get ); // load the values form params - $field->xml = $this->setDynamicValues(json_decode($field->xml)); + $field->xml = CFactory::_('Customcode')->add(json_decode($field->xml)); // check if we have validate (validation rule set) $validationRule = GetHelper::between( @@ -3871,13 +3771,13 @@ class Get { // open and set the validation rule $this->validationRules[$validationRule] - = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode( $this->validationRules[$validationRule] ) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), array( 'table' => 'validation_rule', @@ -3951,12 +3851,12 @@ class Get $field->initiator_on_save_model ); $field->initiator_save = explode( - PHP_EOL, $this->setPlaceholders( - $this->setDynamicValues( + PHP_EOL, CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode( $field->initiator_on_save_model ) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ) ); } @@ -3968,28 +3868,28 @@ class Get $field->initiator_on_get_model ); $field->initiator_get = explode( - PHP_EOL, $this->setPlaceholders( - $this->setDynamicValues( + PHP_EOL, CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode( $field->initiator_on_get_model ) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ) ); } // set the field modeling $field->model_field['save'] = explode( - PHP_EOL, $this->setPlaceholders( - $this->setDynamicValues( + PHP_EOL, CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($field->on_save_model_field) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ) ); $field->model_field['get'] = explode( - PHP_EOL, $this->setPlaceholders( - $this->setDynamicValues( + PHP_EOL, CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($field->on_get_model_field) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ) ); // remove the original values @@ -4000,7 +3900,7 @@ class Get $field->history = $this->getHistoryWatch('field', $id); // Trigger Event: jcb_ce_onAfterModelFieldData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterModelFieldData', array(&$this->componentContext, &$field) ); @@ -4496,8 +4396,8 @@ class Get || strpos($requeSt_id, '_request_catid') !== false) { // keep it then, don't change - $name = $this->setPlaceholders( - $requeSt_id, $this->placeholders + $name = CFactory::_('Placeholder')->update( + $requeSt_id, CFactory::_('Placeholder')->active ); } else @@ -4508,20 +4408,20 @@ class Get if (StringHelper::check($listViewName)) { // check if we should use another Text Name as this views name - $otherName = $this->setPlaceholders( + $otherName = CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'othername="', '"' - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); - $otherViews = $this->setPlaceholders( + $otherViews = CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'views="', '"' - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); - $otherView = $this->setPlaceholders( + $otherView = CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'view="', '"' - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); // This is to link other view category if (StringHelper::check($otherName) @@ -4561,10 +4461,10 @@ class Get { // get value from xml $xml = FieldHelper::safe( - $this->setPlaceholders( + CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'name="', '"' - ), $this->placeholders + ), CFactory::_('Placeholder')->active ) ); // check if a value was found @@ -4701,7 +4601,7 @@ class Get foreach ($results as $_nr => &$result) { // Trigger Event: jcb_ce_onBeforeModelDynamicGetData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeModelDynamicGetData', array(&$this->componentContext, &$result, &$result->id, &$view_code, &$context) ); @@ -4716,8 +4616,8 @@ class Get // set GUI mapper field $guiMapper['field'] = 'php_calculation'; $result->php_calculation - = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($result->php_calculation) ), $guiMapper @@ -4734,8 +4634,8 @@ class Get // set GUI mapper field $guiMapper['field'] = 'php_router_parse'; $result->php_router_parse - = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($result->php_router_parse) ), $guiMapper @@ -4770,7 +4670,7 @@ class Get $guiMapper['prefix'] = PHP_EOL . PHP_EOL; $this->setCustomScriptBuilder( $result->{$script}, - $this->target . '_' . $script, + CFactory::_('Config')->build_target . '_' . $script, $view_code, false, $guiMapper, @@ -4790,8 +4690,8 @@ class Get $guiMapper['prefix'] = PHP_EOL; // only for custom gets $result->{$script} - = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($result->{$script}) ), $guiMapper @@ -4859,8 +4759,8 @@ class Get $guiMapper['field'] = 'php_custom_get'; // get the custom query $customQueryString - = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($result->php_custom_get) ), $guiMapper @@ -4989,12 +4889,12 @@ class Get || isset($_part_of_a[$join_field[0]]) || isset($_part_of_a[$on_field[0]])) { - $this->siteMainGet[$this->target][$view_code][$option['as']] + $this->siteMainGet[CFactory::_('Config')->build_target][$view_code][$option['as']] = $option['as']; } else { - $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]] + $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option['as']][$join_field[1]] = $on_field[0]; } } @@ -5003,7 +4903,7 @@ class Get $result->custom_get[] = $option; if ($on_field[0] != 'a') { - $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]] + $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option['as']][$join_field[1]] = $on_field[0]; } } @@ -5089,12 +4989,12 @@ class Get || isset($_part_of_a[$join_field[0]]) || isset($_part_of_a[$on_field[0]])) { - $this->siteMainGet[$this->target][$view_code][$option1['as']] + $this->siteMainGet[CFactory::_('Config')->build_target][$view_code][$option1['as']] = $option1['as']; } else { - $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]] + $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option1['as']][$join_field[1]] = $on_field[0]; } } @@ -5103,7 +5003,7 @@ class Get $result->custom_get[] = $option1; if ($on_field[0] != 'a') { - $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]] + $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option1['as']][$join_field[1]] = $on_field[0]; } } @@ -5127,10 +5027,10 @@ class Get $option2['operator'] = $operatorArray[$option2['operator']]; $option2['state_key'] - = $this->setPlaceholders( - $this->setDynamicValues( + = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( $option2['state_key'] - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); $option2['key'] = $result->key; } @@ -5216,7 +5116,7 @@ class Get $result->plugin_events = ''; } // Trigger Event: jcb_ce_onAfterModelDynamicGetData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterModelDynamicGetData', array(&$this->componentContext, &$result, &$result->id, &$view_code, &$context) ); @@ -5294,7 +5194,7 @@ class Get // prep the script string if ($base64 && $dynamic) { - $script = $this->setDynamicValues(base64_decode($script)); + $script = CFactory::_('Customcode')->add(base64_decode($script)); } elseif ($base64) { @@ -5302,7 +5202,7 @@ class Get } elseif ($dynamic) // this does not happen (just incase) { - $script = $this->setDynamicValues($script); + $script = CFactory::_('Customcode')->add($script); } // check if we still have a string if (StringHelper::check($script)) @@ -5310,7 +5210,7 @@ class Get // now load the placeholder snippet if needed if ($base64 || $dynamic) { - $script = $this->setGuiCodePlaceholder($script, $config); + $script = CFactory::_('Customcode.Gui')->set($script, $config); } // add Dynamic HASHING option of a file/string $script = $this->setDynamicHASHING($script); @@ -5395,8 +5295,8 @@ class Get } // load the actual script $script .= $prefix . str_replace( - array_keys($this->placeholders), - array_values($this->placeholders), + array_keys(CFactory::_('Placeholder')->active), + array_values(CFactory::_('Placeholder')->active), $this->customScriptBuilder[$first][$second] ) . $sufix; // clear some memory @@ -5814,7 +5714,7 @@ class Get // remove watch if (isset($version_note['component']) && ($key = array_search( - Config::get('component_id'), $version_note['component'] + CFactory::_('Config')->component_id, $version_note['component'] )) !== false) { // last version that was used to build/compile @@ -5830,9 +5730,9 @@ class Get break; case 1: // add watch - if (!in_array(Config::get('component_id'), $version_note['component'])) + if (!in_array(CFactory::_('Config')->component_id, $version_note['component'])) { - $version_note['component'][] = Config::get('component_id'); + $version_note['component'][] = CFactory::_('Config')->component_id; } else { @@ -5913,9 +5813,9 @@ class Get { foreach ($templates as $template) { - if (!isset($this->templateData[$this->target][$view]) + if (!isset($this->templateData[CFactory::_('Config')->build_target][$view]) || !array_key_exists( - $template, $this->templateData[$this->target][$view] + $template, $this->templateData[CFactory::_('Config')->build_target][$view] )) { $data = $this->getDataWithAlias( @@ -5924,7 +5824,7 @@ class Get if (ArrayHelper::check($data)) { // load it to the template data array - $this->templateData[$this->target][$view][$template] + $this->templateData[CFactory::_('Config')->build_target][$view][$template] = $data; // call self to get child data $again[] = array($data['html'], $view); @@ -5933,7 +5833,7 @@ class Get } // check if we have the template set (and nothing yet found) if (!$found - && isset($this->templateData[$this->target][$view][$template])) + && isset($this->templateData[CFactory::_('Config')->build_target][$view][$template])) { // something was found $found = true; @@ -5972,27 +5872,27 @@ class Get { // get the other target if both $_target = null; - if ($this->lang === 'both') + if (CFactory::_('Config')->lang_target === 'both') { - $_target = ($this->target === 'admin') ? 'site' : 'admin'; + $_target = (CFactory::_('Config')->build_target === 'admin') ? 'site' : 'admin'; } foreach ($layouts as $layout) { - if (!isset($this->layoutData[$this->target]) + if (!isset($this->layoutData[CFactory::_('Config')->build_target]) || !ArrayHelper::check( - $this->layoutData[$this->target] + $this->layoutData[CFactory::_('Config')->build_target] ) || !array_key_exists( - $layout, $this->layoutData[$this->target] + $layout, $this->layoutData[CFactory::_('Config')->build_target] )) { $data = $this->getDataWithAlias($layout, 'layout', $view); if (ArrayHelper::check($data)) { // load it to the layout data array - $this->layoutData[$this->target][$layout] = $data; + $this->layoutData[CFactory::_('Config')->build_target][$layout] = $data; // check if other target is set - if ($this->lang === 'both' && $_target) + if (CFactory::_('Config')->lang_target === 'both' && $_target) { $this->layoutData[$_target][$layout] = $data; } @@ -6002,7 +5902,7 @@ class Get } } // check if we have the layout set (and nothing yet found) - if (!$found && isset($this->layoutData[$this->target][$layout])) + if (!$found && isset($this->layoutData[CFactory::_('Config')->build_target][$layout])) { // something was found $found = true; @@ -6060,8 +5960,8 @@ class Get $this->db->quoteName('a.id') . ' = ' . (int) $ID ); // get the other target if both - $_targets = array($this->target); - if ($this->lang === 'both') + $_targets = array(CFactory::_('Config')->build_target); + if (CFactory::_('Config')->lang_target === 'both') { $_targets = array('site', 'admin'); } @@ -6073,8 +5973,8 @@ class Get if ($row->add_php_view == 1 && StringHelper::check($row->php_view)) { - $php_view = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($row->php_view)), + $php_view = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add(base64_decode($row->php_view)), array( 'table' => $table, 'field' => 'php_view', @@ -6082,8 +5982,8 @@ class Get 'type' => 'php') ); } - $contnent = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($row->{$table})), + $contnent = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add(base64_decode($row->{$table})), array( 'table' => $table, 'field' => $table, @@ -6188,7 +6088,7 @@ class Get return array( 'id' => $row->id, - 'html' => $this->setGuiCodePlaceholder( + 'html' => CFactory::_('Customcode.Gui')->set( $contnent, array( 'table' => $table, @@ -6197,7 +6097,7 @@ class Get 'type' => 'html' ) ), - 'php_view' => $this->setGuiCodePlaceholder( + 'php_view' => CFactory::_('Customcode.Gui')->set( $php_view, array( 'table' => $table, @@ -6460,8 +6360,8 @@ class Get $library->php_setdocument )) { - $library->document = $this->setGuiCodePlaceholder( - $this->setDynamicValues( + $library->document = CFactory::_('Customcode.Gui')->set( + CFactory::_('Customcode')->add( base64_decode($library->php_setdocument) ), array( @@ -6515,156 +6415,11 @@ class Get * @param string $content The content * * @return string The content with the updated Language place holder - * + * @deprecated 3.3 Use CFactory::_('Language.Extractor')->engine($content) */ public function setLangStrings($content) { - // get targets to search for - $langStringTargets = array_filter( - $this->langStringTargets, function ($get) use ($content) { - if (strpos($content, $get) !== false) - { - return true; - } - - return false; - } - ); - // check if we should continue - if (ArrayHelper::check($langStringTargets)) - { - // insure string is not broken - $content = $this->setPlaceholders($content, $this->placeholders); - // reset some buckets - $langHolders = array(); - $langCheck = array(); - $langOnly = array(); - $jsTEXT = array(); - $scTEXT = array(); - // first get the Joomla .JText._() - if (in_array('Joomla' . '.JText._(', $langStringTargets)) - { - $jsTEXT[] = GetHelper::allBetween( - $content, "Joomla" . ".JText._('", "'" - ); - $jsTEXT[] = GetHelper::allBetween( - $content, 'Joomla' . '.JText._("', '"' - ); - // combine into one array - $jsTEXT = ArrayHelper::merge($jsTEXT); - // we need to add a check to insure these JavaScript lang matchup - if (ArrayHelper::check( - $jsTEXT - )) //<-- not really needed hmmm - { - // load the JS text to mismatch array - $langCheck[] = $jsTEXT; - $this->langMismatch = ArrayHelper::merge( - array($jsTEXT, $this->langMismatch) - ); - } - } - // now get the JText: :script() - if (in_array('JText:' . ':script(', $langStringTargets)) - { - $scTEXT[] = GetHelper::allBetween( - $content, "JText:" . ":script('", "'" - ); - $scTEXT[] = GetHelper::allBetween( - $content, 'JText:' . ':script("', '"' - ); - // combine into one array - $scTEXT = ArrayHelper::merge($scTEXT); - // we need to add a check to insure these JavaScript lang matchup - if (ArrayHelper::check($scTEXT)) - { - // load the Script text to match array - $langCheck[] = $scTEXT; - $this->langMatch = ArrayHelper::merge( - array($scTEXT, $this->langMatch) - ); - } - } - // now do the little trick for JustTEXT: :_('Just uppercase text'); - if (in_array('JustTEXT:' . ':_(', $langStringTargets)) - { - $langOnly[] = GetHelper::allBetween( - $content, "JustTEXT:" . ":_('", "')" - ); - $langOnly[] = GetHelper::allBetween( - $content, 'JustTEXT:' . ':_("', '")' - ); - // merge lang only - $langOnly = ArrayHelper::merge($langOnly); - } - // set language data - foreach ($langStringTargets as $langStringTarget) - { - // need some special treatment here - if ($langStringTarget === 'Joomla' . '.JText._(' - || $langStringTarget === 'JText:' . ':script(' - || $langStringTarget === 'JustTEXT:' . ':_(') - { - continue; - } - $langCheck[] = GetHelper::allBetween( - $content, $langStringTarget . "'", "'" - ); - $langCheck[] = GetHelper::allBetween( - $content, $langStringTarget . '"', '"' - ); - } - // the normal loading of the language strings - $langCheck = ArrayHelper::merge($langCheck); - if (ArrayHelper::check( - $langCheck - )) //<-- not really needed hmmm - { - foreach ($langCheck as $string) - { - if ($keyLang = $this->setLang($string)) - { - // load the language targets - foreach ($langStringTargets as $langStringTarget) - { - // need some special treatment here - if ($langStringTarget === 'JustTEXT:' . ':_(') - { - continue; - } - $langHolders[$langStringTarget . "'" . $string - . "'"] - = $langStringTarget . "'" . $keyLang . "'"; - $langHolders[$langStringTarget . '"' . $string - . '"'] - = $langStringTarget . '"' . $keyLang . '"'; - } - } - } - } - // the uppercase loading only (for arrays and other tricks) - if (ArrayHelper::check($langOnly)) - { - foreach ($langOnly as $string) - { - if ($keyLang = $this->setLang($string)) - { - // load the language targets - $langHolders["JustTEXT:" . ":_('" . $string . "')"] - = "'" . $keyLang . "'"; - $langHolders['JustTEXT:' . ':_("' . $string . '")'] - = '"' . $keyLang . '"'; - } - } - } - // only continue if we have value to replace - if (ArrayHelper::check($langHolders)) - { - $content = $this->setPlaceholders($content, $langHolders); - } - } - - return $content; + return CFactory::_('Language.Extractor')->engine($content); } /** @@ -6673,24 +6428,11 @@ class Get * @param string $string The plan text string (English) * * @return string The key language string (all uppercase) - * + * @deprecated 3.3 Use CFactory::_('Language')->key($string); */ public function setLang($string) { - // this is there to insure we dont break already added Language strings - if (StringHelper::safe($string, 'U', '_', false, false) - === $string) - { - return false; - } - // build lang key - $keyLang = Config::get('lang_prefix') . '_' . StringHelper::safe( - $string, 'U' - ); - // set the language string - $this->setLangContent($this->lang, $keyLang, $string); - - return $keyLang; + return CFactory::_('Language')->key($string); } /** @@ -6722,7 +6464,7 @@ class Get elseif ('view' === $type) { $view = $this->getViewTableName($asset); - $table = '#__' . Config::get('component_code_name') . '_' . $view; + $table = '#__' . CFactory::_('Config')->component_code_name . '_' . $view; $queryName = $view; } // just get all values from table if * is found @@ -6836,9 +6578,9 @@ class Get else { $querySelect = '$query->select($db->quoteName(' - . PHP_EOL . $this->_t(3) . 'array(' . implode( + . PHP_EOL . Indent::_(3) . 'array(' . implode( ',', $gets - ) . '),' . PHP_EOL . $this->_t(3) . 'array(' + ) . '),' . PHP_EOL . Indent::_(3) . 'array(' . implode(',', $keys) . ')));'; } $queryFrom = '$db->quoteName(' . $this->db->quote($table) @@ -7042,11 +6784,10 @@ class Get // start building the MySql dump $dump = "--"; $dump .= PHP_EOL . "-- Dumping data for table `#__" - . $this->bbb . "component" . $this->ddd . "_" . $view + . Placefix::_( "component" ) . "_" . $view . "`"; $dump .= PHP_EOL . "--"; - $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . $this->bbb - . "component" . $this->ddd . "_" . $view . "` ("; + $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . Placefix::_("component" ) . "_" . $view . "` ("; foreach ($data as $line) { $comaSet = 0; @@ -7147,12 +6888,12 @@ class Get */ public function uniqueCode($code) { - if (!isset($this->uniquecodes[$this->target]) + if (!isset($this->uniquecodes[CFactory::_('Config')->build_target]) || !in_array( - $code, $this->uniquecodes[$this->target] + $code, $this->uniquecodes[CFactory::_('Config')->build_target] )) { - $this->uniquecodes[$this->target][] = $code; + $this->uniquecodes[CFactory::_('Config')->build_target][] = $code; return $code; } @@ -7262,25 +7003,11 @@ class Get * dynamic build values if it gets broken * * @return string - * + * @deprecated 3.3 Use CFactory::_('Customcode')->add($string, $debug); */ public function setDynamicValues($string, $debug = 0) { - if (StringHelper::check($string)) - { - $string = $this->setLangStrings( - $this->setCustomCodeData( - $this->setExternalCodeString($string, $debug), $debug - ) - ); - } - // if debug - if ($debug) - { - jexit(); - } - - return $string; + return CFactory::_('Customcode')->add($string, $debug); } /** @@ -7290,94 +7017,11 @@ class Get * @param int $debug The switch to debug the update * * @return string - * + * @deprecated 3.3 Use CFactory::_('Customcode.External')->set($string, $debug); */ public function setExternalCodeString($string, $debug = 0) { - // check if content has custom code placeholder - if (strpos($string, '[EXTERNA' . 'LCODE=') !== false) - { - // if debug - if ($debug) - { - echo 'External Code String:'; - var_dump($string); - } - // target content - $bucket = array(); - $found = GetHelper::allBetween( - $string, '[EXTERNA' . 'LCODE=', ']' - ); - if (ArrayHelper::check($found)) - { - // build local bucket - foreach ($found as $target) - { - // check for cutting sequence - // example: >{3|4 - // will cut 3 rows at top and 4 rows at bottom - // if the external code has 8 or more lines - if (($pos = strpos($target, '>{')) !== false) - { - // the length - $target_len = strlen($target); - // where to cut - $cutting = $target_len - $pos; - // get the sequence - $sequence = substr($target, "-$cutting"); - // remove from the URL - $target_url = str_replace($sequence, '', $target); - // set the cut key for this target if not set - $this->externalCodeCutter[trim($target)] = str_replace('>{', '', $sequence); - } - else - { - $target_url = $target; - } - // check if the target is valid URL or path - if ((!filter_var($target_url, FILTER_VALIDATE_URL) === false - && ComponentbuilderHelper::urlExists($target_url)) - || (JPath::clean($target_url) === $target_url - && File::exists($target_url))) - { - $this->getExternalCodeString($target, $bucket); - } - // give notice that target is not a valid url/path - else - { - // set key - $key = '[EXTERNA' . 'LCODE=' . $target . ']'; - // set the notice - $this->app->enqueueMessage( - JText::_( - '

External Code Warning

' - ), 'Warning' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The %s is not a valid url/path!', - $key - ), 'Warning' - ); - // remove the placeholder - $bucket[$key] = ''; - } - } - // now update local string if bucket has values - if (ArrayHelper::check($bucket)) - { - $string = $this->setPlaceholders($string, $bucket); - } - } - // if debug - if ($debug) - { - echo 'External Code String After Update:'; - var_dump($string); - } - } - - return $string; + return CFactory::_('Customcode.External')->set($string, $debug); } /** @@ -7387,161 +7031,19 @@ class Get * @param array $bucket The Placeholders bucket * * @return void - * + * @deprecated 3.3 */ protected function getExternalCodeString($target, &$bucket) { - // set URL key - $target_key = trim($target); - // set key - $key = '[EXTERNA' . 'LCODE=' . $target . ']'; - // remove the cut sequence from the url - if (isset($this->externalCodeCutter[$target_key])) - { - // remove from the URL - $target_url = trim(str_replace('>{' . $this->externalCodeCutter[$target_key], '', $target)); - } - else - { - $target_url = trim($target); - } - // check if we already fetched this - if (!isset($this->externalCodeString[$target_key])) - { - // get the data string (code) - $this->externalCodeString[$target_key] - = FileHelper::getContent($target_url); - // check if we must cut this - if (isset($this->externalCodeCutter[$target_key]) && - $this->externalCodeCutter[$target_key]) - { - $this->externalCodeString[$target_key] = $this->cutExternalCodeString( - $this->externalCodeString[$target_key], - $this->externalCodeCutter[$target_key], - $key - ); - } - // did we get any value - if (StringHelper::check( - $this->externalCodeString[$target_key] - )) - { - // check for changes - $live_hash = md5($this->externalCodeString[$target_key]); - // check if it exists local - if ($hash = GetHelper::var( - 'external_code', $target_key, 'target', 'hash' - )) - { - // must be an admin make a change to use EXTERNAL code (we may add a custom access switch - use ADMIN for now) - if ($hash !== $live_hash && $this->user->authorise( - 'core.admin', 'com_componentbuilder' - )) - { - // update the hash since it changed - $object = new stdClass(); - $object->target = $target_key; - $object->hash = $live_hash; - // update local hash - $this->db->updateObject( - '#__componentbuilder_external_code', $object, - 'target' - ); - // give notice of the change - $this->app->enqueueMessage( - JText::_('

External Code Warning

'), - 'Warning' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The code/string from %s has been changed since the last compilation. Please investigate to ensure the changes are safe! Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention! Do not ignore this warning as it will only show once.', - $key - ), 'Warning' - ); - } - elseif ($hash !== $live_hash) - { - // set the notice - $this->app->enqueueMessage( - JText::_('

External Code Error

'), - 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - '%s, we detected a change in EXTERNALCODE, but you do not have permission to allow this change so %s was removed from the compilation. Please contact your system administrator for more info!
(admin access required)', - $this->user->get('name'), $key - ), 'Error' - ); - // remove the code/string - $this->externalCodeString[$target_key] = ''; - } - } - // only an admin can add new EXTERNAL code (we may add a custom access switch - use ADMIN for now) - elseif ($this->user->authorise( - 'core.admin', 'com_componentbuilder' - )) - { - // add the hash to track changes - $object = new stdClass(); - $object->target = $target_key; - $object->hash = $live_hash; - // insert local hash - $this->db->insertObject( - '#__componentbuilder_external_code', $object - ); - // give notice the first time this is added - $this->app->enqueueMessage( - JText::_('

External Code Notice

'), - 'Warning' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The code/string from %s has been added for the first time. Please investigate to ensure the correct code/string was used! Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention! Do not ignore this warning as it will only show once.', - $key - ), 'Warning' - ); - } - else - { - // set the notice - $this->app->enqueueMessage( - JText::_('

External Code Error

'), - 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - '%s, we detected NEW EXTERNALCODE, but you do not have permission to allow this new code/string so %s was removed from the compilation. Please contact you system administrator for more info!
(admin access required)', - $this->user->get('name'), $key - ), 'Error' - ); - // remove the code/string - $this->externalCodeString[$target_key] = ''; - } - } - else - { - // set notice that we could not get a valid string from the target - $this->app->enqueueMessage( - JText::_('

External Code Warning

'), 'Error' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'The %s returned an invalid string!', $key - ), 'Error' - ); - } - } - // add to local bucket - if (isset($this->externalCodeString[$target_key])) - { - // update the placeholder with the external code string - $bucket[$key] = $this->externalCodeString[$target_key]; - } - else - { - // remove the placeholder - $bucket[$key] = ''; - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::_('

External Code Warning

'), 'Error' + ); + $this->app->enqueueMessage( + JText::_( + 'Use of a deprecated method (getExternalCodeString)!' + ), 'Error' + ); } /** @@ -7552,41 +7054,17 @@ class Get * @param string $key The content key * * @return string - * + * @deprecated 3.3 */ protected function cutExternalCodeString($string, $sequence, $key) { - // we first break the string up in rows - $rows = (array) explode(PHP_EOL, $string); - // get the cutting sequence - $cutter = (array) explode('|', $sequence); - // we only continue if we have more rows than we have to cut - if (array_sum($cutter) < ArrayHelper::check($rows)) - { - // remove the rows at the bottom if needed - if (isset($cutter[1]) && $cutter[1] > 0) - { - array_splice($rows, "-$cutter[1]"); - } - // remove the rows at the top if needed - if ($cutter[0] > 0) - { - $rows = array_splice($rows, $cutter[0]); - } - - // return the remaining rows - return implode(PHP_EOL, $rows); - } - - // we set an error message about too few lines to cut + // set notice that we could not get a valid string from the target $this->app->enqueueMessage( - JText::_('

External Code Notice

'), - 'Error' + JText::_('

External Code Warning

'), 'Error' ); $this->app->enqueueMessage( - JText::sprintf( - 'The %s cut sequence failed on the returned external code/string as more lines has to be cut then was found in the code/string. We have completely removed the code. Please check this code/string!', - $key + JText::_( + 'Use of a deprecated method (cutExternalCodeString)!' ), 'Error' ); @@ -7600,182 +7078,11 @@ class Get * @param int $debug The switch to debug the update * * @return string - * + * @deprecated 3.3 Use CFactory::_('Customcode')->set($string, $debug, $not); */ public function setCustomCodeData($string, $debug = 0, $not = null) { - // insure the code is loaded - $loaded = false; - // check if content has custom code place holder - if (strpos($string, '[CUSTO' . 'MCODE=') !== false) - { - // if debug - if ($debug) - { - echo 'Custom Code String:'; - var_dump($string); - } - // the ids found in this content - $bucket = array(); - $found = GetHelper::allBetween( - $string, '[CUSTO' . 'MCODE=', ']' - ); - if (ArrayHelper::check($found)) - { - foreach ($found as $key) - { - // if debug - if ($debug) - { - echo '$key before update:'; - var_dump($key); - } - // check if we have args - if (is_numeric($key)) - { - $id = (int) $key; - } - elseif (StringHelper::check($key) - && strpos( - $key, '+' - ) === false) - { - $getFuncName = trim($key); - if (!isset($this->functionNameMemory[$getFuncName])) - { - if (!$found_local = GetHelper::var( - 'custom_code', $getFuncName, 'function_name', - 'id' - )) - { - continue; - } - $this->functionNameMemory[$getFuncName] - = $found_local; - } - $id = (int) $this->functionNameMemory[$getFuncName]; - } - elseif (StringHelper::check($key) - && strpos( - $key, '+' - ) !== false) - { - $array = explode('+', $key); - // set ID - if (is_numeric($array[0])) - { - $id = (int) $array[0]; - } - elseif (StringHelper::check($array[0])) - { - $getFuncName = trim($array[0]); - if (!isset($this->functionNameMemory[$getFuncName])) - { - if (!$found_local - = GetHelper::var( - 'custom_code', $getFuncName, - 'function_name', 'id' - )) - { - continue; - } - $this->functionNameMemory[$getFuncName] - = $found_local; - } - $id = (int) $this->functionNameMemory[$getFuncName]; - } - else - { - continue; - } - // load args for this ID - if (isset($array[1])) - { - if (!isset($this->customCodeData[$id]['args'])) - { - $this->customCodeData[$id]['args'] = array(); - } - // only load if not already loaded - if (!isset($this->customCodeData[$id]['args'][$key])) - { - if (strpos($array[1], ',') !== false) - { - // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values) - $this->customCodeData[$id]['args'][$key] - = array_map( - function ($_key) { - return $this->setPlaceholders( - $_key, - $this->customCodeKeyPlacholders - ); - }, (array) explode(',', $array[1]) - ); - } - elseif (StringHelper::check( - $array[1] - )) - { - $this->customCodeData[$id]['args'][$key] - = array(); - // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values) - $this->customCodeData[$id]['args'][$key][] - = $this->setPlaceholders( - $array[1], - $this->customCodeKeyPlacholders - ); - } - } - } - } - else - { - continue; - } - // make sure to remove the not if set - if ($not && is_numeric($not) && $not > 0 && $not == $id) - { - continue; - } - $bucket[$id] = $id; - } - } - // if debug - if ($debug) - { - echo 'Bucket:'; - var_dump($bucket); - } - // check if any custom code placeholders where found - if (ArrayHelper::check($bucket)) - { - $_tmpLang = $this->lang; - // insure we add the langs to both site and admin - $this->lang = 'both'; - // now load the code to memory - $loaded = $this->getCustomCode($bucket, false, $debug); - // revert lang to current setting - $this->lang = $_tmpLang; - } - // if debug - if ($debug) - { - echo 'Loaded:'; - var_dump($loaded); - } - // when the custom code is loaded - if ($loaded === true) - { - $string = $this->insertCustomCode($bucket, $string, $debug); - } - // if debug - if ($debug) - { - echo 'Custom Code String After Update:'; - var_dump($string); - } - } - - return $string; + return CFactory::_('Customcode')->set($string, $debug, $not); } /** @@ -7785,29 +7092,21 @@ class Get * @param int $debug The switch to debug the update * * @return string on success - * + * @deprecated 3.3 */ protected function insertCustomCode($ids, $string, $debug = 0) { - $code = array(); - // load the code - foreach ($ids as $id) - { - $this->buildCustomCodePlaceholders( - $this->customCodeMemory[$id], $code, $debug - ); - } - // if debug - if ($debug) - { - echo 'Place holders to Update String:'; - var_dump($code); - echo 'Custom Code String Before Update:'; - var_dump($string); - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::_('

External Code Warning

'), 'Error' + ); + $this->app->enqueueMessage( + JText::_( + 'Use of a deprecated method (insertCustomCode)!' + ), 'Error' + ); - // now update the string - return $this->setPlaceholders($string, $code); + return ''; } /** @@ -7817,73 +7116,21 @@ class Get * @param int $debug The switch to debug the update * * @return string on success - * + * @deprecated 3.3 */ protected function buildCustomCodePlaceholders($item, &$code, $debug = 0) { - // check if there is args for this code - if (isset($this->customCodeData[$item['id']]['args']) - && ArrayHelper::check( - $this->customCodeData[$item['id']]['args'] - )) - { - // since we have args we cant update this code via IDE (TODO) - $placeholder = $this->getPlaceHolder(3, null); - // if debug - if ($debug) - { - echo 'Custom Code Placeholders:'; - var_dump($placeholder); - } - // we have args and so need to load each - foreach ( - $this->customCodeData[$item['id']]['args'] as $key => $args - ) - { - $this->setThesePlaceHolders('arg', $args); - // if debug - if ($debug) - { - echo 'Custom Code Global Placholders:'; - var_dump($this->placeholders); - } - $code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start'] - . PHP_EOL . $this->setPlaceholders( - $item['code'], $this->placeholders - ) . $placeholder['end']; - } - // always clear the args - $this->clearFromPlaceHolders('arg'); - } - else - { - if (($keyPlaceholder = array_search( - $item['id'], $this->functionNameMemory - )) === false) - { - $keyPlaceholder = $item['id']; - } - // check what type of place holders we should load here - $placeholderType = (int) $item['comment_type'] . '2'; - if (stripos($item['code'], $this->bbb . 'view') !== false - || stripos($item['code'], $this->bbb . 'sview') !== false - || stripos($item['code'], $this->bbb . 'arg') !== false) - { - // if view is being set dynamicly then we can't update this code via IDE (TODO) - $placeholderType = 3; - } - // if now ars were found, clear it - $this->clearFromPlaceHolders('arg'); - // load args for this code - $placeholder = $this->getPlaceHolder( - $placeholderType, $item['id'] - ); - $code['[CUSTOM' . 'CODE=' . $keyPlaceholder . ']'] - = $placeholder['start'] . PHP_EOL - . $this->setPlaceholders( - $item['code'], $this->placeholders - ) . $placeholder['end']; - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::_('

External Code Warning

'), 'Error' + ); + $this->app->enqueueMessage( + JText::_( + 'Use of a deprecated method (buildCustomCodePlaceholders)!' + ), 'Error' + ); + + return ''; } /** @@ -7893,21 +7140,12 @@ class Get * @param array $values The values to add * * @return void + * @deprecated 3.3 Use CFactory::_('Placeholder')->setType($key, $values); */ public function setThesePlaceHolders($key, $values) { - // aways fist reset these - $this->clearFromPlaceHolders($key); - if (ArrayHelper::check($values)) - { - $number = 0; - foreach ($values as $value) - { - $this->placeholders[$this->bbb . $key . $number . $this->ddd] - = $value; - $number++; - } - } + // use the new container class + CFactory::_('Placeholder')->setType($key, $values); } /** @@ -7916,16 +7154,12 @@ class Get * @param string $like The main string for placeholder key * * @return void + * @deprecated 3.3 Use CFactory::_('Placeholder')->clearType($key); */ public function clearFromPlaceHolders($like) { - foreach ($this->placeholders as $something => $value) - { - if (stripos($something, $like) !== false) - { - unset($this->placeholders[$something]); - } - } + // use the new container class + CFactory::_('Placeholder')->clearType($like); } /** @@ -7998,7 +7232,7 @@ class Get $counterUpdate = 0; $today = JFactory::getDate()->toSql(); foreach ( - $this->languages[$target][Config::get('lang_tag', 'en-GB')] as $area => $placeholders + $this->languages[$target][CFactory::_('Config')->get('lang_tag', 'en-GB')] as $area => $placeholders ) { foreach ($placeholders as $placeholder => $string) @@ -8455,130 +7689,40 @@ class Get /** * get the custom code from the system * - * @return void + * @param array|null $ids The custom code ides if known + * @param int|null $setLang The set lang switch + * @param int $debug The switch to debug the update * + * @return void + * @deprecated 3.3 Use CFactory::_('Customcode')->load($ids, $setLang, $debug); */ - public function getCustomCode($ids = null, $setLang = true, $debug = 0) + public function getCustomCode(?array $ids = null, bool $setLang = true, int $debug = 0) { - // should the result be stored in memory - $loadInMemory = false; - // Create a new query object. - $query = $this->db->getQuery(true); - $query->from( - $this->db->quoteName('#__componentbuilder_custom_code', 'a') - ); + CFactory::_('Customcode')->load($ids, $setLang, $debug); + } + + /** + * check if we already have these ids in local memory + * + * @return void + * @deprecated 3.3 + */ + protected function checkCustomCodeMemory($ids) + { + // reset custom code + CFactory::_('Customcode')->active = array(); + foreach ($ids as $pointer => $id) + { + if (isset(CFactory::_('Customcode')->memory[$id])) + { + CFactory::_('Customcode')->active[] = CFactory::_('Customcode')->memory[$id]; + unset($ids[$pointer]); + } + } + // check if any ids left to fetch if (ArrayHelper::check($ids)) { - if ($idArray = $this->checkCustomCodeMemory($ids)) - { - $query->select( - $this->db->quoteName( - array('a.id', 'a.code', 'a.comment_type') - ) - ); - $query->where( - $this->db->quoteName('a.id') . ' IN (' . implode( - ',', $idArray - ) . ')' - ); - $query->where( - $this->db->quoteName('a.target') . ' = 2' - ); // <--- to load the correct target - $loadInMemory = true; - } - else - { - // all values are already in memory continue - return true; - } - } - else - { - $query->select( - $this->db->quoteName( - array('a.id', 'a.code', 'a.comment_type', 'a.component', - 'a.from_line', 'a.hashtarget', 'a.hashendtarget', - 'a.path', 'a.to_line', 'a.type') - ) - ); - $query->where( - $this->db->quoteName('a.component') . ' = ' - . (int) $this->componentData->id - ); - $query->where( - $this->db->quoteName('a.target') . ' = 1' - ); // <--- to load the correct target - $query->order( - $this->db->quoteName('a.from_line') . ' ASC' - ); // <--- insure we always add code from top of file - // reset custom code - $this->customCode = array(); - } - $query->where($this->db->quoteName('a.published') . ' >= 1'); - $this->db->setQuery($query); - $this->db->execute(); - if ($this->db->getNumRows()) - { - $bucket = $this->db->loadAssocList('id'); - // open the code - foreach ($bucket as $nr => &$customCode) - { - $customCode['code'] = base64_decode($customCode['code']); - // always insure that the external code is loaded - $customCode['code'] = $this->setExternalCodeString( - $customCode['code'] - ); - // set the lang only if needed - if ($setLang) - { - $customCode['code'] = $this->setLangStrings( - $customCode['code'] - ); - } - // check for more custom code (since this is a custom code placeholder) - else - { - $customCode['code'] = $this->setCustomCodeData( - $customCode['code'], $debug, $nr - ); - } - // build the hash array - if (isset($customCode['hashtarget'])) - { - $customCode['hashtarget'] = explode( - "__", $customCode['hashtarget'] - ); - // is this a replace code, set end has array - if ($customCode['type'] == 1 - && strpos( - $customCode['hashendtarget'], '__' - ) !== false) - { - $customCode['hashendtarget'] = explode( - "__", $customCode['hashendtarget'] - ); - // NOW see if this is an end of page target (TODO not sure if the string is always d41d8cd98f00b204e9800998ecf8427e) - // I know this fix is not air-tight, but it should work as the value of an empty line when md5'ed is ^^^^ - // Then if the line number is only >>>one<<< it is almost always end of the page. - // So I am using those two values to detect end of page replace ending, to avoid mismatching the ending target hash. - if ($customCode['hashendtarget'][0] == 1 - && 'd41d8cd98f00b204e9800998ecf8427e' - === $customCode['hashendtarget'][1]) - { - // unset since this will force the replacement unto end of page. - unset($customCode['hashendtarget']); - } - } - } - } - // load this code into memory if needed - if ($loadInMemory === true) - { - $this->customCodeMemory = $this->customCodeMemory + $bucket; - } - $this->customCode = array_merge($this->customCode, $bucket); - - return true; + return $ids; } return false; @@ -8588,374 +7732,43 @@ class Get * get all the powers linkd to this component * * @return void - * + * @deprecated 3.3 Use CFactory::_('Power')->load($guids); */ protected function getPowers($guids) { - if (ArrayHelper::check($guids)) - { - foreach ($guids as $guid => $build) - { - $this->getPower($guid, $build); - } - } + CFactory::_('Power')->load($guids); } /** * get a power linkd to this component * * @return mixed - * + * @deprecated 3.3 Use CFactory::_('Power')->get($guid, $build); */ public function getPower($guid, $build = 0) { - if ((Config::get('add_power', true) || $build == 1) && $this->setPower($guid)) - { - return $this->powers[$guid]; - } - - return false; + CFactory::_('Power')->get($guid, $build); } /** * set a power linkd to this component * * @return bool - * + * @deprecated 3.3 */ protected function setPower($guid) { - // check if we have been here before - if (isset($this->statePowers[$guid])) - { - return $this->statePowers[$guid]; - } - elseif (GuidHelper::valid($guid)) - { - // Create a new query object. - $query = $this->db->getQuery(true); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::_('

Power building error

'), 'Error' + ); + $this->app->enqueueMessage( + JText::_( + 'Use of a deprecated method (setPower)!' + ), 'Error' + ); - $query->select('a.*'); - // from these tables - $query->from('#__componentbuilder_power AS a'); - $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); - $this->db->setQuery($query); - $this->db->execute(); - if ($this->db->getNumRows()) - { - // make sure that in recursion we - // don't try to load this power again - $this->statePowers[$guid] = true; - // get the power data - $power = $this->db->loadObject(); - // we set the fix usr if needed - $fix_url - = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id=' - . $power->id . '" target="_blank"'; - // set some keys - $power->target_type = 'P0m3R!'; - $power->key = $power->id . '_' . $power->target_type; - // now set the name - $power->name = $this->setPlaceholders( - $this->setDynamicValues($power->name), - $this->placeholders - ); - // now set the code_name and class name - $power->code_name = $power->class_name = ClassfunctionHelper::safe( - $power->name - ); - // set official name - $power->official_name = StringHelper::safe( - $power->name, 'W' - ); - // set namespace - $power->namespace = $this->setPlaceholders( - $power->namespace, $this->placeholders - ); - // validate namespace - if (strpos($power->namespace, '\\') === false) - { - // we raise an error message - $this->app->enqueueMessage( - JText::sprintf('

%s namespace error (%s)

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

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

', - ucfirst($power->type), $power->name, $power->namespace, - '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $power->type, - $fix_url), - 'Error' - ); - $this->statePowers[$guid] = false; - - // we break out here - return false; - } - else - { - // setup the path array - $path_array = (array) explode('\\', $power->namespace); - // make sure all sub folders in src dir is set and remove all characters that will not work in folders naming - $power->namespace = NamespaceHelper::safe(str_replace('.', '\\', $power->namespace)); - // make sure it has two or more - if (ArrayHelper::check($path_array) <= 1) - { - // we raise an error message - $this->app->enqueueMessage( - JText::sprintf('

%s namespace error (%s)

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

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

', - ucfirst($power->type), $power->name, $power->namespace, - '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $power->type, - $fix_url), - 'Error' - ); - $this->statePowers[$guid] = false; - - // we break out here - return false; - } - // get the file and class name (the last value in array) - $file_name = array_pop($path_array); - // src array bucket - $src_array = array(); - // do we have src folders - if (strpos($file_name, '.') !== false) - { - // we have src folders in the namespace - $src_array = (array) explode('.', $file_name); - // get the file and class name (the last value in array) - $power->file_name = array_pop($src_array); - // namespace array - $namespace_array = array_merge($path_array, $src_array); - } - else - { - // set the file name - $power->file_name = $file_name; - // namespace array - $namespace_array = $path_array; - } - // the last value is the same as the class name - if ($power->file_name !== $power->class_name) - { - // we raise an error message - $this->app->enqueueMessage( - JText::sprintf('

%s naming mismatch error (%s)

The %s name is %s and the ending file name in the namespace is %s. This is bad convention, please see psr-4 for more info.

Click here to fix this issue.

', - ucfirst($power->type), $power->name, $power->type, $power->class_name, $power->file_name, - '"https://www.php-fig.org/psr/psr-4/" target="_blank"', - $fix_url), - 'Error' - ); - $this->statePowers[$guid] = false; - - // we break out here - return false; - } - // make sure the arrays are namespace safe - $path_array = array_map(function ($val) { - return NamespaceHelper::safe($val); - }, $path_array); - $namespace_array = array_map(function ($val) { - return NamespaceHelper::safe($val); - }, $namespace_array); - // set the actual class namespace - $power->_namespace = implode('\\', $namespace_array); - // prefix values - $power->_namespace_prefix = $path_array; - // get the parent folder (the first value in array) - $prefix_folder = implode('.', $path_array); - // make sub folders if still found - $sub_folder = ''; - if (ArrayHelper::check($src_array)) - { - // make sure the arrays are namespace safe - $sub_folder = '/' . implode('/', array_map(function ($val) { - return NamespaceHelper::safe($val); - }, $src_array)); - } - // now we set the paths - $power->path_jcb = Config::get('jcb_powers_path', 'libraries/jcb_powers'); - $power->path_parent = $power->path_jcb . '/' . $prefix_folder; - $power->path = $power->path_parent . '/src' . $sub_folder; - } - // load use ids - $use = array(); - $as = array(); - // check if we have use selection - $power->use_selection = (isset($power->use_selection) - && JsonHelper::check( - $power->use_selection - )) ? json_decode($power->use_selection, true) : null; - if ($power->use_selection) - { - $use = array_values(array_map(function ($u) use(&$as) { - // track the AS options - if (empty($u['as'])) - { - $as[$u['use']] = 'default'; - } - else - { - $as[$u['use']] = (string) $u['as']; - } - // return the guid - return $u['use']; - }, $power->use_selection)); - } - // check if we have load selection - $power->load_selection = (isset($power->load_selection) - && JsonHelper::check( - $power->load_selection - )) ? json_decode($power->load_selection, true) : null; - if ($power->load_selection) - { - // load use ids - array_map(function ($l) { - // just load it directly and be done with it - return $this->setPower($l['load']); - }, $power->load_selection); - } - // see if we have implements - $power->implement_names = array(); - // does this implement - $power->implements = (isset($power->implements) - && JsonHelper::check( - $power->implements - )) ? json_decode($power->implements, true) : null; - if ($power->implements) - { - foreach ($power->implements as $implement) - { - if ($implement == -1 - && StringHelper::check($power->implements_custom)) - { - $power->implement_names[] = $this->setPlaceholders( - $this->setDynamicValues($power->implements_custom), - $this->placeholders - ); - // just add this once - unset($power->implements_custom); - } - // does this extend existing - elseif (GuidHelper::valid($implement)) - { - // check if it was set - if ($this->setPower($implement)) - { - // get the name - $power->implement_names[] = $this->getPower($implement, 1)->class_name; - // add to use - $use[] = $implement; - } - } - } - } - // does this extend something - $power->extends_name = null; - // we first check for custom extending options - if ($power->extends == -1 - && StringHelper::check($power->extends_custom)) - { - $power->extends_name = $this->setPlaceholders( - $this->setDynamicValues($power->extends_custom), - $this->placeholders - ); - // just add once - unset($power->extends_custom); - } - // does this extend existing - elseif (GuidHelper::valid($power->extends)) - { - // check if it was set - if ($this->setPower($power->extends)) - { - // get the name - $power->extends_name = $this->getPower($power->extends, 1)->class_name; - // add to use - $use[] = $power->extends; - } - } - // set GUI mapper - $guiMapper = array('table' => 'power', 'id' => (int) $power->id, 'type' => 'php'); - // add the header script - if ($power->add_head == 1) - { - // set GUI mapper field - $guiMapper['field'] = 'head'; - // base64 Decode code - $power->head = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( - base64_decode( - $power->head - ) - ), $this->placeholders - ), - $guiMapper - ) . PHP_EOL; - } - // now add all the extra use statements - if (ArrayHelper::check($use)) - { - foreach (array_unique($use) as $u) - { - if ($this->setPower($u)) - { - $add_use = $this->getPower($u, 1)->namespace; - // check if it is already added manually, you know how some people are - if (strpos($power->head, $add_use) === false) - { - // check if it has an AS option - if (isset($as[$u]) && StringHelper::check($as[$u]) && $as[$u] !== 'default') - { - $power->head .= 'use ' . $add_use . ' as ' . $as[$u] . ';' . PHP_EOL; - } - else - { - $power->head .= 'use ' . $add_use . ';' . PHP_EOL; - } - } - } - } - } - // now set the description - $power->description = (StringHelper::check($power->description)) ? $this->setPlaceholders( - $this->setDynamicValues($power->description), - $this->placeholders - ) : ''; - // add the main code if set - if (StringHelper::check($power->main_class_code)) - { - // set GUI mapper field - $guiMapper['field'] = 'main_class_code'; - // base64 Decode code - $power->main_class_code = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( - base64_decode( - $power->main_class_code - ) - ), $this->placeholders - ), - $guiMapper - ); - } - // store the power - $this->powers[$guid] = $power; - - return true; - } - } - // we failed to get the power, - // so we raise an error message - // only if guid is valid - if (GuidHelper::valid($guid)) - { - $this->app->enqueueMessage( - JText::sprintf('

Power guid:%s not found!

', $guid), - 'Error' - ); - } - // let's not try again - $this->statePowers[$guid] = false; - - return false; + return ''; } /** @@ -8993,8 +7806,8 @@ class Get // get the module data $module = $this->db->loadObject(); // update the name if it has dynamic values - $module->name = $this->setPlaceholders( - $this->setDynamicValues($module->name), + $module->name = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($module->name), $this->globalPlaceholders ); // set safe class function name @@ -9005,7 +7818,7 @@ class Get // set module folder name $module->folder_name = 'mod_' . strtolower($module->code_name); // set the lang key - $this->langKeys[strtoupper($module->folder_name)] = $module->id + CFactory::_('Language.Extractor')->langKeys[strtoupper($module->folder_name)] = $module->id . '_M0dU|3'; // return the path if ($module->target == 2) @@ -9034,7 +7847,7 @@ class Get protected function getModuleIDs() { if (($addjoomla_modules = GetHelper::var( - 'component_modules', Config::get('component_id'), 'joomla_component', + 'component_modules', CFactory::_('Config')->component_id, 'joomla_component', 'addjoomla_modules' )) !== false) { @@ -9132,15 +7945,15 @@ class Get // get the module data $module = $this->db->loadObject(); // tweak system to set stuff to the module domain - $_backup_target = $this->target; - $_backup_lang = $this->lang; - $_backup_langPrefix = Config::get('lang_prefix'); + $_backup_target = CFactory::_('Config')->build_target; + $_backup_lang = CFactory::_('Config')->lang_target; + $_backup_langPrefix = CFactory::_('Config')->lang_prefix; // set some keys $module->target_type = 'M0dU|3'; $module->key = $module->id . '_' . $module->target_type; // update to point to module - $this->target = $module->key; - $this->lang = $module->key; + CFactory::_('Config')->build_target = $module->key; + CFactory::_('Config')->lang_target = $module->key; // set version if not set if (empty($module->module_version)) { @@ -9160,8 +7973,8 @@ class Get $guiMapper = array('table' => 'joomla_module', 'id' => (int) $id, 'type' => 'php'); // update the name if it has dynamic values - $module->name = $this->setPlaceholders( - $this->setDynamicValues($module->name), $this->placeholders + $module->name = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($module->name), CFactory::_('Placeholder')->active ); // set safe class function name $module->code_name @@ -9176,9 +7989,9 @@ class Get ); // set langPrefix $this->langPrefix = 'MOD_' . strtoupper($module->code_name); - Config::set('lang_prefix', $this->langPrefix); + CFactory::_('Config')->set('lang_prefix', $this->langPrefix); // set lang prefix - $module->lang_prefix = Config::get('lang_prefix'); + $module->lang_prefix = CFactory::_('Config')->lang_prefix; // set module class name $module->class_helper_name = 'Mod' . ucfirst($module->code_name) . 'Helper'; @@ -9193,29 +8006,29 @@ class Get // set the zip name $module->zip_name = $module->folder_name . '_v' . str_replace( '.', '_', $module->module_version - ) . '__J' . Config::get('version', 3); + ) . '__J' . CFactory::_('Config')->joomla_version; // set module file name $module->file_name = $module->folder_name; // set module context $module->context = $module->file_name . '.' . $module->id; // set official_name lang strings - $this->setLangContent( - $module->key, Config::get('lang_prefix'), $module->official_name + CFactory::_('Language')->set( + $module->key, CFactory::_('Config')->lang_prefix, $module->official_name ); // set some placeholder for this module - $this->placeholders[$this->bbb . 'Module_name' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Module_name')] = $module->official_name; - $this->placeholders[$this->bbb . 'Module' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Module')] = ucfirst( $module->code_name ); - $this->placeholders[$this->bbb . 'module' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('module')] = strtolower( $module->code_name ); - $this->placeholders[$this->bbb . 'module.version' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('module.version')] = $module->module_version; - $this->placeholders[$this->bbb . 'module_version' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('module_version')] = str_replace( '.', '_', $module->module_version ); @@ -9229,11 +8042,11 @@ class Get } else { - $module->description = $this->setPlaceholders( - $this->setDynamicValues($module->description), - $this->placeholders + $module->description = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($module->description), + CFactory::_('Placeholder')->active ); - $this->setLangContent( + CFactory::_('Language')->set( $module->key, $module->lang_prefix . '_DESCRIPTION', $module->description ); @@ -9251,16 +8064,16 @@ class Get . JFactory::getDate($module->created)->format("jS F, Y") . "

"; // set xml description - $this->setLangContent( + CFactory::_('Language')->set( $module->key, $module->lang_prefix . '_XML_DESCRIPTION', $module->xml_description ); // update the readme if set if ($module->addreadme == 1 && !empty($module->readme)) { - $module->readme = $this->setPlaceholders( - $this->setDynamicValues(base64_decode($module->readme)), - $this->placeholders + $module->readme = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add(base64_decode($module->readme)), + CFactory::_('Placeholder')->active ); } else @@ -9297,13 +8110,13 @@ class Get $guiMapper['field'] = 'class_helper_header'; // base64 Decode code $module->class_helper_header = PHP_EOL - . $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + . CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode( $module->class_helper_header ) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ) . PHP_EOL; @@ -9316,11 +8129,11 @@ class Get // set GUI mapper field $guiMapper['field'] = 'class_helper_code'; // base64 Decode code - $module->class_helper_code = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $module->class_helper_code = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($module->class_helper_code) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -9346,11 +8159,11 @@ class Get { // set GUI mapper field $guiMapper['field'] = 'mod_code'; - $module->mod_code = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $module->mod_code = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($module->mod_code) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -9374,11 +8187,11 @@ class Get { // set GUI mapper field $guiMapper['field'] = 'default_header'; - $module->default_header = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $module->default_header = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($module->default_header) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -9394,11 +8207,11 @@ class Get // set GUI mapper field $guiMapper['field'] = 'default'; $guiMapper['type'] = 'html'; - $module->default = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $module->default = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($module->default) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -9520,7 +8333,7 @@ class Get )) { $module->fieldsets_label[$unique] - = $this->setLang($form['label']); + = CFactory::_('Language')->key($form['label']); } // build the fields $form['fields'] = array_map( @@ -9676,13 +8489,13 @@ class Get unset($module->{'add' . $addTarget}); } // load the library - if (!isset($this->libManager[$this->target])) + if (!isset($this->libManager[CFactory::_('Config')->build_target])) { - $this->libManager[$this->target] = array(); + $this->libManager[CFactory::_('Config')->build_target] = array(); } - if (!isset($this->libManager[$this->target][$module->code_name])) + if (!isset($this->libManager[CFactory::_('Config')->build_target][$module->code_name])) { - $this->libManager[$this->target][$module->code_name] + $this->libManager[CFactory::_('Config')->build_target][$module->code_name] = array(); } // make sure json become array @@ -9695,22 +8508,22 @@ class Get { foreach ($module->libraries as $library) { - if (!isset($this->libManager[$this->target][$module->code_name][$library])) + if (!isset($this->libManager[CFactory::_('Config')->build_target][$module->code_name][$library])) { if ($this->getMediaLibrary((int) $library)) { - $this->libManager[$this->target][$module->code_name][(int) $library] + $this->libManager[CFactory::_('Config')->build_target][$module->code_name][(int) $library] = true; } } } } elseif (is_numeric($module->libraries) - && !isset($this->libManager[$this->target][$module->code_name][(int) $module->libraries])) + && !isset($this->libManager[CFactory::_('Config')->build_target][$module->code_name][(int) $module->libraries])) { if ($this->getMediaLibrary((int) $module->libraries)) { - $this->libManager[$this->target][$module->code_name][(int) $module->libraries] + $this->libManager[CFactory::_('Config')->build_target][$module->code_name][(int) $module->libraries] = true; } } @@ -9741,14 +8554,14 @@ class Get $guiMapper['field'] = $scriptMethod . '_' . $scriptType; $module->{$scriptMethod . '_' . $scriptType} - = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode( $module->{$scriptMethod . '_' . $scriptType} ) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -9767,9 +8580,9 @@ class Get if ($module->add_sql == 1 && StringHelper::check($module->sql)) { - $module->sql = $this->setPlaceholders( - $this->setDynamicValues(base64_decode($module->sql)), - $this->placeholders + $module->sql = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add(base64_decode($module->sql)), + CFactory::_('Placeholder')->active ); } else @@ -9783,10 +8596,10 @@ class Get $module->sql_uninstall )) { - $module->sql_uninstall = $this->setPlaceholders( - $this->setDynamicValues( + $module->sql_uninstall = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($module->sql_uninstall) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); } else @@ -9800,9 +8613,9 @@ class Get $module->update_server_url )) { - $module->update_server_url = $this->setPlaceholders( - $this->setDynamicValues($module->update_server_url), - $this->placeholders + $module->update_server_url = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($module->update_server_url), + CFactory::_('Placeholder')->active ); } // add the update/sales server FTP details if that is the expected protocol @@ -9837,23 +8650,21 @@ class Get // update_server_xml_file_name // rest globals - $this->target = $_backup_target; - $this->lang = $_backup_lang; + CFactory::_('Config')->build_target = $_backup_target; + CFactory::_('Config')->lang_target = $_backup_lang; $this->langPrefix = $_backup_langPrefix; - Config::set('lang_prefix', $_backup_langPrefix); + CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); unset( - $this->placeholders[$this->bbb . 'Module_name' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Module_name')] ); - unset($this->placeholders[$this->bbb . 'Module' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'module' . $this->ddd]); + unset(CFactory::_('Placeholder')->active[Placefix::_('Module')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('module')]); unset( - $this->placeholders[$this->bbb . 'module.version' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('module.version')] ); unset( - $this->placeholders[$this->bbb . 'module_version' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('module_version')] ); $this->joomlaModules[$id] = $module; @@ -9875,27 +8686,21 @@ class Get { $xml = ''; $xml .= PHP_EOL . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix + $xml .= PHP_EOL . Indent::_(1) . '' . $module->lang_prefix . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'BUILDDATE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR' - . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'AUTHOREMAIL' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'AUTHORWEBSITE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'COPYRIGHT' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE' - . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $module->module_version + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('BUILDDATE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOR') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOREMAIL') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHORWEBSITE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('COPYRIGHT') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('LICENSE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $module->module_version . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix + $xml .= PHP_EOL . Indent::_(1) . '' . $module->lang_prefix . '_XML_DESCRIPTION'; - $xml .= $this->hhh . 'MAINXML' . $this->hhh; + $xml .= Placefix::_h('MAINXML'); $xml .= PHP_EOL . ''; return $xml; @@ -9910,8 +8715,8 @@ class Get public function getModAdminVvvvvvvdm($fieldScriptBucket) { $form_field_class = array(); - $form_field_class[] = $this->hhh . 'BOM' . $this->hhh . PHP_EOL; - $form_field_class[] = "//" . $this->setLine(__LINE__) + $form_field_class[] = Placefix::_h('BOM') . PHP_EOL; + $form_field_class[] = "//" . Line::_(__Line__, __Class__) . " No direct access to this file"; $form_field_class[] = "defined('_JEXEC') or die('Restricted access');"; $form_field_class[] = PHP_EOL . "use Joomla\CMS\Form\FormField;"; @@ -9919,23 +8724,23 @@ class Get $form_field_class[] = PHP_EOL . "class JFormFieldModadminvvvvvvvdm extends FormField"; $form_field_class[] = "{"; - $form_field_class[] = $this->_t(1) + $form_field_class[] = Indent::_(1) . "protected \$type = 'modadminvvvvvvvdm';"; - $form_field_class[] = PHP_EOL . $this->_t(1) + $form_field_class[] = PHP_EOL . Indent::_(1) . "protected function getLabel()"; - $form_field_class[] = $this->_t(1) . "{"; - $form_field_class[] = $this->_t(2) . "return;"; - $form_field_class[] = $this->_t(1) . "}"; - $form_field_class[] = PHP_EOL . $this->_t(1) + $form_field_class[] = Indent::_(1) . "{"; + $form_field_class[] = Indent::_(2) . "return;"; + $form_field_class[] = Indent::_(1) . "}"; + $form_field_class[] = PHP_EOL . Indent::_(1) . "protected function getInput()"; - $form_field_class[] = $this->_t(1) . "{"; - $form_field_class[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $form_field_class[] = Indent::_(1) . "{"; + $form_field_class[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get the document"; - $form_field_class[] = $this->_t(2) + $form_field_class[] = Indent::_(2) . "\$document = Factory::getDocument();"; $form_field_class[] = implode(PHP_EOL, $fieldScriptBucket); - $form_field_class[] = $this->_t(2) . "return; // noting for now :)"; - $form_field_class[] = $this->_t(1) . "}"; + $form_field_class[] = Indent::_(2) . "return; // noting for now :)"; + $form_field_class[] = Indent::_(1) . "}"; $form_field_class[] = "}"; return implode(PHP_EOL, $form_field_class); @@ -9950,7 +8755,7 @@ class Get protected function getPluginIDs() { if (($addjoomla_plugins = GetHelper::var( - 'component_plugins', Config::get('component_id'), 'joomla_component', + 'component_plugins', CFactory::_('Config')->component_id, 'joomla_component', 'addjoomla_plugins' )) !== false) { @@ -10027,8 +8832,8 @@ class Get // get the plugin data $plugin = $this->db->loadObject(); // update the name if it has dynamic values - $plugin->name = $this->setPlaceholders( - $this->setDynamicValues($plugin->name), + $plugin->name = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($plugin->name), $this->globalPlaceholders ); // update the name if it has dynamic values @@ -10041,7 +8846,7 @@ class Get // set plugin file name $plugin->file_name = strtolower($plugin->code_name); // set the lang key - $this->langKeys['PLG_' . strtoupper( + CFactory::_('Language.Extractor')->langKeys['PLG_' . strtoupper( $plugin->group . '_' . $plugin->file_name )] = $plugin->id . '_P|uG!n'; @@ -10138,15 +8943,15 @@ class Get // get the plugin data $plugin = $this->db->loadObject(); // tweak system to set stuff to the plugin domain - $_backup_target = $this->target; - $_backup_lang = $this->lang; - $_backup_langPrefix = Config::get('lang_prefix'); + $_backup_target = CFactory::_('Config')->build_target; + $_backup_lang = CFactory::_('Config')->lang_target; + $_backup_langPrefix = CFactory::_('Config')->lang_prefix; // set some keys $plugin->target_type = 'P|uG!n'; $plugin->key = $plugin->id . '_' . $plugin->target_type; // update to point to plugin - $this->target = $plugin->key; - $this->lang = $plugin->key; + CFactory::_('Config')->build_target = $plugin->key; + CFactory::_('Config')->lang_target = $plugin->key; // set version if not set if (empty($plugin->plugin_version)) { @@ -10156,8 +8961,8 @@ class Get $guiMapper = array('table' => 'joomla_plugin', 'id' => (int) $id, 'type' => 'php'); // update the name if it has dynamic values - $plugin->name = $this->setPlaceholders( - $this->setDynamicValues($plugin->name), $this->placeholders + $plugin->name = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($plugin->name), CFactory::_('Placeholder')->active ); // update the name if it has dynamic values $plugin->code_name @@ -10174,9 +8979,9 @@ class Get $plugin->code_name, $plugin->group ); - Config::set('lang_prefix', $this->langPrefix); + CFactory::_('Config')->set('lang_prefix', $this->langPrefix); // set lang prefix - $plugin->lang_prefix = Config::get('lang_prefix'); + $plugin->lang_prefix = CFactory::_('Config')->lang_prefix; // set plugin class name $plugin->class_name = PluginHelper::safeClassName( @@ -10198,46 +9003,46 @@ class Get // set the zip name $plugin->zip_name = $plugin->folder_name . '_v' . str_replace( '.', '_', $plugin->plugin_version - ) . '__J' . Config::get('version', 3); + ) . '__J' . CFactory::_('Config')->joomla_version; // set plugin file name $plugin->file_name = strtolower($plugin->code_name); // set plugin context $plugin->context = $plugin->folder_name . '.' . $plugin->id; // set official_name lang strings - $this->setLangContent( - $plugin->key, Config::get('lang_prefix'), $plugin->official_name + CFactory::_('Language')->set( + $plugin->key, CFactory::_('Config')->lang_prefix, $plugin->official_name ); // set some placeholder for this plugin - $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Plugin_name')] = $plugin->official_name; - $this->placeholders[$this->hhh . 'PLUGIN_NAME' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('PLUGIN_NAME')] = $plugin->official_name; - $this->placeholders[$this->bbb . 'Plugin' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Plugin')] = ucfirst( $plugin->code_name ); - $this->placeholders[$this->bbb . 'plugin' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('plugin')] = strtolower( $plugin->code_name ); - $this->placeholders[$this->bbb . 'Plugin_group' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Plugin_group')] = ucfirst( $plugin->group ); - $this->placeholders[$this->bbb . 'plugin_group' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('plugin_group')] = strtolower( $plugin->group ); - $this->placeholders[$this->bbb . 'plugin.version' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('plugin.version')] = $plugin->plugin_version; - $this->placeholders[$this->hhh . 'VERSION' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('VERSION')] = $plugin->plugin_version; - $this->placeholders[$this->bbb . 'plugin_version' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('plugin_version')] = str_replace( '.', '_', $plugin->plugin_version ); // set description - $this->placeholders[$this->hhh . 'DESCRIPTION' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')] = ''; if (!isset($plugin->description) || !StringHelper::check( @@ -10248,16 +9053,16 @@ class Get } else { - $plugin->description = $this->setPlaceholders( - $this->setDynamicValues($plugin->description), - $this->placeholders + $plugin->description = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($plugin->description), + CFactory::_('Placeholder')->active ); - $this->setLangContent( + CFactory::_('Language')->set( $plugin->key, $plugin->lang_prefix . '_DESCRIPTION', $plugin->description ); // set description - $this->placeholders[$this->hhh . 'DESCRIPTION' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')] = $plugin->description; $plugin->description = '

' . $plugin->description . '

'; @@ -10273,16 +9078,16 @@ class Get . JFactory::getDate($plugin->created)->format("jS F, Y") . "

"; // set xml discription - $this->setLangContent( + CFactory::_('Language')->set( $plugin->key, $plugin->lang_prefix . '_XML_DESCRIPTION', $plugin->xml_description ); // update the readme if set if ($plugin->addreadme == 1 && !empty($plugin->readme)) { - $plugin->readme = $this->setPlaceholders( - $this->setDynamicValues(base64_decode($plugin->readme)), - $this->placeholders + $plugin->readme = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add(base64_decode($plugin->readme)), + CFactory::_('Placeholder')->active ); } else @@ -10296,11 +9101,11 @@ class Get // set GUI mapper field $guiMapper['field'] = 'main_class_code'; // base64 Decode main_class_code. - $plugin->main_class_code = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $plugin->main_class_code = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($plugin->main_class_code) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -10311,11 +9116,11 @@ class Get // set GUI mapper field $guiMapper['field'] = 'head'; // base64 Decode head. - $plugin->head = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $plugin->head = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($plugin->head) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -10323,11 +9128,11 @@ class Get elseif (!empty($plugin->class_head)) { // base64 Decode head. - $plugin->head = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $plugin->head = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($plugin->class_head) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), array( 'table' => 'class_extends', @@ -10341,11 +9146,11 @@ class Get if (!empty($plugin->comment)) { // base64 Decode comment. - $plugin->comment = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + $plugin->comment = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($plugin->comment) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), array( 'table' => 'class_extends', @@ -10443,7 +9248,7 @@ class Get )) { $plugin->fieldsets_label[$unique] - = $this->setLang($form['label']); + = CFactory::_('Language')->key($form['label']); } // check for extra rule paths if (isset($form['addrulepath']) @@ -10647,14 +9452,14 @@ class Get $guiMapper['field'] = $scriptMethod . '_' . $scriptType; $plugin->{$scriptMethod . '_' . $scriptType} - = $this->setGuiCodePlaceholder( - $this->setPlaceholders( - $this->setDynamicValues( + = CFactory::_('Customcode.Gui')->set( + CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode( $plugin->{$scriptMethod . '_' . $scriptType} ) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ), $guiMapper ); @@ -10673,9 +9478,9 @@ class Get if ($plugin->add_sql == 1 && StringHelper::check($plugin->sql)) { - $plugin->sql = $this->setPlaceholders( - $this->setDynamicValues(base64_decode($plugin->sql)), - $this->placeholders + $plugin->sql = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add(base64_decode($plugin->sql)), + CFactory::_('Placeholder')->active ); } else @@ -10689,10 +9494,10 @@ class Get $plugin->sql_uninstall )) { - $plugin->sql_uninstall = $this->setPlaceholders( - $this->setDynamicValues( + $plugin->sql_uninstall = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add( base64_decode($plugin->sql_uninstall) - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); } else @@ -10706,9 +9511,9 @@ class Get $plugin->update_server_url )) { - $plugin->update_server_url = $this->setPlaceholders( - $this->setDynamicValues($plugin->update_server_url), - $this->placeholders + $plugin->update_server_url = CFactory::_('Placeholder')->update( + CFactory::_('Customcode')->add($plugin->update_server_url), + CFactory::_('Placeholder')->active ); } // add the update/sales server FTP details if that is the expected protocol @@ -10743,43 +9548,36 @@ class Get // update_server_xml_file_name // rest globals - $this->target = $_backup_target; - $this->lang = $_backup_lang; + CFactory::_('Config')->build_target = $_backup_target; + CFactory::_('Config')->lang_target = $_backup_lang; $this->langPrefix = $_backup_langPrefix; - Config::set('lang_prefix', $_backup_langPrefix); + CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); unset( - $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Plugin_name')] ); - unset($this->placeholders[$this->bbb . 'Plugin' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'plugin' . $this->ddd]); + unset(CFactory::_('Placeholder')->active[Placefix::_('Plugin')]); + unset(CFactory::_('Placeholder')->active[Placefix::_('plugin')]); unset( - $this->placeholders[$this->bbb . 'Plugin_group' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Plugin_group')] ); unset( - $this->placeholders[$this->bbb . 'plugin_group' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('plugin_group')] ); unset( - $this->placeholders[$this->bbb . 'plugin.version' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('plugin.version')] ); unset( - $this->placeholders[$this->bbb . 'plugin_version' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('plugin_version')] ); unset( - $this->placeholders[$this->hhh . 'VERSION' - . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('VERSION')] ); unset( - $this->placeholders[$this->hhh . 'DESCRIPTION' - . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')] ); unset( - $this->placeholders[$this->hhh . 'PLUGIN_NAME' - . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('PLUGIN_NAME')] ); $this->joomlaPlugins[$id] = $plugin; @@ -10801,59 +9599,26 @@ class Get { $xml = ''; $xml .= PHP_EOL . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix + $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->lang_prefix . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'BUILDDATE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR' - . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'AUTHOREMAIL' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'AUTHORWEBSITE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh - . 'COPYRIGHT' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE' - . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->plugin_version + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('BUILDDATE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOR') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOREMAIL') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHORWEBSITE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('COPYRIGHT') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('LICENSE') . ''; + $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->plugin_version . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix + $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->lang_prefix . '_XML_DESCRIPTION'; - $xml .= $this->hhh . 'MAINXML' . $this->hhh; + $xml .= Placefix::_h('MAINXML'); $xml .= PHP_EOL . ''; return $xml; } - /** - * check if we already have these ids in local memory - * - * @return void - * - */ - protected function checkCustomCodeMemory($ids) - { - // reset custom code - $this->customCode = array(); - foreach ($ids as $pointer => $id) - { - if (isset($this->customCodeMemory[$id])) - { - $this->customCode[] = $this->customCodeMemory[$id]; - unset($ids[$pointer]); - } - } - // check if any ids left to fetch - if (ArrayHelper::check($ids)) - { - return $ids; - } - - return false; - } - /** * store the code * @@ -10954,17 +9719,14 @@ class Get $this->globalPlaceholders ); $placeholders[StringHelper::safe( - Config::get('component_code_name'), 'F' + CFactory::_('Config')->component_code_name, 'F' ) . 'Helper::'] - = $this->bbb - . 'Component' . $this->ddd . 'Helper::'; + = Placefix::_('Component') . 'Helper::'; $placeholders['COM_' . StringHelper::safe( - Config::get('component_code_name'), 'U' + CFactory::_('Config')->component_code_name, 'U' )] - = 'COM_' . $this->bbb - . 'COMPONENT' . $this->ddd; - $placeholders['com_' . Config::get('component_code_name')] = 'com_' . $this->bbb - . 'component' . $this->ddd; + = 'COM_' . Placefix::_('COMPONENT'); + $placeholders['com_' . CFactory::_('Config')->component_code_name] = 'com_' . Placefix::_('component'); // putt the last first $placeholders = array_reverse($placeholders, true); @@ -11034,7 +9796,7 @@ class Get ) { // we add a new search for the GUI CODE Blocks - $this->guiCodeSearch($file, $placeholders, $today, $target); + CFactory::_('Customcode.Gui')->search($file, $placeholders, $today, $target); // reset each time per file $loadEndFingerPrint = false; $endFingerPrint = array(); @@ -11120,7 +9882,7 @@ class Get (int) $lineNumber ); // 'toline' // first reverse engineer this code block - $c0de = $this->reversePlaceholders( + $c0de = CFactory::_('Placeholder.Reverse')->engine( implode('', $codeBucket[$pointer[$targetKey]]), $placeholders, $target ); @@ -11143,7 +9905,7 @@ class Get = $this->db->quoteName('to_line') . ' = ' . $this->db->quote($lineNumber); // first reverse engineer this code block - $c0de = $this->reversePlaceholders( + $c0de = CFactory::_('Placeholder.Reverse')->engine( implode('', $codeBucket[$pointer[$targetKey]]), $placeholders, $target, $this->existingCustomCode[$pointer[$targetKey]]['id'] @@ -11309,7 +10071,7 @@ class Get ); // 'comment_type' $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote( - (int) Config::get('component_id') + (int) CFactory::_('Config')->component_id ); // 'component' $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote( @@ -11366,7 +10128,7 @@ class Get . $this->db->quote($commentType); $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('component') . ' = ' - . $this->db->quote(Config::get('component_id')); + . $this->db->quote(CFactory::_('Config')->component_id); $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('from_line') . ' = ' . $this->db->quote($lineNumber); @@ -11456,7 +10218,7 @@ class Get } // update the script - return $this->setPlaceholders($script, $locker); + return CFactory::_('Placeholder')->update($script, $locker); } // check if we should hash a file if (strpos($script, 'HASHFILE((((') !== false) @@ -11485,7 +10247,7 @@ class Get } // update the script - return $this->setPlaceholders($script, $locker); + return CFactory::_('Placeholder')->update($script, $locker); } return $script; @@ -11513,15 +10275,15 @@ class Get { $locker['LOCKBASE64((((' . $value . '))))'] = "base64_decode( preg_replace('/\s+/', ''," . - PHP_EOL . $this->_t(2) . "'" . + PHP_EOL . Indent::_(2) . "'" . wordwrap( - base64_encode($value), 64, PHP_EOL . $this->_t(2), true + base64_encode($value), 64, PHP_EOL . Indent::_(2), true ) . "'))"; } // update the script - return $this->setPlaceholders($script, $locker); + return CFactory::_('Placeholder')->update($script, $locker); } return $script; @@ -11534,93 +10296,11 @@ class Get * @param array $config The placeholder config values * * @return string - * + * @deprecated 3.3 Use CFactory::_('Customcode.Gui')->set($string, $config); */ public function setGuiCodePlaceholder($string, $config) { - if (StringHelper::check($string)) - { - if (Config::get('add_placeholders', false) - && $this->canAddGuiCodePlaceholder( - $string - ) - && ArrayHelper::check($config) - && isset($config['table']) - && StringHelper::check($config['table']) - && isset($config['field']) - && StringHelper::check($config['field']) - && isset($config['type']) - && StringHelper::check($config['type']) - && isset($config['id']) - && is_numeric($config['id'])) - { - // if we have a key we must get the ID - if (isset($config['key']) - && StringHelper::check($config['key']) - && $config['key'] !== 'id') - { - if (($id = GetHelper::var( - $config['table'], $config['id'], $config['key'], - 'id' - )) !== false - && is_numeric($id)) - { - $config['id'] = $id; - } - else - { - // we must give a error message to inform the user of this issue. (should never happen) - $this->app->enqueueMessage( - JText::sprintf( - 'ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set.', - $config['table'], $config['field'], - $config['key'], $config['id'] - ), 'Error' - ); - // check some config - if (!isset($config['prefix'])) - { - $config['prefix'] = ''; - } - - return $config['prefix'] . $string; - } - } - // check some config - if (!isset($config['prefix'])) - { - $config['prefix'] = PHP_EOL; - } - // add placheolder based on type of code - switch (strtolower($config['type'])) - { - // adding with html commenting - case 'html': - $front = $config['prefix'] . '' . PHP_EOL; - $back = '' - ); - - if (($guiCode = ArrayHelper::merge($guiCode)) !== false - && ArrayHelper::check($guiCode, true)) - { - foreach ($guiCode as $code) - { - $first_line = strtok($code, PHP_EOL); - // get the GUI target details - $query = explode('.', trim($first_line, '.')); - // only continue if we have 3 values in the query - if (is_array($query) && count($query) >= 3) - { - // cleanup the newlines around the code - $code = trim(str_replace($first_line, '', $code), PHP_EOL) - . PHP_EOL; - // set the ID - $id = (int) $query[2]; - // make the field name save - $field = FieldHelper::safe($query[1]); - // make the table name save - $table = StringHelper::safe($query[0]); - // reverse placeholder as much as we can - $code = $this->reversePlaceholders( - $code, $placeholders, $target, $id, $field, $table - ); - // update the GUI/Tables/Database - $object = new stdClass(); - $object->id = $id; - $object->{$field} = base64_encode( - $code - ); // (TODO) this may not always work... - // update the value in GUI - $this->db->updateObject( - '#__componentbuilder_' . (string) $table, $object, 'id' - ); - } - } - } + CFactory::_('Customcode.Gui')->search($file, $placeholders, $today, $target); } /** @@ -11820,24 +10452,14 @@ class Get * @param string $table The table name * * @return string - * + * @deprecated 3.3 Use CFactory::_('Placeholder.Reverse')->engine($string, $placeholders, $target, $id, $field, $table); */ protected function reversePlaceholders($string, &$placeholders, &$target, $id = null, $field = 'code', $table = 'custom_code' ) { - // get local code if set - if ($id > 0 - && $code = base64_decode( - GetHelper::var($table, $id, 'id', $field) - )) - { - $string = $this->setReverseLangPlaceholders( - $string, $code, $target - ); - } - - return $this->setPlaceholders($string, $placeholders, 2); + // use the new container class + CFactory::_('Placeholder.Reverse')->engine($string, $placeholders, $target, $id, $field, $table); } /** @@ -11848,7 +10470,7 @@ class Get * @param string $target The target path type * * @return string - * + * @deprecated 3.3 See $this->reversePlaceholders(); */ protected function setReverseLangPlaceholders($updateString, $string, &$target @@ -11871,49 +10493,49 @@ class Get // start lang holder $langHolders = array(); // set the lang for both since we don't know what area is being targeted - $_tmp = $this->lang; + $_tmp = CFactory::_('Config')->lang_target; // set the lang based on target if (strpos($target, 'module') !== false) { // backup lang prefix - $_tmp_lang_prefix = Config::get('lang_prefix'); + $_tmp_lang_prefix = CFactory::_('Config')->lang_prefix; // set the new lang prefix $this->langPrefix = strtoupper( str_replace('module', 'mod', $target) ); - Config::set('lang_prefix', $this->langPrefix); + CFactory::_('Config')->set('lang_prefix', $this->langPrefix); // now set the lang - if (isset($this->langKeys[Config::get('lang_prefix')])) + if (isset(CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix])) { - $this->lang = $this->langKeys[Config::get('lang_prefix')]; + CFactory::_('Config')->lang_target = CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix]; } else { - $this->lang = 'module'; + CFactory::_('Config')->lang_target = 'module'; } } elseif (strpos($target, 'plugin') !== false) { // backup lang prefix - $_tmp_lang_prefix = Config::get('lang_prefix'); + $_tmp_lang_prefix = CFactory::_('Config')->lang_prefix; // set the new lang prefix $this->langPrefix = strtoupper( str_replace('plugin', 'plg', $target) ); - Config::set('lang_prefix', $this->langPrefix); + CFactory::_('Config')->set('lang_prefix', $this->langPrefix); // now set the lang - if (isset($this->langKeys[Config::get('lang_prefix')])) + if (isset(CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix])) { - $this->lang = $this->langKeys[Config::get('lang_prefix')]; + CFactory::_('Config')->lang_target = CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix]; } else { - $this->lang = 'plugin'; + CFactory::_('Config')->lang_target = 'plugin'; } } else { - $this->lang = 'both'; + CFactory::_('Config')->lang_target = 'both'; } // set language data foreach ($langStringTargets as $langStringTarget) @@ -11941,9 +10563,9 @@ class Get continue; } // build lang key - $keyLang = Config::get('lang_prefix') . '_' . $_keyLang; + $keyLang = CFactory::_('Config')->lang_prefix . '_' . $_keyLang; // set lang content string - $this->setLangContent($this->lang, $keyLang, $lang); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $keyLang, $lang); // reverse the placeholders foreach ($langStringTargets as $langStringTarget) { @@ -11954,17 +10576,17 @@ class Get } } // return the found placeholders - $updateString = $this->setPlaceholders( + $updateString = CFactory::_('Placeholder')->update( $updateString, $langHolders ); } // reset the lang - $this->lang = $_tmp; + CFactory::_('Config')->lang_target = $_tmp; // also rest the lang prefix if set if (isset($_tmp_lang_prefix)) { $this->langPrefix = $_tmp_lang_prefix; - Config::set('lang_prefix', $_tmp_lang_prefix); + CFactory::_('Config')->set('lang_prefix', $_tmp_lang_prefix); } } @@ -11984,63 +10606,12 @@ class Get * 3 -> Remove placeholders not in data string * * @return string - * + * @deprecated 3.3 Use CFactory::_('Placeholder')->update($data, $placeholder, $action); */ public function setPlaceholders($data, &$placeholder, $action = 1) { - // make sure the placeholders is an array - if (!ArrayHelper::check($placeholder)) - { - // This is an error, (TODO) actualy we need to add a kind of log here to know that this happened - return $data; - } - // continue with the work of replacement - if (1 == $action) // <-- just replace (default) - { - return str_replace( - array_keys($placeholder), array_values($placeholder), $data - ); - } - elseif (2 == $action) // <-- check if data string has placeholders - { - $replace = false; - foreach ($placeholder as $key => $val) - { - if (strpos($data, $key) !== false) - { - $replace = true; - break; - } - } - // only replace if the data has these placeholder values - if ($replace === true) - { - - return str_replace( - array_keys($placeholder), array_values($placeholder), $data - ); - } - } - elseif (3 == $action) // <-- remove placeholders not in data string - { - $replace = $placeholder; - foreach ($replace as $key => $val) - { - if (strpos($data, $key) === false) - { - unset($replace[$key]); - } - } - // only replace if the data has these placeholder values - if (ArrayHelper::check($replace)) - { - return str_replace( - array_keys($replace), array_values($replace), $data - ); - } - } - - return $data; + // use the new container class + CFactory::_('Placeholder')->update($data, $placeholder, $action); } /** @@ -12050,80 +10621,11 @@ class Get * @param int $id The code id in the system * * @return array on success - * + * @deprecated 3.3 Use CFactory::_('Placeholder')->keys($type, $id); */ public function getPlaceHolder($type, $id) { - switch ($type) - { - case 11: - //***[REPLACED$$$$]***//**1**/ - if (Config::get('add_placeholders', false) === true) - { - return array( - 'start' => '/***[REPLACED$$$$]***//**' . $id . '**/', - 'end' => '/***[/REPLACED$$$$]***/'); - } - else - { - return array( - 'start' => "", - 'end' => ""); - } - break; - case 12: - //***[INSERTED$$$$]***//**1**/ - if (Config::get('add_placeholders', false) === true) - { - return array( - 'start' => '/***[INSERTED$$$$]***//**' . $id . '**/', - 'end' => '/***[/INSERTED$$$$]***/'); - } - else - { - return array( - 'start' => "", - 'end' => ""); - } - break; - case 21: - // - if (Config::get('add_placeholders', false) === true) - { - return array( - 'start' => '', - 'end' => ''); - } - else - { - return array( - 'start' => "", - 'end' => ""); - } - break; - case 22: - // - if (Config::get('add_placeholders', false) === true) - { - return array( - 'start' => '', - 'end' => ''); - } - else - { - return array( - 'start' => "", - 'end' => " "); - } - break; - case 3: - return array( - 'start' => "", - 'end' => ""); - break; - } - - return false; + return CFactory::_('Placeholder')->keys($type, $id); } /** @@ -12138,15 +10640,15 @@ class Get $localPaths = array(); // admin path $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' - . Config::get('component_code_name'); + . CFactory::_('Config')->component_code_name; // site path $localPaths['site'] = JPATH_ROOT . '/components/com_' - . Config::get('component_code_name'); + . CFactory::_('Config')->component_code_name; // media path $localPaths['media'] = JPATH_ROOT . '/media/com_' - . Config::get('component_code_name'); + . CFactory::_('Config')->component_code_name; // power path - $localPaths['power'] = JPATH_ROOT . '/' . Config::get('jcb_powers_path', 'libraries/jcb_powers'); + $localPaths['power'] = JPATH_ROOT . '/' . CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers'); // lets also go over the REPOS (TODO) // Painfull but we need to folder paths for the linked modules if (($module_ids = $this->getModuleIDs()) !== false) diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 6c9e1f0ac..5efa2d28a 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -20,7 +20,10 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\FileHelper; -use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; /** @@ -29,6 +32,7 @@ use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; class Structure extends Get { + /** * The folder counter * @@ -370,56 +374,50 @@ class Structure extends Get /** * Constructor */ - public function __construct($config = array()) + public function __construct() { // first we run the perent constructor - if (parent::__construct($config)) + if (parent::__construct()) { // set the standard admin file $this->stdRootFiles[] = $this->componentData->name_code . '.php'; // set incase no extra admin folder are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FOLDERS')] = ''; // set incase no extra site folder are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FOLDERS')] = ''; // set incase no extra media folder are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')] = ''; // set incase no extra admin files are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FILES')] = ''; // set incase no extra site files are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FILES' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FILES')] = ''; // set incase no extra media files are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FILES' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FILES')] = ''; // run global updater ComponentbuilderHelper::runGlobalUpdater(); // set the template path - $this->templatePath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_' - . $this->joomlaVersions[Config::get('version', 3)]['folder_key']; + $this->templatePath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_' + . $this->joomlaVersions[CFactory::_('Config')->joomla_version]['folder_key']; // set some default names $this->componentSalesName = 'com_' . $this->componentData->sales_name . '__J' - . Config::get('version', 3); + . CFactory::_('Config')->joomla_version; $this->componentBackupName = 'com_' . $this->componentData->sales_name . '_v' . str_replace( '.', '_', $this->componentData->component_version - ) . '__J' . Config::get('version', 3); + ) . '__J' . CFactory::_('Config')->joomla_version; $this->componentFolderName = 'com_' . $this->componentData->name_code . '_v' . str_replace( '.', '_', $this->componentData->component_version - ) . '__J' . Config::get('version', 3); + ) . '__J' . CFactory::_('Config')->joomla_version; // set component folder path - $this->componentPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' + $this->componentPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $this->componentFolderName; // set the template path for custom $this->templatePathCustom = $this->params->get( @@ -438,7 +436,7 @@ class Structure extends Get // set the Joomla Version Data $this->joomlaVersionData = $this->setJoomlaVersionData(); // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterSetJoomlaVersionData', array(&$this->componentContext, &$this->joomlaVersionData) ); @@ -466,24 +464,6 @@ class Structure extends Get return false; } - /** - * Set the line number in comments - * - * @param int $nr The line number - * - * @return string - * - */ - private function setLine($nr) - { - if (Config::get('debug_line_nr', false)) - { - return ' [Structure ' . $nr . ']'; - } - - return ''; - } - /** * Build the Powers files, folders * @@ -492,16 +472,20 @@ class Structure extends Get */ private function buildPowers() { - if (ArrayHelper::check($this->powers)) + if (ArrayHelper::check(CFactory::_('Power')->active)) { + // for plugin event TODO change event api signatures + $this->powers = CFactory::_('Power')->active; // Trigger Event: jcb_ce_onBeforeSetModules - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildPowers', array(&$this->componentContext, &$this->powers) ); + // for plugin event TODO change event api signatures + CFactory::_('Power')->active = $this->powers; // we track the creation of htaccess files $htaccess = array(); - foreach ($this->powers as $power) + foreach (CFactory::_('Power')->active as $power) { if (ObjectHelper::check($power) && isset($power->path) @@ -533,8 +517,8 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . - PHP_EOL . $this->hhh . 'POWERCODE' . $this->hhh + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . + PHP_EOL . Placefix::_h('POWERCODE') ); $this->newFiles[$power->key][] = $fileDetails; // count the file created @@ -606,7 +590,7 @@ class Structure extends Get if (ArrayHelper::check($this->joomlaModules)) { // Trigger Event: jcb_ce_onBeforeSetModules - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildModules', array(&$this->componentContext, &$this->joomlaModules) ); @@ -619,7 +603,7 @@ class Structure extends Get )) { // module path - $module->folder_path = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' + $module->folder_path = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $module->folder_name; // set the module paths $this->dynamicPaths[$module->key] = $module->folder_path; @@ -635,11 +619,11 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'MODCODE' . $this->hhh + Placefix::_h('MODCODE') ); $this->newFiles[$module->key][] = $fileDetails; // count the file created @@ -654,7 +638,7 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . @@ -666,7 +650,7 @@ class Structure extends Get ' */' . PHP_EOL . "class " . $module->class_data_name . ' extends \JObject' . PHP_EOL . - "{" . $this->hhh . 'DYNAMICGETS' . $this->hhh . "}" + "{" . Placefix::_h('DYNAMICGETS') . "}" . PHP_EOL ); $this->newFiles[$module->key][] = $fileDetails; @@ -683,13 +667,13 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'HELPERCODE' . $this->hhh + Placefix::_h('HELPERCODE') ); $this->newFiles[$module->key][] = $fileDetails; // count the file created @@ -717,11 +701,11 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'MODDEFAULT' . $this->hhh + Placefix::_h('MODDEFAULT') ); $this->newFiles[$module->key][] = $fileDetails; // count the file created @@ -736,13 +720,13 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'INSTALLCLASS' . $this->hhh + Placefix::_h('INSTALLCLASS') ); $this->newFiles[$module->key][] = $fileDetails; // count the file created @@ -789,16 +773,16 @@ class Structure extends Get 'zip' => 'mod_admin.css'); $this->writeFile( $fileDetails['path'], - $this->hhh . 'BOM' . $this->hhh . PHP_EOL + Placefix::_h('BOM') . PHP_EOL . PHP_EOL . $css ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; // add the field script - $field_script_bucket[] = $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Custom CSS"; - $field_script_bucket[] = $this->_t(2) + $field_script_bucket[] = Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Custom CSS"; + $field_script_bucket[] = Indent::_(2) . "\$document->addStyleSheet('" . $target_path . "/modules/" . $module->folder_name . "/css/mod_admin.css', ['version' => 'auto', 'relative' => true]);"; @@ -824,16 +808,16 @@ class Structure extends Get 'zip' => 'mod_admin.js'); $this->writeFile( $fileDetails['path'], - $this->hhh . 'BOM' . $this->hhh . PHP_EOL + Placefix::_h('BOM') . PHP_EOL . PHP_EOL . $javascript ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; // add the field script - $field_script_bucket[] = $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Custom JS"; - $field_script_bucket[] = $this->_t(2) + $field_script_bucket[] = Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Custom JS"; + $field_script_bucket[] = Indent::_(2) . "\$document->addScript('" . $target_path . "/modules/" . $module->folder_name . "/js/mod_admin.js', ['version' => 'auto', 'relative' => true]);"; @@ -890,7 +874,7 @@ class Structure extends Get . '.xml'); // build basic XML $xml = ''; - $xml .= PHP_EOL . ''; @@ -919,13 +903,13 @@ class Structure extends Get if ($add_component_path) { $xml .= PHP_EOL . '_t(1) + $xml .= PHP_EOL . Indent::_(1) . 'addrulepath="/administrator/components/com_' - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . '/models/rules"'; - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . 'addfieldpath="/administrator/components/com_' - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . '/models/fields"'; $xml .= PHP_EOL . '>'; } @@ -948,7 +932,7 @@ class Structure extends Get $field_name_inner = $field_names[1]; } } - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . ''; foreach ($fieldsets as $fieldset => $field) @@ -1002,30 +986,30 @@ class Structure extends Get || isset($module->add_field_path[$file . $field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
add_rule_path[$file . $field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addrulepath="' . $module->add_rule_path[$file . $field_name . $fieldset] . '"'; } if (isset($module->add_field_path[$file . $field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addfieldpath="' . $module->add_field_path[$file . $field_name . $fieldset] . '"'; } - $xml .= PHP_EOL . $this->_t(1) . '>'; + $xml .= PHP_EOL . Indent::_(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
'; } // check if we have an inner field set @@ -1033,25 +1017,25 @@ class Structure extends Get $field_name_inner )) { - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . ''; } // add the placeholder of the fields - $xml .= $this->hhh . 'FIELDSET_' . $file - . $field_name . $fieldset . $this->hhh; + $xml .= Placefix::_h('FIELDSET_' . $file + . $field_name . $fieldset ); // check if we have an inner field set if (StringHelper::check( $field_name_inner )) { - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . ''; } - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . '
'; } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } $xml .= PHP_EOL . ''; // add xml to file @@ -1096,7 +1080,7 @@ class Structure extends Get $this->createFolder($module->folder_path . '/language'); // also create the lang tag folder $this->createFolder( - $module->folder_path . '/language/' . Config::get('lang_tag', 'en-GB') + $module->folder_path . '/language/' . CFactory::_('Config')->get('lang_tag', 'en-GB') ); // check if this lib has files if (isset($module->files) @@ -1187,7 +1171,7 @@ class Structure extends Get if (ArrayHelper::check($this->joomlaPlugins)) { // Trigger Event: jcb_ce_onBeforeSetPlugins - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildPlugins', array(&$this->componentContext, &$this->joomlaPlugins) ); @@ -1200,7 +1184,7 @@ class Structure extends Get )) { // plugin path - $plugin->folder_path = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' + $plugin->folder_path = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $plugin->folder_name; // set the plugin paths $this->dynamicPaths[$plugin->key] = $plugin->folder_path; @@ -1216,11 +1200,11 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'MAINCLASS' . $this->hhh + Placefix::_h('MAINCLASS') ); $this->newFiles[$plugin->key][] = $fileDetails; // count the file created @@ -1247,13 +1231,13 @@ class Structure extends Get $this->writeFile( $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL + PHP_EOL . Placefix::_h('BOM') . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'INSTALLCLASS' . $this->hhh + Placefix::_h('INSTALLCLASS') ); $this->newFiles[$plugin->key][] = $fileDetails; // count the file created @@ -1299,9 +1283,9 @@ class Structure extends Get . '.xml'); // biuld basic XML $xml = ''; - $xml .= PHP_EOL . ''; // search if we must add the component path $add_component_path = false; @@ -1328,13 +1312,13 @@ class Structure extends Get if ($add_component_path) { $xml .= PHP_EOL . '_t(1) + $xml .= PHP_EOL . Indent::_(1) . 'addrulepath="/administrator/components/com_' - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . '/models/rules"'; - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . 'addfieldpath="/administrator/components/com_' - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . '/models/fields"'; $xml .= PHP_EOL . '>'; } @@ -1357,7 +1341,7 @@ class Structure extends Get $field_name_inner = $field_names[1]; } } - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . ''; foreach ($fieldsets as $fieldset => $field) @@ -1393,30 +1377,30 @@ class Structure extends Get if (isset($plugin->add_rule_path[$file . $field_name . $fieldset]) || isset($plugin->add_field_path[$file . $field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
add_rule_path[$file . $field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addrulepath="' . $plugin->add_rule_path[$file . $field_name . $fieldset] . '"'; } if (isset($plugin->add_field_path[$file . $field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addfieldpath="' . $plugin->add_field_path[$file . $field_name . $fieldset] . '"'; } - $xml .= PHP_EOL . $this->_t(1) . '>'; + $xml .= PHP_EOL . Indent::_(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
'; } // check if we have an inner field set @@ -1424,25 +1408,25 @@ class Structure extends Get $field_name_inner )) { - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . ''; } // add the placeholder of the fields - $xml .= $this->hhh . 'FIELDSET_' . $file - . $field_name . $fieldset . $this->hhh; + $xml .= Placefix::_h('FIELDSET_' . $file + . $field_name . $fieldset ); // check if we have an inner field set if (StringHelper::check( $field_name_inner )) { - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . ''; } - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . '
'; } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } $xml .= PHP_EOL . ''; // add xml to file @@ -1487,7 +1471,7 @@ class Structure extends Get $this->createFolder($plugin->folder_path . '/language'); // also creat the lang tag folder path $this->createFolder( - $plugin->folder_path . '/language/' . Config::get('lang_tag', 'en-GB') + $plugin->folder_path . '/language/' . CFactory::_('Config')->get('lang_tag', 'en-GB') ); // check if this lib has files if (isset($plugin->files) @@ -1603,7 +1587,7 @@ class Structure extends Get if (ArrayHelper::check($this->libraries)) { // Trigger Event: jcb_ce_onBeforeSetLibraries - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeSetLibraries', array(&$this->componentContext, &$this->libraries) ); @@ -1712,9 +1696,8 @@ class Structure extends Get if ($addLocalFolder) { // add folder to xml of media folders - $this->fileContentStatic[$this->hhh - . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] - .= PHP_EOL . $this->_t(2) . "" + $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')] + .= PHP_EOL . Indent::_(2) . "" . $libFolder . ""; } } @@ -2072,7 +2055,7 @@ class Structure extends Get $this->joomlaVersionData->move->static )) { - $codeName = Config::get('component_code_name'); + $codeName = CFactory::_('Config')->component_code_name; // TODO needs more looking at this must be dynamic actually $this->notNew[] = 'LICENSE.txt'; // do license check @@ -2289,16 +2272,16 @@ class Structure extends Get if ($add_to_extra) { // set the tab - $eTab = $this->_t(2); + $eTab = Indent::_(2); if ('admin' === $checker[0]) { - $eTab = $this->_t(3); + $eTab = Indent::_(3); } // set the xml file - $this->fileContentStatic[$this->hhh . 'EXSTRA_' + $this->fileContentStatic[Placefix::_h('EXSTRA_' . StringHelper::safe( $checker[0], 'U' - ) . '_' . $eNAME . $this->hhh] + ) . '_' . $eNAME)] .= PHP_EOL . $eTab . "<" . $ename . ">" . $checker[1] . ""; } @@ -2348,24 +2331,18 @@ class Structure extends Get { $target = array('admin' => $view['settings']->name_list); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } if ($view['settings']->name_single != 'null') { $target = array('admin' => $view['settings']->name_single); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique( $target, 'single', false, $config ); @@ -2379,12 +2356,9 @@ class Structure extends Get // setup the front site edit-view files $target = array('site' => $view['settings']->name_single); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'edit', false, $config); } } @@ -2416,24 +2390,18 @@ class Structure extends Get { // set list view $target = array('site' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('site' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } } @@ -2456,24 +2424,18 @@ class Structure extends Get { // set list view$view $target = array('custom_admin' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('custom_admin' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } } @@ -2880,7 +2842,7 @@ class Structure extends Get private function setJoomlaVersionData() { // option to load other settings - $custom_settings = $this->templatePath . '/settings_' . Config::get('component_code_name') . '.json'; + $custom_settings = $this->templatePath . '/settings_' . CFactory::_('Config')->component_code_name . '.json'; // set the version data if (File::exists($custom_settings)) { @@ -3123,8 +3085,8 @@ class Structure extends Get '//', '/', $custom['file'] ); // update the dynamic component name placholders in file names - $custom['path'] = $this->setPlaceholders( - $custom['path'], $this->placeholders + $custom['path'] = CFactory::_('Placeholder')->update( + $custom['path'], CFactory::_('Placeholder')->active ); // get the path info $pathInfo = pathinfo($custom['path']); @@ -3263,10 +3225,10 @@ class Structure extends Get */ protected function updateDynamicPath($path) { - return $this->setPlaceholders( - $this->setPlaceholders( + return CFactory::_('Placeholder')->update( + CFactory::_('Placeholder')->update( $path, ComponentbuilderHelper::$constantPaths - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); } diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 88ab4163b..a657d6ac7 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -18,7 +18,10 @@ use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\String\FieldHelper; -use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; /** * Compiler class @@ -26,6 +29,7 @@ use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; class Fields extends Structure { + /** * Metadate Switch * @@ -369,24 +373,6 @@ class Fields extends Structure */ public $movedPublishingFields = array(); - /** - * Set the line number in comments - * - * @param int $nr The line number - * - * @return void - * - */ - private function setLine($nr) - { - if (Config::get('debug_line_nr', false)) - { - return ' [Fields ' . $nr . ']'; - } - - return ''; - } - /** * set the Field set of a view * @@ -416,162 +402,162 @@ class Fields extends Structure $this->accessBuilder[$nameSingleCode] = $nameListCode; } // main lang prefix - $langView = Config::get('lang_prefix') . '_' - . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; - $langViews = Config::get('lang_prefix') . '_' - . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; + $langView = CFactory::_('Config')->lang_prefix . '_' + . CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]; + $langViews = CFactory::_('Config')->lang_prefix . '_' + . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]; // set default lang - $this->setLangContent( - $this->lang, $langView, $view['settings']->name_single + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView, $view['settings']->name_single ); - $this->setLangContent( - $this->lang, $langViews, $view['settings']->name_list + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews, $view['settings']->name_list ); // set global item strings - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_ARCHIVED', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_ARCHIVED', "%s " . $view['settings']->name_list . " archived." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_ARCHIVED_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_ARCHIVED_1', "%s " . $view['settings']->name_single . " archived." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_0', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_CHECKED_IN_0', "No " . $view['settings']->name_single . " successfully checked in." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_CHECKED_IN_1', "%d " . $view['settings']->name_single . " successfully checked in." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_MORE', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_CHECKED_IN_MORE', "%d " . $view['settings']->name_list . " successfully checked in." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_DELETED', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_DELETED', "%s " . $view['settings']->name_list . " deleted." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_DELETED_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_DELETED_1', "%s " . $view['settings']->name_single . " deleted." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_FEATURED', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FEATURED', "%s " . $view['settings']->name_list . " featured." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_FEATURED_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FEATURED_1', "%s " . $view['settings']->name_single . " featured." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_PUBLISHED', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_PUBLISHED', "%s " . $view['settings']->name_list . " published." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_PUBLISHED_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_PUBLISHED_1', "%s " . $view['settings']->name_single . " published." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_TRASHED', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_TRASHED', "%s " . $view['settings']->name_list . " trashed." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_TRASHED_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_TRASHED_1', "%s " . $view['settings']->name_single . " trashed." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_UNFEATURED', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNFEATURED', "%s " . $view['settings']->name_list . " unfeatured." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_UNFEATURED_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNFEATURED_1', "%s " . $view['settings']->name_single . " unfeatured." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_UNPUBLISHED', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNPUBLISHED', "%s " . $view['settings']->name_list . " unpublished." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_UNPUBLISHED_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNPUBLISHED_1', "%s " . $view['settings']->name_single . " unpublished." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_FAILED_PUBLISHING', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FAILED_PUBLISHING', "%s " . $view['settings']->name_list . " failed publishing." ); - $this->setLangContent( - $this->lang, $langViews . '_N_ITEMS_FAILED_PUBLISHING_1', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FAILED_PUBLISHING_1', "%s " . $view['settings']->name_single . " failed publishing." ); - $this->setLangContent( - $this->lang, $langViews . '_BATCH_OPTIONS', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_BATCH_OPTIONS', "Batch process the selected " . $view['settings']->name_list ); - $this->setLangContent( - $this->lang, $langViews . '_BATCH_TIP', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langViews . '_BATCH_TIP', "All changes will be applied to all selected " . $view['settings']->name_list ); // set some basic defaults - $this->setLangContent( - $this->lang, $langView . '_ERROR_UNIQUE_ALIAS', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_ERROR_UNIQUE_ALIAS', "Another " . $view['settings']->name_single . " has the same alias." ); - $this->setLangContent( - $this->lang, $langView . '_CREATED_DATE_LABEL', "Created Date" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_CREATED_DATE_LABEL', "Created Date" ); - $this->setLangContent( - $this->lang, $langView . '_CREATED_DATE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_CREATED_DATE_DESC', "The date this " . $view['settings']->name_single . " was created." ); - $this->setLangContent( - $this->lang, $langView . '_MODIFIED_DATE_LABEL', "Modified Date" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_MODIFIED_DATE_LABEL', "Modified Date" ); - $this->setLangContent( - $this->lang, $langView . '_MODIFIED_DATE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_MODIFIED_DATE_DESC', "The date this " . $view['settings']->name_single . " was modified." ); - $this->setLangContent( - $this->lang, $langView . '_CREATED_BY_LABEL', "Created By" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_CREATED_BY_LABEL', "Created By" ); - $this->setLangContent( - $this->lang, $langView . '_CREATED_BY_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_CREATED_BY_DESC', "The user that created this " . $view['settings']->name_single . "." ); - $this->setLangContent( - $this->lang, $langView . '_MODIFIED_BY_LABEL', "Modified By" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_MODIFIED_BY_LABEL', "Modified By" ); - $this->setLangContent( - $this->lang, $langView . '_MODIFIED_BY_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_MODIFIED_BY_DESC', "The last user that modified this " . $view['settings']->name_single . "." ); - $this->setLangContent( - $this->lang, $langView . '_ORDERING_LABEL', "Ordering" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_ORDERING_LABEL', "Ordering" ); - $this->setLangContent( - $this->lang, $langView . '_VERSION_LABEL', "Version" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_VERSION_LABEL', "Version" ); - $this->setLangContent( - $this->lang, $langView . '_VERSION_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_VERSION_DESC', "A count of the number of times this " . $view['settings']->name_single . " has been revised." ); - $this->setLangContent( - $this->lang, $langView . '_SAVE_WARNING', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langView . '_SAVE_WARNING', "Alias already existed so a number was added at the end. You can re-edit the " . $view['settings']->name_single . " to customise the alias." ); // check what type of field builder to use - if (Config::get('field_builder_type', 2) == 1) + if (CFactory::_('Config')->get('field_builder_type', 2) == 1) { // build field set using string manipulation return $this->stringFieldSet( @@ -612,7 +598,7 @@ class Fields extends Structure $readOnly = false; if ($view['settings']->type == 2) { - $readOnly = $this->_t(3) . 'readonly="true"' . PHP_EOL . $this->_t( + $readOnly = Indent::_(3) . 'readonly="true"' . PHP_EOL . Indent::_( 3 ) . 'disabled="true"'; } @@ -620,133 +606,141 @@ class Fields extends Structure $dynamicFields = ''; // set the custom table key $dbkey = 'g'; + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFields - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$nameSingleCode, &$nameListCode, &$this->placeholders, &$langView, &$langViews) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { $dynamicFields .= $this->setDynamicField( $field, $view, $view['settings']->type, $langView, - $nameSingleCode, $nameListCode, $this->placeholders, $dbkey, + $nameSingleCode, $nameListCode, CFactory::_('Placeholder')->active, $dbkey, true ); } + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFields - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$nameSingleCode, &$nameListCode, &$this->placeholders, &$langView, &$langViews) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // set the default fields $fieldSet = array(); $fieldSet[] = '
'; - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . ""; // if id is not set if (!isset($this->fieldsNames[$nameSingleCode]['id'])) { - $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"id"'; - $fieldSet[] = $this->_t(3) + $fieldSet[] = Indent::_(2) . "_t(3) + $fieldSet[] = Indent::_(3) . 'description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"'; - $fieldSet[] = $this->_t(3) . 'readonly="true"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . 'readonly="true"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } // if created is not set if (!isset($this->fieldsNames[$nameSingleCode]['created'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created"'; - $fieldSet[] = $this->_t(3) . "type=" . '"calendar"'; - $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView + $fieldSet[] = Indent::_(2) . "_t(3) . "description=" . '"' . $langView + $fieldSet[] = Indent::_(3) . "description=" . '"' . $langView . '_CREATED_DATE_DESC"'; - $fieldSet[] = $this->_t(3) . "size=" . '"22"'; + $fieldSet[] = Indent::_(3) . "size=" . '"22"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = $this->_t(3) . "format=" . '"%Y-%m-%d %H:%M:%S"'; - $fieldSet[] = $this->_t(3) . "filter=" . '"user_utc"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . "format=" . '"%Y-%m-%d %H:%M:%S"'; + $fieldSet[] = Indent::_(3) . "filter=" . '"user_utc"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } // if created_by is not set if (!isset($this->fieldsNames[$nameSingleCode]['created_by'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created_by"'; - $fieldSet[] = $this->_t(3) . "type=" . '"user"'; - $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView + $fieldSet[] = Indent::_(2) . "_t(3) . "description=" . '"' . $langView + $fieldSet[] = Indent::_(3) . "description=" . '"' . $langView . '_CREATED_BY_DESC"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } // if published is not set if (!isset($this->fieldsNames[$nameSingleCode]['published'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . "description=" + $fieldSet[] = Indent::_(3) . "description=" . '"JFIELD_PUBLISHED_DESC" class="chzn-color-state"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = $this->_t(3) . "filter=" + $fieldSet[] = Indent::_(3) . "filter=" . '"intval" size="1" default="1" >'; - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = Indent::_(3) . ""; + $fieldSet[] = Indent::_(3) . ""; + $fieldSet[] = Indent::_(3) . ""; + $fieldSet[] = Indent::_(3) . ""; + $fieldSet[] = Indent::_(2) . ""; // count the static field created $this->fieldCount++; } // if modified is not set if (!isset($this->fieldsNames[$nameSingleCode]['modified'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) + $fieldSet[] = Indent::_(2) . '_t(3) . 'label="' . $langView + $fieldSet[] = Indent::_(3) . 'label="' . $langView . '_MODIFIED_DATE_LABEL" description="' . $langView . '_MODIFIED_DATE_DESC"'; - $fieldSet[] = $this->_t(3) + $fieldSet[] = Indent::_(3) . 'size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />'; // count the static field created $this->fieldCount++; @@ -754,18 +748,18 @@ class Fields extends Structure // if modified_by is not set if (!isset($this->fieldsNames[$nameSingleCode]['modified_by'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) + $fieldSet[] = Indent::_(2) . '_t(3) . 'label="' . $langView + $fieldSet[] = Indent::_(3) . 'label="' . $langView . '_MODIFIED_BY_LABEL"'; - $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView + $fieldSet[] = Indent::_(3) . "description=" . '"' . $langView . '_MODIFIED_BY_DESC"'; - $fieldSet[] = $this->_t(3) . 'class="readonly"'; - $fieldSet[] = $this->_t(3) . 'readonly="true"'; - $fieldSet[] = $this->_t(3) . 'filter="unset"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . 'class="readonly"'; + $fieldSet[] = Indent::_(3) . 'readonly="true"'; + $fieldSet[] = Indent::_(3) . 'filter="unset"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } @@ -776,62 +770,62 @@ class Fields extends Structure ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . '_t(3) . 'type="accesslevel"'; - $fieldSet[] = $this->_t(3) . 'label="JFIELD_ACCESS_LABEL"'; - $fieldSet[] = $this->_t(3) . 'description="JFIELD_ACCESS_DESC"'; - $fieldSet[] = $this->_t(3) . 'default="1"'; + $fieldSet[] = Indent::_(2) . '_t(3) . 'required="false"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . 'required="false"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } // if ordering is not set if (!isset($this->fieldsNames[$nameSingleCode]['ordering'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . 'name="ordering"'; - $fieldSet[] = $this->_t(3) . 'type="number"'; - $fieldSet[] = $this->_t(3) . 'class="inputbox validate-ordering"'; - $fieldSet[] = $this->_t(3) . 'label="' . $langView + $fieldSet[] = Indent::_(2) . "_t(3) . 'description=""'; - $fieldSet[] = $this->_t(3) . 'default="0"'; - $fieldSet[] = $this->_t(3) . 'size="6"'; + $fieldSet[] = Indent::_(3) . 'description=""'; + $fieldSet[] = Indent::_(3) . 'default="0"'; + $fieldSet[] = Indent::_(3) . 'size="6"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = $this->_t(3) . 'required="false"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . 'required="false"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } // if version is not set if (!isset($this->fieldsNames[$nameSingleCode]['version'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . 'name="version"'; - $fieldSet[] = $this->_t(3) . 'type="text"'; - $fieldSet[] = $this->_t(3) . 'class="readonly"'; - $fieldSet[] = $this->_t(3) . 'label="' . $langView + $fieldSet[] = Indent::_(2) . "_t(3) . 'description="' . $langView + $fieldSet[] = Indent::_(3) . 'description="' . $langView . '_VERSION_DESC"'; - $fieldSet[] = $this->_t(3) . 'size="6"'; - $fieldSet[] = $this->_t(3) . 'readonly="true"'; - $fieldSet[] = $this->_t(3) . 'filter="unset"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . 'size="6"'; + $fieldSet[] = Indent::_(3) . 'readonly="true"'; + $fieldSet[] = Indent::_(3) . 'filter="unset"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } @@ -844,36 +838,36 @@ class Fields extends Structure // metakey if (!isset($this->fieldsNames[$nameSingleCode]['metakey'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . 'name="metakey"'; - $fieldSet[] = $this->_t(3) . 'type="textarea"'; - $fieldSet[] = $this->_t(3) + $fieldSet[] = Indent::_(2) . "_t(3) + $fieldSet[] = Indent::_(3) . 'description="JFIELD_META_KEYWORDS_DESC"'; - $fieldSet[] = $this->_t(3) . 'rows="3"'; - $fieldSet[] = $this->_t(3) . 'cols="30"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . 'rows="3"'; + $fieldSet[] = Indent::_(3) . 'cols="30"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } // metadesc if (!isset($this->fieldsNames[$nameSingleCode]['metadesc'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . 'name="metadesc"'; - $fieldSet[] = $this->_t(3) . 'type="textarea"'; - $fieldSet[] = $this->_t(3) + $fieldSet[] = Indent::_(2) . "_t(3) + $fieldSet[] = Indent::_(3) . 'description="JFIELD_META_DESCRIPTION_DESC"'; - $fieldSet[] = $this->_t(3) . 'rows="3"'; - $fieldSet[] = $this->_t(3) . 'cols="30"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(3) . 'rows="3"'; + $fieldSet[] = Indent::_(3) . 'cols="30"'; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; } @@ -886,21 +880,21 @@ class Fields extends Structure // set the field/tab name $field_name = "title"; $tab_name = "publishing"; - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . ""; // at this point we know that we must add a hidden title field // and make sure it does not get stored to the database - $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"' . $field_name . '"'; - $fieldSet[] = $this->_t(3) + $fieldSet[] = Indent::_(2) . "_t(3) . 'default="' . $component . ' ' + $fieldSet[] = Indent::_(3) . 'default="' . $component . ' ' . $nameSingleCode . '"'; - $fieldSet[] = $this->_t(2) . "/>"; + $fieldSet[] = Indent::_(2) . "/>"; // count the static field created $this->fieldCount++; // setup needed field values for layout @@ -916,11 +910,11 @@ class Fields extends Structure // load the dynamic fields now if (StringHelper::check($dynamicFields)) { - $fieldSet[] = $this->_t(2) . "" . $dynamicFields; } // close fieldset - $fieldSet[] = $this->_t(1) . "
"; + $fieldSet[] = Indent::_(1) . "
"; // check if metadata is added to this view if (isset($this->metadataBuilder[$nameSingleCode]) && StringHelper::check( @@ -931,72 +925,72 @@ class Fields extends Structure || !isset($this->fieldsNames[$nameSingleCode]['rights']) || !isset($this->fieldsNames[$nameSingleCode]['author'])) { - $fieldSet[] = PHP_EOL . $this->_t(1) . ""; - $fieldSet[] = $this->_t(1) . "'; - $fieldSet[] = $this->_t(2) . '
_t(3) + $fieldSet[] = Indent::_(2) . '
'; // robots if (!isset($this->fieldsNames[$nameSingleCode]['robots'])) { - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(3) . '_t(4) . 'type="list"'; - $fieldSet[] = $this->_t(4) + $fieldSet[] = Indent::_(3) . '_t(4) + $fieldSet[] = Indent::_(4) . 'description="JFIELD_METADATA_ROBOTS_DESC" >'; - $fieldSet[] = $this->_t(4) + $fieldSet[] = Indent::_(4) . ''; - $fieldSet[] = $this->_t(4) + $fieldSet[] = Indent::_(4) . ''; - $fieldSet[] = $this->_t(4) + $fieldSet[] = Indent::_(4) . ''; - $fieldSet[] = $this->_t(4) + $fieldSet[] = Indent::_(4) . ''; - $fieldSet[] = $this->_t(4) + $fieldSet[] = Indent::_(4) . ''; - $fieldSet[] = $this->_t(3) . ''; + $fieldSet[] = Indent::_(3) . ''; // count the static field created $this->fieldCount++; } // author if (!isset($this->fieldsNames[$nameSingleCode]['author'])) { - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(3) . '_t(4) . 'type="text"'; - $fieldSet[] = $this->_t(4) + $fieldSet[] = Indent::_(3) . '_t(4) . 'size="20"'; - $fieldSet[] = $this->_t(3) . "/>"; + $fieldSet[] = Indent::_(4) . 'size="20"'; + $fieldSet[] = Indent::_(3) . "/>"; // count the static field created $this->fieldCount++; } // rights if (!isset($this->fieldsNames[$nameSingleCode]['rights'])) { - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(3) + $fieldSet[] = Indent::_(3) . '_t(4) + $fieldSet[] = Indent::_(4) . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"'; - $fieldSet[] = $this->_t(4) . 'cols="30" rows="2"'; - $fieldSet[] = $this->_t(3) . "/>"; + $fieldSet[] = Indent::_(4) . 'cols="30" rows="2"'; + $fieldSet[] = Indent::_(3) . "/>"; // count the static field created $this->fieldCount++; } - $fieldSet[] = $this->_t(2) . "
"; - $fieldSet[] = $this->_t(1) . ""; + $fieldSet[] = Indent::_(2) . "
"; + $fieldSet[] = Indent::_(1) . "
"; } } @@ -1031,41 +1025,49 @@ class Fields extends Structure $dynamicFieldsXML = array(); // set the custom table key $dbkey = 'g'; + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFields - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$nameSingleCode, &$nameListCode, &$this->placeholders, &$langView, &$langViews) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { $dynamicFieldsXML[] = $this->setDynamicField( $field, $view, $view['settings']->type, $langView, - $nameSingleCode, $nameListCode, $this->placeholders, $dbkey, + $nameSingleCode, $nameListCode, CFactory::_('Placeholder')->active, $dbkey, true ); } + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFields - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$nameSingleCode, &$nameListCode, &$this->placeholders, &$langView, &$langViews) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // set the default fields $XML = new simpleXMLElement(''); $fieldSetXML = $XML->addChild('fieldset'); $fieldSetXML->addAttribute('name', 'details'); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) . " Default Fields." + $fieldSetXML, Line::_(__Line__, __Class__) . " Default Fields." ); ComponentbuilderHelper::xmlComment( $fieldSetXML, - $this->setLine(__LINE__) . " Id Field. Type: Text (joomla)" + Line::_(__Line__, __Class__) . " Id Field. Type: Text (joomla)" ); // if id is not set if (!isset($this->fieldsNames[$nameSingleCode]['id'])) @@ -1099,7 +1101,7 @@ class Fields extends Structure ); $attributes = array_merge($attributes, $readOnlyXML); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " Date Created Field. Type: Calendar (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1118,7 +1120,7 @@ class Fields extends Structure ); $attributes = array_merge($attributes, $readOnlyXML); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " User Created Field. Type: User (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1136,7 +1138,7 @@ class Fields extends Structure ); $attributes = array_merge($attributes, $readOnlyXML); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " Published Field. Type: List (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1168,7 +1170,7 @@ class Fields extends Structure 'filter' => 'user_utc' ); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " Date Modified Field. Type: Calendar (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1189,7 +1191,7 @@ class Fields extends Structure 'filter' => 'unset' ); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " User Modified Field. Type: User (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1214,7 +1216,7 @@ class Fields extends Structure ); $attributes = array_merge($attributes, $readOnlyXML); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " Access Field. Type: Accesslevel (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1237,7 +1239,7 @@ class Fields extends Structure ); $attributes = array_merge($attributes, $readOnlyXML); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " Ordering Field. Type: Numbers (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1260,7 +1262,7 @@ class Fields extends Structure ); ComponentbuilderHelper::xmlComment( $fieldSetXML, - $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)" + Line::_(__Line__, __Class__) . " Version Field. Type: Text (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); @@ -1285,7 +1287,7 @@ class Fields extends Structure 'cols' => 30 ); ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " Metakey Field. Type: Textarea (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1302,7 +1304,7 @@ class Fields extends Structure $attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL'; $attributes['description'] = 'JFIELD_META_DESCRIPTION_DESC'; ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) + $fieldSetXML, Line::_(__Line__, __Class__) . " Metadesc Field. Type: Textarea (joomla)" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1329,17 +1331,17 @@ class Fields extends Structure ); ComponentbuilderHelper::xmlComment( $fieldSetXML, - $this->setLine(__LINE__) + Line::_(__Line__, __Class__) . " Was added due to Permissions JS needing a Title field" ); ComponentbuilderHelper::xmlComment( $fieldSetXML, - $this->setLine(__LINE__) + Line::_(__Line__, __Class__) . " Let us know at gh-629 should this change" ); ComponentbuilderHelper::xmlComment( $fieldSetXML, - $this->setLine(__LINE__) + Line::_(__Line__, __Class__) . " https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235" ); $fieldXML = $fieldSetXML->addChild('field'); @@ -1360,7 +1362,7 @@ class Fields extends Structure if (count((array) $dynamicFieldsXML)) { ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) . " Dynamic Fields." + $fieldSetXML, Line::_(__Line__, __Class__) . " Dynamic Fields." ); foreach ($dynamicFieldsXML as $dynamicfield) { @@ -1378,7 +1380,7 @@ class Fields extends Structure || !isset($this->fieldsNames[$nameSingleCode]['rights'])) { ComponentbuilderHelper::xmlComment( - $fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields" + $fieldSetXML, Line::_(__Line__, __Class__) . " Metadata Fields" ); $fieldsXML = $fieldSetXML->addChild('fields'); $fieldsXML->addAttribute('name', 'metadata'); @@ -1394,7 +1396,7 @@ class Fields extends Structure if (!isset($this->fieldsNames[$nameSingleCode]['robots'])) { ComponentbuilderHelper::xmlComment( - $fieldsFieldSetXML, $this->setLine(__LINE__) + $fieldsFieldSetXML, Line::_(__Line__, __Class__) . " Robots Field. Type: List (joomla)" ); $robots = $fieldsFieldSetXML->addChild('field'); @@ -1427,7 +1429,7 @@ class Fields extends Structure if (!isset($this->fieldsNames[$nameSingleCode]['author'])) { ComponentbuilderHelper::xmlComment( - $fieldsFieldSetXML, $this->setLine(__LINE__) + $fieldsFieldSetXML, Line::_(__Line__, __Class__) . " Author Field. Type: Text (joomla)" ); $author = $fieldsFieldSetXML->addChild('field'); @@ -1448,7 +1450,7 @@ class Fields extends Structure if (!isset($this->fieldsNames[$nameSingleCode]['rights'])) { ComponentbuilderHelper::xmlComment( - $fieldsFieldSetXML, $this->setLine(__LINE__) + $fieldsFieldSetXML, Line::_(__Line__, __Class__) . " Rights Field. Type: Textarea (joomla)" ); $rights = $fieldsFieldSetXML->addChild('field'); @@ -1587,7 +1589,7 @@ class Fields extends Structure &$nameSingleCode, &$nameListCode, &$placeholders, &$dbkey, $build ) { // set default return - if (Config::get('field_builder_type', 2) == 1) + if (CFactory::_('Config')->get('field_builder_type', 2) == 1) { // string manipulation $dynamicField = ''; @@ -1832,7 +1834,7 @@ class Fields extends Structure ) { // check the field builder type $xmlField = ''; - if (Config::get('field_builder_type', 2) == 1) + if (CFactory::_('Config')->get('field_builder_type', 2) == 1) { // string manipulation $xmlField = $this->setDynamicField( @@ -1854,10 +1856,10 @@ class Fields extends Structure $xmlField = dom_import_simplexml( $newxmlField->fieldXML ); - $xmlField = PHP_EOL . $this->_t(2) . "' . PHP_EOL - . $this->_t(1) . $this->xmlPrettyPrint( + . Indent::_(1) . $this->xmlPrettyPrint( $xmlField, 'field' ); } @@ -1892,7 +1894,7 @@ class Fields extends Structure // count the dynamic fields created $this->fieldCount++; // check what type of field builder to use - if (Config::get('field_builder_type', 2) == 1) + if (CFactory::_('Config')->get('field_builder_type', 2) == 1) { // build field set using string manipulation return $this->stringSetField( @@ -1938,19 +1940,19 @@ class Fields extends Structure if ($setType === 'option') { // now add to the field set - $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) - . ""; - $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) + $field .= PHP_EOL . Indent::_(1) . $taber . Indent::_(1) . " $value) { if ($property != 'option') { - $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) + $field .= PHP_EOL . Indent::_(2) . $taber . Indent::_(1) . $property . '="' . $value . '"'; } elseif ($property === 'option') @@ -1982,13 +1984,13 @@ class Fields extends Structure $valueKeyArray[0], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[0] ); // now add group label $groups_[$valueKeyArray[1]] = PHP_EOL - . $this->_t(1) . $taber . $this->_t(2) + . Indent::_(1) . $taber . Indent::_(2) . ''; // set order $order_['group' . $valueKeyArray[1]] @@ -2006,16 +2008,16 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set $grouped_['group'][$valueKeyArray[2]][] - = PHP_EOL . $this->_t(1) . $taber - . $this->_t(3) . ''; $optionArray[$valueKeyArray[0]] = $langValue; @@ -2030,16 +2032,16 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set $grouped_['option'][$valueKeyArray[0]] - = PHP_EOL . $this->_t(1) . $taber - . $this->_t(2) . ''; $optionArray[$valueKeyArray[0]] = $langValue; @@ -2056,15 +2058,15 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set $grouped_['option'][$option] = PHP_EOL - . $this->_t(1) . $taber . $this->_t(2) + . Indent::_(1) . $taber . Indent::_(2) . ''; + . PHP_EOL . Indent::_(1) . $taber + . Indent::_(3) . $langValue . ''; $optionArray[$option] = $langValue; // set order $order_['option' . $option] = $option; @@ -2096,8 +2098,8 @@ class Fields extends Structure unset($groups_[$_id]); unset($grouped_[$key_][$_id]); // close the group - $optionSet .= PHP_EOL . $this->_t(1) . $taber - . $this->_t(2) . ''; + $optionSet .= PHP_EOL . Indent::_(1) . $taber + . Indent::_(2) . ''; } elseif (isset($grouped_[$key_][$_id]) && StringHelper::check( @@ -2123,14 +2125,14 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $t + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $t ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(1) - . $taber . $this->_t(2) . ''; $optionArray[$v] = $langValue; } @@ -2142,14 +2144,14 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) - . $taber . $this->_t(1) . ''; $optionArray[$option] = $langValue; } @@ -2167,11 +2169,11 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent($this->lang, $langValue, $t); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) . $taber - . $this->_t(1) . ''; $optionArray[$v] = $langValue; } @@ -2183,14 +2185,14 @@ class Fields extends Structure $value, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $value + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $value ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) - . $taber . $this->_t(1) . ''; $optionArray[$value] = $langValue; } @@ -2201,54 +2203,54 @@ class Fields extends Structure if (StringHelper::check($optionSet)) { $field .= '>'; - $field .= PHP_EOL . $this->_t(3) . $taber . ""; + $field .= PHP_EOL . Indent::_(3) . $taber . ""; $field .= $optionSet; - $field .= PHP_EOL . $this->_t(2) . $taber . ""; + $field .= PHP_EOL . Indent::_(2) . $taber . ""; } // if no options found and must have a list of options elseif (ComponentbuilderHelper::fieldCheck($typeName, 'list')) { $optionArray = false; - $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; - $field .= PHP_EOL . $this->_t(2) . $taber . "" . PHP_EOL; } else { $optionArray = false; - $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; + $field .= PHP_EOL . Indent::_(2) . $taber . "/>"; } } elseif ($setType === 'plain') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . $taber . ""; - $field .= PHP_EOL . $this->_t(2) . $taber . " $value) { if ($property != 'option') { - $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) + $field .= PHP_EOL . Indent::_(2) . $taber . Indent::_(1) . $property . '="' . $value . '"'; } } - $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; + $field .= PHP_EOL . Indent::_(2) . $taber . "/>"; } elseif ($setType === 'spacer') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . ""; - $field .= PHP_EOL . $this->_t(2) . " $value) { if ($property != 'option') @@ -2264,25 +2266,25 @@ class Fields extends Structure if ($typeName === 'repeatable') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . ""; - $field .= PHP_EOL . $this->_t(2) . " $value) { if ($property != 'fields') { - $field .= PHP_EOL . $this->_t(3) . $property . '="' + $field .= PHP_EOL . Indent::_(3) . $property . '="' . $value . '"'; } } $field .= ">"; - $field .= PHP_EOL . $this->_t(3) . ''; - $field .= PHP_EOL . $this->_t(4) + $field .= PHP_EOL . Indent::_(4) . '"; - $field .= PHP_EOL . $this->_t(3) . ""; - $field .= PHP_EOL . $this->_t(2) . ""; + $field .= PHP_EOL . Indent::_(4) . "
"; + $field .= PHP_EOL . Indent::_(3) . "
"; + $field .= PHP_EOL . Indent::_(2) . ""; } // set the subform fields (it is a repeatable without the modal) elseif ($typeName === 'subform') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . $taber . ""; - $field .= PHP_EOL . $this->_t(2) . $taber . " $value) { if ($property != 'fields') { - $field .= PHP_EOL . $this->_t(3) . $taber . $property + $field .= PHP_EOL . Indent::_(3) . $taber . $property . '="' . $value . '"'; } } $field .= ">"; - $field .= PHP_EOL . $this->_t(3) . $taber + $field .= PHP_EOL . Indent::_(3) . $taber . '"; - $field .= PHP_EOL . $this->_t(2) . $taber . ""; + $field .= PHP_EOL . Indent::_(3) . $taber . ""; + $field .= PHP_EOL . Indent::_(2) . $taber . ""; } } elseif ($setType === 'custom') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . $taber . ""; - $field .= PHP_EOL . $this->_t(2) . $taber . " $value) { if ($property != 'option') { - $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) + $field .= PHP_EOL . Indent::_(2) . $taber . Indent::_(1) . $property . '="' . $value . '"'; } elseif ($property === 'option') @@ -2666,13 +2668,13 @@ class Fields extends Structure $valueKeyArray[0], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[0] ); // now add group label $groups_[$valueKeyArray[1]] = PHP_EOL - . $this->_t(1) . $taber . $this->_t(2) + . Indent::_(1) . $taber . Indent::_(2) . ''; // set order $order_['group' . $valueKeyArray[1]] @@ -2690,16 +2692,16 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set $grouped_['group'][$valueKeyArray[2]][] - = PHP_EOL . $this->_t(1) . $taber - . $this->_t(3) . ''; $optionArray[$valueKeyArray[0]] = $langValue; @@ -2714,16 +2716,16 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set $grouped_['option'][$valueKeyArray[0]] - = PHP_EOL . $this->_t(1) . $taber - . $this->_t(2) . ''; $optionArray[$valueKeyArray[0]] = $langValue; @@ -2740,15 +2742,15 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set $grouped_['option'][$option] = PHP_EOL - . $this->_t(1) . $taber . $this->_t(2) + . Indent::_(1) . $taber . Indent::_(2) . ''; + . PHP_EOL . Indent::_(1) . $taber + . Indent::_(3) . $langValue . ''; $optionArray[$option] = $langValue; // set order $order_['option' . $option] = $option; @@ -2780,8 +2782,8 @@ class Fields extends Structure unset($groups_[$_id]); unset($grouped_[$key_][$_id]); // close the group - $optionSet .= PHP_EOL . $this->_t(1) . $taber - . $this->_t(2) . ''; + $optionSet .= PHP_EOL . Indent::_(1) . $taber + . Indent::_(2) . ''; } elseif (isset($grouped_[$key_][$_id]) && StringHelper::check( @@ -2807,14 +2809,14 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $t + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $t ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(1) - . $taber . $this->_t(2) . ''; $optionArray[$v] = $langValue; } @@ -2826,14 +2828,14 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) - . $taber . $this->_t(1) . ''; $optionArray[$option] = $langValue; } @@ -2851,11 +2853,11 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent($this->lang, $langValue, $t); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) . $taber - . $this->_t(1) . ''; $optionArray[$v] = $langValue; } @@ -2867,14 +2869,14 @@ class Fields extends Structure $value, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $value + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $value ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) - . $taber . $this->_t(1) . ''; $optionArray[$value] = $langValue; } @@ -2885,25 +2887,25 @@ class Fields extends Structure if (StringHelper::check($optionSet)) { $field .= '>'; - $field .= PHP_EOL . $this->_t(3) . $taber . ""; + $field .= PHP_EOL . Indent::_(3) . $taber . ""; $field .= $optionSet; - $field .= PHP_EOL . $this->_t(2) . $taber . ""; + $field .= PHP_EOL . Indent::_(2) . $taber . ""; } // if no options found and must have a list of options elseif (ComponentbuilderHelper::fieldCheck($typeName, 'list')) { $optionArray = false; - $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; - $field .= PHP_EOL . $this->_t(2) . $taber . "" . PHP_EOL; } else { $optionArray = false; - $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; + $field .= PHP_EOL . Indent::_(2) . $taber . "/>"; } // incase the field is in the config and has not been set if ('config' === $nameSingleCode && 'configs' === $nameListCode @@ -2955,7 +2957,7 @@ class Fields extends Structure { // now add to the field set $field->fieldXML = new SimpleXMLElement(''); - $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name) + $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name) . " Field. Type: " . StringHelper::safe( $typeName, 'F' ) . ". (joomla)"; @@ -2970,7 +2972,7 @@ class Fields extends Structure { ComponentbuilderHelper::xmlComment( $field->fieldXML, - $this->setLine(__LINE__) . " Option Set." + Line::_(__Line__, __Class__) . " Option Set." ); if (strtolower($typeName) === 'groupedlist' && strpos( @@ -2998,8 +3000,8 @@ class Fields extends Structure $valueKeyArray[0], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[0] ); // now add group label @@ -3020,8 +3022,8 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set @@ -3041,8 +3043,8 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set @@ -3064,8 +3066,8 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set $grouped_['option'][$option] @@ -3143,8 +3145,8 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $t + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $t ); // now add to option set $optionXML->addAttribute('value', $v); @@ -3158,8 +3160,8 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set $optionXML->addAttribute('value', $option); @@ -3181,7 +3183,7 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent($this->lang, $langValue, $t); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t); // now add to option set $optionXML->addAttribute('value', $v); $optionArray[$v] = $langValue; @@ -3194,8 +3196,8 @@ class Fields extends Structure $value, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $value + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $value ); // now add to option set $optionXML->addAttribute('value', $value); @@ -3210,7 +3212,7 @@ class Fields extends Structure && ComponentbuilderHelper::fieldCheck($typeName, 'list')) { ComponentbuilderHelper::xmlComment( - $field->fieldXML, $this->setLine(__LINE__) + $field->fieldXML, Line::_(__Line__, __Class__) . " No Manual Options Were Added In Field Settings." ); } @@ -3219,7 +3221,7 @@ class Fields extends Structure { // now add to the field set $field->fieldXML = new SimpleXMLElement(''); - $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name) + $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name) . " Field. Type: " . StringHelper::safe( $typeName, 'F' ) . ". (joomla)"; @@ -3236,7 +3238,7 @@ class Fields extends Structure { // now add to the field set $field->fieldXML = new SimpleXMLElement(''); - $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name) + $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name) . " Field. Type: " . StringHelper::safe( $typeName, 'F' ) . ". A None Database Field. (joomla)"; @@ -3256,7 +3258,7 @@ class Fields extends Structure { // now add to the field set $field->fieldXML = new SimpleXMLElement(''); - $field->comment = $this->setLine(__LINE__) . " " . ucfirst( + $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst( $name ) . " Field. Type: " . StringHelper::safe( $typeName, 'F' @@ -3381,8 +3383,8 @@ class Fields extends Structure $r_name, true ); // add to lang array - $this->setLangContent( - $this->lang, $r_listLangName, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $r_listLangName, StringHelper::safe( $r_name, 'W' ) @@ -3427,7 +3429,7 @@ class Fields extends Structure { // now add to the field set $field->fieldXML = new SimpleXMLElement(''); - $field->comment = $this->setLine(__LINE__) . " " . ucfirst( + $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst( $name ) . " Field. Type: " . StringHelper::safe( $typeName, 'F' @@ -3594,8 +3596,8 @@ class Fields extends Structure $r_name, true ); // add to lang array - $this->setLangContent( - $this->lang, $r_listLangName, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $r_listLangName, StringHelper::safe( $r_name, 'W' ) @@ -3641,7 +3643,7 @@ class Fields extends Structure { // now add to the field set $field->fieldXML = new SimpleXMLElement(''); - $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name) + $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name) . " Field. Type: " . StringHelper::safe( $typeName, 'F' ) . ". (custom)"; @@ -3655,7 +3657,7 @@ class Fields extends Structure { ComponentbuilderHelper::xmlComment( $field->fieldXML, - $this->setLine(__LINE__) . " Option Set." + Line::_(__Line__, __Class__) . " Option Set." ); if (strtolower($typeName) === 'groupedlist' && strpos( @@ -3683,8 +3685,8 @@ class Fields extends Structure $valueKeyArray[0], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[0] ); // now add group label @@ -3705,8 +3707,8 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set @@ -3726,8 +3728,8 @@ class Fields extends Structure $valueKeyArray[1], true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $valueKeyArray[1] ); // now add to option set @@ -3749,8 +3751,8 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set $grouped_['option'][$option] @@ -3828,8 +3830,8 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $t + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $t ); // now add to option set $optionXML->addAttribute('value', $v); @@ -3843,8 +3845,8 @@ class Fields extends Structure $option, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $option + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $option ); // now add to option set $optionXML->addAttribute('value', $option); @@ -3866,7 +3868,7 @@ class Fields extends Structure $t, true ); // add to lang array - $this->setLangContent($this->lang, $langValue, $t); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t); // now add to option set $optionXML->addAttribute('value', $v); $optionArray[$v] = $langValue; @@ -3879,8 +3881,8 @@ class Fields extends Structure $value, true ); // add to lang array - $this->setLangContent( - $this->lang, $langValue, $value + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langValue, $value ); // now add to option set $optionXML->addAttribute('value', $value); @@ -4164,7 +4166,7 @@ class Fields extends Structure elseif ($property['name'] === 'name') { // get the actual field name - $xmlValue = $this->setPlaceholders($name, $placeholders); + $xmlValue = CFactory::_('Placeholder')->update($name, $placeholders); } elseif ($property['name'] === 'validate') { @@ -4184,7 +4186,7 @@ class Fields extends Structure || $property['name'] === 'formsource') { // get value & replace the placeholders - $xmlValue = $this->setPlaceholders( + $xmlValue = CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, $property['name'] . '="', '"' @@ -4208,7 +4210,7 @@ class Fields extends Structure ); // load the php for the custom field file $fieldAttributes['custom'][$phpKey][$phpLine] - = $this->setDynamicValues( + = CFactory::_('Customcode')->add( ComponentbuilderHelper::openValidBase64( GetHelper::between( $field['settings']->xml, @@ -4240,7 +4242,7 @@ class Fields extends Structure // load the view name & replace the placeholders $fieldAttributes['custom']['view'] = StringHelper::safe( - $this->setPlaceholders( + CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'view="', '"' ), $placeholders @@ -4252,7 +4254,7 @@ class Fields extends Structure // load the views name & replace the placeholders $fieldAttributes['custom']['views'] = StringHelper::safe( - $this->setPlaceholders( + CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'views="', '"' ), $placeholders @@ -4263,7 +4265,7 @@ class Fields extends Structure { // load the component name & replace the placeholders $fieldAttributes['custom']['component'] - = $this->setPlaceholders( + = CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'component="', '"' ), $placeholders @@ -4273,7 +4275,7 @@ class Fields extends Structure { // load the main table that is queried & replace the placeholders $fieldAttributes['custom']['table'] - = $this->setPlaceholders( + = CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'table="', '"' ), $placeholders @@ -4373,7 +4375,7 @@ class Fields extends Structure else { // set the rest of the fields - $xmlValue = (string) $this->setPlaceholders( + $xmlValue = (string) CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, $property['name'] . '="', '"' @@ -4399,7 +4401,7 @@ class Fields extends Structure } } // replace placeholders - $xmlValue = $this->setPlaceholders( + $xmlValue = CFactory::_('Placeholder')->update( $xmlValue, $placeholders ); // insure custom lables dont get messed up @@ -4413,7 +4415,7 @@ class Fields extends Structure $name . ' ' . $property['name'], true ); // add to lang array - $this->setLangContent($this->lang, $langValue, $xmlValue); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $xmlValue); // use lang value $xmlValue = $langValue; } @@ -4502,7 +4504,7 @@ class Fields extends Structure )) !== $confirmation) { $fieldAttributes['custom'][$phpKey][$phpLine] - = $this->setDynamicValues( + = CFactory::_('Customcode')->add( ComponentbuilderHelper::openValidBase64($value) ); } @@ -4735,8 +4737,8 @@ class Fields extends Structure // set field name $listFieldName = StringHelper::safe($tempName, 'W'); // add to lang array - $this->setLangContent( - $this->lang, $listLangName, $listFieldName + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $listLangName, $listFieldName ); } else @@ -4746,19 +4748,19 @@ class Fields extends Structure { $listLangName = $langLabel; // get field label from the lang label - if (isset($this->langContent[$this->lang][$langLabel])) + if (CFactory::_('Language')->exist(CFactory::_('Config')->lang_target, $langLabel)) { $listFieldName - = $this->langContent[$this->lang][$langLabel]; + = CFactory::_('Language')->get(CFactory::_('Config')->lang_target, $langLabel); } else { // get it from the field xml string - $listFieldName = (string) $this->setPlaceholders( + $listFieldName = (string) CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'label="', '"' - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); } // make sure there is no html in the list field name @@ -4772,8 +4774,8 @@ class Fields extends Structure // set field name $listFieldName = StringHelper::safe($name, 'W'); // add to lang array - $this->setLangContent( - $this->lang, $listLangName, $listFieldName + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $listLangName, $listFieldName ); } } @@ -4955,15 +4957,15 @@ class Fields extends Structure $otherView = $nameSingleCode; } // get the xml extension name - $_extension = $this->setPlaceholders( + $_extension = CFactory::_('Placeholder')->update( GetHelper::between( $field['settings']->xml, 'extension="', '"' - ), $this->placeholders + ), CFactory::_('Placeholder')->active ); // if they left out the extension for some reason if (!StringHelper::check($_extension)) { - $_extension = 'com_' . Config::get('component_code_name') . '.' + $_extension = 'com_' . CFactory::_('Config')->component_code_name . '.' . $otherView; } // check the context (does our target match) @@ -5169,7 +5171,7 @@ class Fields extends Structure = $options; } // main lang filter prefix - $lang_filter_ = Config::get('lang_prefix') . '_FILTER_'; + $lang_filter_ = CFactory::_('Config')->lang_prefix . '_FILTER_'; // build the sort values if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1) && ($listSwitch || $listJoin) @@ -5191,8 +5193,8 @@ class Fields extends Structure $filter_name_asc, 'U' ); // and to translation - $this->setLangContent( - $this->lang, $filter_name_asc_lang, $filter_name_asc + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $filter_name_asc_lang, $filter_name_asc ); // set the language strings for descending $filter_name_desc = $listFieldName . ' descending'; @@ -5201,8 +5203,8 @@ class Fields extends Structure $filter_name_desc, 'U' ); // and to translation - $this->setLangContent( - $this->lang, $filter_name_desc_lang, $filter_name_desc + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $filter_name_desc_lang, $filter_name_desc ); } $this->sortBuilder[$nameListCode][] = array('type' => $typeName, @@ -5251,8 +5253,8 @@ class Fields extends Structure $filter_name_select, 'U' ); // and to translation - $this->setLangContent( - $this->lang, $filter_name_select_lang, $filter_name_select + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $filter_name_select_lang, $filter_name_select ); } @@ -5330,52 +5332,42 @@ class Fields extends Structure } // set tab and break replacements $tabBreak = array( - '\t' => $this->_t(1), + '\t' => Indent::_(1), '\n' => PHP_EOL ); // set the [[[PLACEHOLDER]]] options $replace = array( - $this->bbb . 'JPREFIX' . $this->ddd => $jprefix, - $this->bbb . 'TABLE' - . $this->ddd => (isset($data['custom']['table'])) + Placefix::_('JPREFIX') => $jprefix, + Placefix::_('TABLE') => (isset($data['custom']['table'])) ? $data['custom']['table'] : '', - $this->bbb . 'ID' - . $this->ddd => (isset($data['custom']['id'])) + Placefix::_('ID') => (isset($data['custom']['id'])) ? $data['custom']['id'] : '', - $this->bbb . 'TEXT' - . $this->ddd => (isset($data['custom']['text'])) + Placefix::_('TEXT') => (isset($data['custom']['text'])) ? $data['custom']['text'] : '', - $this->bbb . 'CODE_TEXT' - . $this->ddd => (isset($data['code'], $data['custom']['text'])) + Placefix::_('CODE_TEXT') => (isset($data['code'], $data['custom']['text'])) ? $data['code'] . '_' . $data['custom']['text'] : '', - $this->bbb . 'CODE' . $this->ddd => (isset($data['code'])) + Placefix::_('CODE') => (isset($data['code'])) ? $data['code'] : '', - $this->bbb . 'view_type' . $this->ddd => $nameSingleCode + Placefix::_('view_type') => $nameSingleCode . '_' . $data['type'], - $this->bbb . 'type' . $this->ddd => (isset($data['type'])) + Placefix::_('type') => (isset($data['type'])) ? $data['type'] : '', - $this->bbb . 'com_component' - . $this->ddd => (isset($data['custom']['component']) + Placefix::_('com_component') => (isset($data['custom']['component']) && StringHelper::check( $data['custom']['component'] )) ? StringHelper::safe( $data['custom']['component'] - ) : 'com_' . Config::get('component_code_name'), + ) : 'com_' . CFactory::_('Config')->component_code_name, // set the generic values - $this->bbb . 'component' - . $this->ddd => Config::get('component_code_name'), - $this->bbb . 'Component' - . $this->ddd => $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh], - $this->bbb . 'view' - . $this->ddd => (isset($data['custom']['view']) + Placefix::_('component') => CFactory::_('Config')->component_code_name, + Placefix::_('Component') => $this->fileContentStatic[Placefix::_h('Component')], + Placefix::_('view') => (isset($data['custom']['view']) && StringHelper::check( $data['custom']['view'] )) ? StringHelper::safe( $data['custom']['view'] ) : $nameSingleCode, - $this->bbb . 'views' - . $this->ddd => (isset($data['custom']['views']) + Placefix::_('views') => (isset($data['custom']['views']) && StringHelper::check( $data['custom']['views'] )) ? StringHelper::safe( @@ -5387,8 +5379,8 @@ class Fields extends Structure { // update the key value $replacekey = str_replace( - array($this->bbb, $this->ddd), - array($this->hhh, $this->hhh), $replacekey + array(Placefix::b(), Placefix::d()), + array(Placefix::h(), Placefix::h()), $replacekey ); // now set the value $replace[$replacekey] = $replacevalue; @@ -5407,18 +5399,15 @@ class Fields extends Structure // start loading the field type $this->fileContentDynamic['customfield_' . $data['type']] = array(); // JPREFIX <<>> - $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh - . 'JPREFIX' . $this->hhh] + $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('JPREFIX')] = $jprefix; // Type <<>> - $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh - . 'Type' . $this->hhh] + $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('Type')] = StringHelper::safe( $data['custom']['type'], 'F' ); // type <<>> - $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh - . 'type' . $this->hhh] + $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('type')] = StringHelper::safe($data['custom']['type']); // is this a own custom field if (isset($data['custom']['own_custom'])) @@ -5450,26 +5439,26 @@ class Fields extends Structure // JFORM_TYPE_HEADER <<>> $add_default_header = true; $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' . $this->hhh] - = "//" . $this->setLine( - __LINE__ + . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] + = "//" . Line::_( + __LINE__,__CLASS__ ) . " Import the " . $JFORM_extends . " field type classes needed"; // JFORM_extens <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_extends' . $this->hhh] + . $data['type']][Placefix::_h('JFORM_extends')] = $JFORM_extends; // JFORM_EXTENDS <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_EXTENDS' . $this->hhh] + . $data['type']][Placefix::_h('JFORM_EXTENDS')] = StringHelper::safe( $data['custom']['extends'], 'F' ); // JFORM_TYPE_PHP <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_PHP' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->_t(1) . "//" . $this->setLine( - __LINE__ + . $data['type']][Placefix::_h('JFORM_TYPE_PHP')] + = PHP_EOL . PHP_EOL . Indent::_(1) . "//" . Line::_( + __LINE__,__CLASS__ ) . " A " . $data['custom']['own_custom'] . " Field"; // load the other PHP options foreach (ComponentbuilderHelper::$phpFieldArray as $x) @@ -5486,7 +5475,7 @@ class Fields extends Structure { if (StringHelper::check($code)) { - $phpBucket .= PHP_EOL . $this->setPlaceholders( + $phpBucket .= PHP_EOL . CFactory::_('Placeholder')->update( $code, $tabBreak ); } @@ -5495,9 +5484,8 @@ class Fields extends Structure if ('HEADER' === $x) { $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' - . $this->hhh] - .= PHP_EOL . $this->setPlaceholders( + . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] + .= PHP_EOL . CFactory::_('Placeholder')->update( $phpBucket, $replace ); // stop default headers from loading @@ -5507,9 +5495,8 @@ class Fields extends Structure { // JFORM_TYPE_PHP <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_PHP' - . $this->hhh] - .= PHP_EOL . $this->setPlaceholders( + . $data['type']][Placefix::_h('JFORM_TYPE_PHP')] + .= PHP_EOL . CFactory::_('Placeholder')->update( $phpBucket, $replace ); } @@ -5519,25 +5506,21 @@ class Fields extends Structure if ($add_default_header) { $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' - . $this->hhh] + . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] .= PHP_EOL . "jimport('joomla.form.helper');"; $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' - . $this->hhh] + . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] .= PHP_EOL . "JFormHelper::loadFieldClass('" . $JFORM_extends . "');"; } // check the the JFormHelper::loadFieldClass(..) was set elseif (strpos( $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' - . $this->hhh], 'JFormHelper::loadFieldClass(' + . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')], 'JFormHelper::loadFieldClass(' ) === false) { $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' - . $this->hhh] + . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')] .= PHP_EOL . "JFormHelper::loadFieldClass('" . $JFORM_extends . "');"; } @@ -5564,19 +5547,19 @@ class Fields extends Structure { if ($line == 1) { - $phpCode .= $this->setPlaceholders( + $phpCode .= CFactory::_('Placeholder')->update( $code, $tabBreak ); } else { - $phpCode .= PHP_EOL . $this->_t(2) - . $this->setPlaceholders($code, $tabBreak); + $phpCode .= PHP_EOL . Indent::_(2) + . CFactory::_('Placeholder')->update($code, $tabBreak); } } } // replace the placholders - $phpCode = $this->setPlaceholders($phpCode, $replace); + $phpCode = CFactory::_('Placeholder')->update($phpCode, $replace); } // catch empty stuff if (!StringHelper::check($phpCode)) @@ -5599,21 +5582,21 @@ class Fields extends Structure { if ($line == 1) { - $phpxCode .= $this->setPlaceholders( + $phpxCode .= CFactory::_('Placeholder')->update( $code, $tabBreak ); } else { - $phpxCode .= PHP_EOL . $this->_t(2) - . $this->setPlaceholders( + $phpxCode .= PHP_EOL . Indent::_(2) + . CFactory::_('Placeholder')->update( $code, $tabBreak ); } } } // replace the placholders - $phpxCode = $this->setPlaceholders($phpxCode, $replace); + $phpxCode = CFactory::_('Placeholder')->update($phpxCode, $replace); } // catch empty stuff if (!StringHelper::check($phpxCode)) @@ -5623,39 +5606,36 @@ class Fields extends Structure // temp holder for name $tempName = $data['custom']['label'] . ' Group'; // set lang - $groupLangName = Config::get('lang_prefix') . '_' + $groupLangName = CFactory::_('Config')->lang_prefix . '_' . FieldHelper::safe( $tempName, true ); // add to lang array - $this->setLangContent( - $this->lang, $groupLangName, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $groupLangName, StringHelper::safe($tempName, 'W') ); // build the Group Control $this->setGroupControl[$data['type']] = $groupLangName; // JFORM_GETGROUPS_PHP <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_GETGROUPS_PHP' - . $this->hhh] + . $data['type']][Placefix::_h('JFORM_GETGROUPS_PHP')] = $phpCode; // JFORM_GETEXCLUDED_PHP <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_GETEXCLUDED_PHP' - . $this->hhh] + . $data['type']][Placefix::_h('JFORM_GETEXCLUDED_PHP')] = $phpxCode; } else { // JFORM_GETOPTIONS_PHP <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'JFORM_GETOPTIONS_PHP' - . $this->hhh] + . $data['type']][Placefix::_h('JFORM_GETOPTIONS_PHP')] = $phpCode; } // type <<>> $this->fileContentDynamic['customfield_' - . $data['type']][$this->hhh . 'ADD_BUTTON' . $this->hhh] + . $data['type']][Placefix::_h('ADD_BUTTON')] = $this->setAddButtonToListField($data['custom']); } } @@ -5690,7 +5670,7 @@ class Fields extends Structure ); // set tab and break replacements $tabBreak = array( - '\t' => $this->_t(1), + '\t' => Indent::_(1), '\n' => PHP_EOL ); // load the other PHP options @@ -5708,7 +5688,7 @@ class Fields extends Structure { if (StringHelper::check($code)) { - $phpBucket .= PHP_EOL . $this->setPlaceholders( + $phpBucket .= PHP_EOL . CFactory::_('Placeholder')->update( $code, $tabBreak ); } @@ -5752,65 +5732,65 @@ class Fields extends Structure $target, 'filter' ); // the search language string - $lang_search = Config::get('lang_prefix') . '_FILTER_SEARCH'; + $lang_search = CFactory::_('Config')->lang_prefix . '_FILTER_SEARCH'; // and to translation - $this->setLangContent( - $this->lang, $lang_search, 'Search' + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang_search, 'Search' . StringHelper::safe($nameListCode, 'w') ); // the search description language string - $lang_search_desc = Config::get('lang_prefix') . '_FILTER_SEARCH_' + $lang_search_desc = CFactory::_('Config')->lang_prefix . '_FILTER_SEARCH_' . strtoupper($nameListCode); // and to translation - $this->setLangContent( - $this->lang, $lang_search_desc, 'Search the ' + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang_search_desc, 'Search the ' . StringHelper::safe($nameSingleCode, 'w') . ' items. Prefix with ID: to search for an item by ID.' ); // now build the XML $field_filter_sets = array(); - $field_filter_sets[] = $this->_t(1) . ''; + $field_filter_sets[] = Indent::_(1) . ''; // we first add the search - $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="text"'; - $field_filter_sets[] = $this->_t(3) . 'name="search"'; - $field_filter_sets[] = $this->_t(3) . 'inputmode="search"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(2) . '_t(3) + $field_filter_sets[] = Indent::_(3) . 'description="' . $lang_search_desc . '"'; - $field_filter_sets[] = $this->_t(3) . 'hint="JSEARCH_FILTER"'; - $field_filter_sets[] = $this->_t(2) . '/>'; + $field_filter_sets[] = Indent::_(3) . 'hint="JSEARCH_FILTER"'; + $field_filter_sets[] = Indent::_(2) . '/>'; // add the published filter if published is not set if (!isset($this->fieldsNames[$nameSingleCode]['published'])) { // the published language string - $lang_published = Config::get('lang_prefix') . '_FILTER_PUBLISHED'; + $lang_published = CFactory::_('Config')->lang_prefix . '_FILTER_PUBLISHED'; // and to translation - $this->setLangContent( - $this->lang, $lang_published, 'Status' + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang_published, 'Status' ); // the published description language string - $lang_published_desc = Config::get('lang_prefix') . '_FILTER_PUBLISHED_' + $lang_published_desc = CFactory::_('Config')->lang_prefix . '_FILTER_PUBLISHED_' . strtoupper($nameListCode); // and to translation - $this->setLangContent( - $this->lang, $lang_published_desc, 'Status options for ' + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang_published_desc, 'Status options for ' . StringHelper::safe($nameListCode, 'w') ); - $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="status"'; - $field_filter_sets[] = $this->_t(3) . 'name="published"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(2) . '_t(3) + $field_filter_sets[] = Indent::_(3) . 'description="' . $lang_published_desc . '"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'onchange="this.form.submit();"'; - $field_filter_sets[] = $this->_t(2) . '>'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(2) . '>'; + $field_filter_sets[] = Indent::_(3) . ''; - $field_filter_sets[] = $this->_t(2) . ''; + $field_filter_sets[] = Indent::_(2) . ''; } // add the category if found if (isset($this->categoryBuilder[$nameListCode]) @@ -5821,24 +5801,24 @@ class Fields extends Structure && isset($this->categoryBuilder[$nameListCode]['filter']) && $this->categoryBuilder[$nameListCode]['filter'] >= 1) { - $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="category"'; - $field_filter_sets[] = $this->_t(3) . 'name="category_id"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(2) . '_t(3) + $field_filter_sets[] = Indent::_(3) . 'description="JOPTION_FILTER_CATEGORY_DESC"'; - $field_filter_sets[] = $this->_t(3) . 'multiple="true"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'multiple="true"'; + $field_filter_sets[] = Indent::_(3) . 'class="multipleCategories"'; - $field_filter_sets[] = $this->_t(3) . 'extension="' + $field_filter_sets[] = Indent::_(3) . 'extension="' . $this->categoryBuilder[$nameListCode]['extension'] . '"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'onchange="this.form.submit();"'; // TODO NOT SURE IF THIS SHOULD BE STATIC - $field_filter_sets[] = $this->_t(3) . 'published="0,1,2"'; - $field_filter_sets[] = $this->_t(2) . '/>'; + $field_filter_sets[] = Indent::_(3) . 'published="0,1,2"'; + $field_filter_sets[] = Indent::_(2) . '/>'; } // add the access filter if this view has access // and if access manually is not set @@ -5848,19 +5828,19 @@ class Fields extends Structure ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) { - $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="accesslevel"'; - $field_filter_sets[] = $this->_t(3) . 'name="access"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(2) . '_t(3) + $field_filter_sets[] = Indent::_(3) . 'description="JFIELD_ACCESS_DESC"'; - $field_filter_sets[] = $this->_t(3) . 'multiple="true"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'multiple="true"'; + $field_filter_sets[] = Indent::_(3) . 'class="multipleAccessLevels"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'onchange="this.form.submit();"'; - $field_filter_sets[] = $this->_t(2) . '/>'; + $field_filter_sets[] = Indent::_(2) . '/>'; } // now add the dynamic fields if (isset($this->filterBuilder[$nameListCode]) @@ -5872,14 +5852,14 @@ class Fields extends Structure { if ($filter['type'] != 'category') { - $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="' + $field_filter_sets[] = Indent::_(3) . 'type="' . $filter['type'] . '"'; // set css classname of this field $filter['class'] = ucfirst($filter['type']); @@ -5887,38 +5867,38 @@ class Fields extends Structure else { // we use the filter field type that was build - $field_filter_sets[] = $this->_t(3) . 'type="' + $field_filter_sets[] = Indent::_(3) . 'type="' . $filter['filter_type'] . '"'; // set css classname of this field $filter['class'] = ucfirst($filter['filter_type']); } - $field_filter_sets[] = $this->_t(3) . 'name="' + $field_filter_sets[] = Indent::_(3) . 'name="' . $filter['code'] . '"'; - $field_filter_sets[] = $this->_t(3) . 'label="' + $field_filter_sets[] = Indent::_(3) . 'label="' . $filter['label'] . '"'; // if this is a multi field if ($filter['multi'] == 2) { - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'class="multiple' . $filter['class'] . '"'; - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'multiple="true"'; } else { - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'multiple="false"'; } - $field_filter_sets[] = $this->_t(3) + $field_filter_sets[] = Indent::_(3) . 'onchange="this.form.submit();"'; - $field_filter_sets[] = $this->_t(2) . '/>'; + $field_filter_sets[] = Indent::_(2) . '/>'; } } } - $field_filter_sets[] = $this->_t(2) + $field_filter_sets[] = Indent::_(2) . ''; - $field_filter_sets[] = $this->_t(1) . ''; + $field_filter_sets[] = Indent::_(1) . ''; // now update the file return implode(PHP_EOL, $field_filter_sets); @@ -5946,30 +5926,30 @@ class Fields extends Structure $donelist = array('ordering' => true, 'id' => true); // now build the XML $list_sets = array(); - $list_sets[] = $this->_t(1) . ''; - $list_sets[] = $this->_t(2) . '_t(3) . 'name="fullordering"'; - $list_sets[] = $this->_t(3) . 'type="list"'; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(1) . ''; + $list_sets[] = Indent::_(2) . '_t(3) + $list_sets[] = Indent::_(3) . 'description="COM_CONTENT_LIST_FULL_ORDERING_DESC"'; - $list_sets[] = $this->_t(3) . 'onchange="this.form.submit();"'; + $list_sets[] = Indent::_(3) . 'onchange="this.form.submit();"'; // add dynamic ordering (Admin view) $default_ordering = $this->getListViewDefaultOrdering( $nameListCode ); // set the default ordering - $list_sets[] = $this->_t(3) . 'default="' + $list_sets[] = Indent::_(3) . 'default="' . $default_ordering['name'] . ' ' . $default_ordering['direction'] . '"'; - $list_sets[] = $this->_t(3) . 'validate="options"'; - $list_sets[] = $this->_t(2) . '>'; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . 'validate="options"'; + $list_sets[] = Indent::_(2) . '>'; + $list_sets[] = Indent::_(3) . ''; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; // add the published filter if published is not set if (!isset($this->fieldsNames[$nameSingleCode]['published'])) @@ -5977,9 +5957,9 @@ class Fields extends Structure // add to done list $donelist['published'] = true; // add to xml :) - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; } @@ -5995,10 +5975,10 @@ class Fields extends Structure { if ($filter['type'] === 'category') { - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; } @@ -6006,21 +5986,21 @@ class Fields extends Structure $filter['custom'] )) { - $list_sets[] = $this->_t(3) . ''; - $list_sets[] = $this->_t(3) . ''; } else { - $list_sets[] = $this->_t(3) . ''; - $list_sets[] = $this->_t(3) . ''; } @@ -6030,23 +6010,23 @@ class Fields extends Structure } } - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(3) . ''; - $list_sets[] = $this->_t(2) . '' . PHP_EOL; + $list_sets[] = Indent::_(2) . '' . PHP_EOL; - $list_sets[] = $this->_t(2) . '_t(3) . 'name="limit"'; - $list_sets[] = $this->_t(3) . 'type="limitbox"'; - $list_sets[] = $this->_t(3) . 'label="COM_CONTENT_LIST_LIMIT"'; - $list_sets[] = $this->_t(3) + $list_sets[] = Indent::_(2) . '_t(3) . 'class="input-mini"'; - $list_sets[] = $this->_t(3) . 'default="25"'; - $list_sets[] = $this->_t(3) . 'onchange="this.form.submit();"'; - $list_sets[] = $this->_t(2) . '/>'; - $list_sets[] = $this->_t(1) . ''; + $list_sets[] = Indent::_(3) . 'class="input-mini"'; + $list_sets[] = Indent::_(3) . 'default="25"'; + $list_sets[] = Indent::_(3) . 'onchange="this.form.submit();"'; + $list_sets[] = Indent::_(2) . '/>'; + $list_sets[] = Indent::_(1) . ''; return implode(PHP_EOL, $list_sets); } @@ -6082,29 +6062,25 @@ class Fields extends Structure = array(); // JPREFIX <>> $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][$this->hhh - . 'JPREFIX' . $this->hhh] + . $filter['filter_type']][Placefix::_h('JPREFIX')] = 'J'; // Type <<>> $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][$this->hhh - . 'Type' . $this->hhh] + . $filter['filter_type']][Placefix::_h('Type')] = StringHelper::safe( $filter['filter_type'], 'F' ); // type <<>> $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][$this->hhh - . 'type' . $this->hhh] + . $filter['filter_type']][Placefix::_h('type')] = StringHelper::safe($filter['filter_type']); // JFORM_GETOPTIONS_PHP <<>> $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][$this->hhh . 'JFORM_GETOPTIONS_PHP' - . $this->hhh] + . $filter['filter_type']][Placefix::_h('JFORM_GETOPTIONS_PHP')] = $getOptions; // ADD_BUTTON <<>> $this->fileContentDynamic['customfilterfield_' - . $filter['filter_type']][$this->hhh . 'ADD_BUTTON' . $this->hhh] + . $filter['filter_type']][Placefix::_h('ADD_BUTTON')] = ''; // now build the custom filter field type file $target = array('admin' => 'customfilterfield'); @@ -6135,7 +6111,7 @@ class Fields extends Structure && StringHelper::check($fieldData['views'])) { // set local component - $local_component = "com_" . Config::get('component_code_name'); + $local_component = "com_" . CFactory::_('Config')->component_code_name; // check that the component value is set if (!isset($fieldData['component']) || !StringHelper::check( @@ -6153,13 +6129,13 @@ class Fields extends Structure $fieldData['component'] = "com_" . $fieldData['component']; } // make sure the component is update if # # # or [ [ [ component placeholder is used - if (strpos($fieldData['component'], $this->hhh) !== false + if (strpos($fieldData['component'], Placefix::h()) !== false || strpos( - $fieldData['component'], $this->bbb + $fieldData['component'], Placefix::b() ) !== false) // should not be needed... but { - $fieldData['component'] = $this->setPlaceholders( - $fieldData['component'], $this->placeholders + $fieldData['component'] = CFactory::_('Placeholder')->update( + $fieldData['component'], CFactory::_('Placeholder')->active ); } // get core permissions @@ -6184,112 +6160,112 @@ class Fields extends Structure } // start building the add buttons/s $addButton = array(); - $addButton[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $addButton[] = $this->_t(1) . " * Override to add new button"; - $addButton[] = $this->_t(1) . " *"; - $addButton[] = $this->_t(1) + $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $addButton[] = Indent::_(1) . " * Override to add new button"; + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) . " * @return string The field input markup."; - $addButton[] = $this->_t(1) . " *"; - $addButton[] = $this->_t(1) . " * @since 3.2"; - $addButton[] = $this->_t(1) . " */"; - $addButton[] = $this->_t(1) . "protected function getInput()"; - $addButton[] = $this->_t(1) . "{"; - $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(1) . " *"; + $addButton[] = Indent::_(1) . " * @since 3.2"; + $addButton[] = Indent::_(1) . " */"; + $addButton[] = Indent::_(1) . "protected function getInput()"; + $addButton[] = Indent::_(1) . "{"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " see if we should add buttons"; - $addButton[] = $this->_t(2) + $addButton[] = Indent::_(2) . "\$set_button = \$this->getAttribute('button');"; - $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get html"; - $addButton[] = $this->_t(2) . "\$html = parent::getInput();"; - $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(2) . "\$html = parent::getInput();"; + $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " if true set button"; - $addButton[] = $this->_t(2) . "if (\$set_button === 'true')"; - $addButton[] = $this->_t(2) . "{"; - $addButton[] = $this->_t(3) . "\$button = array();"; - $addButton[] = $this->_t(3) . "\$script = array();"; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(2) . "if (\$set_button === 'true')"; + $addButton[] = Indent::_(2) . "{"; + $addButton[] = Indent::_(3) . "\$button = array();"; + $addButton[] = Indent::_(3) . "\$script = array();"; + $addButton[] = Indent::_(3) . "\$button_code_name = \$this->getAttribute('name');"; - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get the input from url"; - $addButton[] = $this->_t(3) . "\$app = JFactory::getApplication();"; - $addButton[] = $this->_t(3) . "\$jinput = \$app->input;"; - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "\$app = JFactory::getApplication();"; + $addButton[] = Indent::_(3) . "\$jinput = \$app->input;"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get the view name & id"; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "\$values = \$jinput->getArray(array("; - $addButton[] = $this->_t(4) . "'id' => 'int',"; - $addButton[] = $this->_t(4) . "'view' => 'word'"; - $addButton[] = $this->_t(3) . "));"; - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(4) . "'id' => 'int',"; + $addButton[] = Indent::_(4) . "'view' => 'word'"; + $addButton[] = Indent::_(3) . "));"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " check if new item"; - $addButton[] = $this->_t(3) . "\$ref = '';"; - $addButton[] = $this->_t(3) . "\$refJ = '';"; + $addButton[] = Indent::_(3) . "\$ref = '';"; + $addButton[] = Indent::_(3) . "\$refJ = '';"; if ($refLoad) { - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = $this->_t(3) . "{"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " only load referral if not new item."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " get the return value."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$_uri = (string) JUri::getInstance();"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$_return = urlencode(base64_encode(\$_uri));"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " load return value."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$ref .= '&return=' . \$_return;"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$refJ .= '&return=' . \$_return;"; - $addButton[] = $this->_t(3) . "}"; + $addButton[] = Indent::_(3) . "}"; } else { - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = $this->_t(3) . "{"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " only load field details if not new item."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " get the return value."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$_uri = (string) JUri::getInstance();"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$_return = urlencode(base64_encode(\$_uri));"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " load return value."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$ref = '&return=' . \$_return;"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$refJ = '&return=' . \$_return;"; - $addButton[] = $this->_t(3) . "}"; + $addButton[] = Indent::_(3) . "}"; } - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get button label"; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "\$button_label = trim(\$button_code_name);"; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "\$button_label = preg_replace('/_+/', ' ', \$button_label);"; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "\$button_label = preg_replace('/\s+/', ' ', \$button_label);"; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);"; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "\$button_label = ucfirst(strtolower(\$button_label));"; - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get user object"; - $addButton[] = $this->_t(3) . "\$user = JFactory::getUser();"; - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "\$user = JFactory::getUser();"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " only add if user allowed to create " . $fieldData['view']; // check if the item has permissions. if ($coreLoad && isset($core['core.create']) @@ -6302,30 +6278,30 @@ class Fields extends Structure $this->permissionBuilder['global'][$core['core.create']] )) { - $addButton[] = $this->_t(3) . "if (\$user->authorise('" + $addButton[] = Indent::_(3) . "if (\$user->authorise('" . $core['core.create'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } else { - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "if (\$user->authorise('core.create', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } - $addButton[] = $this->_t(3) . "{"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " build Create button"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$button[] = 'lang_prefix . "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; - $addButton[] = $this->_t(5) . "href=\"index.php?option=" + $addButton[] = Indent::_(5) . "href=\"index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['view'] . "&layout=edit'.\$ref.'\" >"; - $addButton[] = $this->_t(5) + $addButton[] = Indent::_(5) . "';"; - $addButton[] = $this->_t(3) . "}"; - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " only add if user allowed to edit " . $fieldData['view']; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) @@ -6338,88 +6314,88 @@ class Fields extends Structure $this->permissionBuilder['global'][$core['core.edit']] )) { - $addButton[] = $this->_t(3) . "if (\$user->authorise('" + $addButton[] = Indent::_(3) . "if (\$user->authorise('" . $core['core.edit'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } else { - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "if (\$user->authorise('core.edit', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } - $addButton[] = $this->_t(3) . "{"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " build edit button"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$button[] = 'lang_prefix . "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; - $addButton[] = $this->_t(5) + $addButton[] = Indent::_(5) . "';"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " build script"; - $addButton[] = $this->_t(4) . "\$script[] = \""; - $addButton[] = $this->_t(5) . "jQuery(document).ready(function() {"; - $addButton[] = $this->_t(6) + $addButton[] = Indent::_(4) . "\$script[] = \""; + $addButton[] = Indent::_(5) . "jQuery(document).ready(function() {"; + $addButton[] = Indent::_(6) . "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {"; - $addButton[] = $this->_t(7) . "e.preventDefault();"; - $addButton[] = $this->_t(7) + $addButton[] = Indent::_(7) . "e.preventDefault();"; + $addButton[] = Indent::_(7) . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; - $addButton[] = $this->_t(7) + $addButton[] = Indent::_(7) . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; - $addButton[] = $this->_t(6) . "});"; - $addButton[] = $this->_t(6) + $addButton[] = Indent::_(6) . "});"; + $addButton[] = Indent::_(6) . "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();"; - $addButton[] = $this->_t(6) + $addButton[] = Indent::_(6) . "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);"; - $addButton[] = $this->_t(5) . "});"; - $addButton[] = $this->_t(5) + $addButton[] = Indent::_(5) . "});"; + $addButton[] = Indent::_(5) . "function \".\$button_code_name.\"Button(value) {"; - $addButton[] = $this->_t(6) + $addButton[] = Indent::_(6) . "if (value > 0) {"; // TODO not ideal since value may not be an (int) - $addButton[] = $this->_t(7) . "// hide the create button"; - $addButton[] = $this->_t(7) + $addButton[] = Indent::_(7) . "// hide the create button"; + $addButton[] = Indent::_(7) . "jQuery('#\".\$button_code_name.\"Create').hide();"; - $addButton[] = $this->_t(7) . "// show edit button"; - $addButton[] = $this->_t(7) + $addButton[] = Indent::_(7) . "// show edit button"; + $addButton[] = Indent::_(7) . "jQuery('#\".\$button_code_name.\"Edit').show();"; - $addButton[] = $this->_t(7) . "var url = 'index.php?option=" + $addButton[] = Indent::_(7) . "var url = 'index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['views'] . "&task=" . $fieldData['view'] . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID - $addButton[] = $this->_t(7) + $addButton[] = Indent::_(7) . "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);"; - $addButton[] = $this->_t(6) . "} else {"; - $addButton[] = $this->_t(7) . "// show the create button"; - $addButton[] = $this->_t(7) + $addButton[] = Indent::_(6) . "} else {"; + $addButton[] = Indent::_(7) . "// show the create button"; + $addButton[] = Indent::_(7) . "jQuery('#\".\$button_code_name.\"Create').show();"; - $addButton[] = $this->_t(7) . "// hide edit button"; - $addButton[] = $this->_t(7) + $addButton[] = Indent::_(7) . "// hide edit button"; + $addButton[] = Indent::_(7) . "jQuery('#\".\$button_code_name.\"Edit').hide();"; - $addButton[] = $this->_t(6) . "}"; - $addButton[] = $this->_t(5) . "}\";"; - $addButton[] = $this->_t(3) . "}"; - $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(6) . "}"; + $addButton[] = Indent::_(5) . "}\";"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " check if button was created for " . $fieldData['view'] . " field."; - $addButton[] = $this->_t(3) + $addButton[] = Indent::_(3) . "if (is_array(\$button) && count(\$button) > 0)"; - $addButton[] = $this->_t(3) . "{"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(3) . "{"; + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Load the needed script."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$document = JFactory::getDocument();"; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "\$document->addScriptDeclaration(implode(' ',\$script));"; - $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " return the button attached to input field."; - $addButton[] = $this->_t(4) + $addButton[] = Indent::_(4) . "return '
' .\$html . implode('',\$button).'
';"; - $addButton[] = $this->_t(3) . "}"; - $addButton[] = $this->_t(2) . "}"; - $addButton[] = $this->_t(2) . "return \$html;"; - $addButton[] = $this->_t(1) . "}"; + $addButton[] = Indent::_(3) . "}"; + $addButton[] = Indent::_(2) . "}"; + $addButton[] = Indent::_(2) . "return \$html;"; + $addButton[] = Indent::_(1) . "}"; return implode(PHP_EOL, $addButton); } @@ -6444,7 +6420,7 @@ class Fields extends Structure $dom->getElementsByTagName($nodename)->item(0) ); // make sure Tidy is enabled - if (Config::get('tidy', false)) + if (CFactory::_('Config')->get('tidy', false)) { $tidy = new Tidy(); $tidy->parseString( diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 8c3f378ff..71e0592f4 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -21,7 +21,10 @@ use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\MathHelper; -use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; /** * Compiler class @@ -29,6 +32,7 @@ use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; class Interpretation extends Fields { + /** * The global config Field Sets * @@ -246,10 +250,10 @@ class Interpretation extends Fields /** * Constructor */ - public function __construct($config = array()) + public function __construct() { // first we run the parent constructor - if (parent::__construct($config)) + if (parent::__construct()) { return true; } @@ -257,23 +261,6 @@ class Interpretation extends Fields return false; } - /** - * Set the line number in comments - * - * @param int $nr The line number - * - * @return string - */ - private function setLine($nr) - { - if (Config::get('debug_line_nr', false)) - { - return ' [Interpretation ' . $nr . ']'; - } - - return ''; - } - /** * add email helper */ @@ -283,16 +270,14 @@ class Interpretation extends Fields && $this->componentData->add_email_helper) { // set email helper in place with component name - $component = Config::get('component_code_name'); - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; + $component = CFactory::_('Config')->component_code_name; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; $target = array('admin' => 'emailer'); $done = $this->buildDynamique($target, 'emailer', $component); if ($done) { // the text for the file BAKING - $this->fileContentDynamic['emailer_' . $component][$this->hhh - . 'BAKING' . $this->hhh] + $this->fileContentDynamic['emailer_' . $component][Placefix::_h('BAKING')] = ''; // <<-- to insure it gets updated // return the code need to load the abstract class return PHP_EOL . "JLoader::register('" . $Component @@ -313,25 +298,20 @@ class Interpretation extends Fields && $this->componentData->license_type == 3) { if (!isset( - $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')] )) { $_WHMCS = '_' . StringHelper::safe( $this->uniquekey(10), 'U' ); // add it to the system - $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')] = $this->setHelperLicenseLock($_WHMCS, 'site'); - $this->fileContentStatic[$this->hhh . 'HELPER_LICENSE_LOCK' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')] = $this->setHelperLicenseLock($_WHMCS, 'admin'); - $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_INT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')] = $this->setInitLicenseLock($_WHMCS); - $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_DEFINED' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')] = PHP_EOL . PHP_EOL . 'defined(\'' . $_WHMCS . '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));'; } @@ -339,17 +319,13 @@ class Interpretation extends Fields else { // don't add it to the system - $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')] = ''; - $this->fileContentStatic[$this->hhh . 'HELPER_LICENSE_LOCK' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')] = ''; - $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_INT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')] = ''; - $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_DEFINED' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')] = ''; } } @@ -366,8 +342,7 @@ class Interpretation extends Fields && $this->componentData->license_type == 3) { if (!isset( - $this->fileContentDynamic[$view][$this->hhh . 'BOOLMETHOD' - . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('BOOLMETHOD')] )) { $boolMethod = 'get' . StringHelper::safe( @@ -377,31 +352,24 @@ class Interpretation extends Fields $this->uniquekey(3), 'W' ); // add it to the system - $this->fileContentDynamic[$view][$this->hhh - . 'LICENSE_LOCKED_SET_BOOL' . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_SET_BOOL')] = $this->setBoolLicenseLock($boolMethod, $globalbool); - $this->fileContentDynamic[$view][$this->hhh - . 'LICENSE_LOCKED_CHECK' . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_CHECK')] = $this->checkStatmentLicenseLocked($boolMethod); - $this->fileContentDynamic[$view][$this->hhh - . 'LICENSE_TABLE_LOCKED_CHECK' . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('LICENSE_TABLE_LOCKED_CHECK')] = $this->checkStatmentLicenseLocked($boolMethod, '$table'); - $this->fileContentDynamic[$view][$this->hhh . 'BOOLMETHOD' - . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('BOOLMETHOD')] = $boolMethod; } } else { // don't add it to the system - $this->fileContentDynamic[$view][$this->hhh - . 'LICENSE_LOCKED_SET_BOOL' . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_SET_BOOL')] = ''; - $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_LOCKED_CHECK' - . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_CHECK')] = ''; - $this->fileContentDynamic[$view][$this->hhh - . 'LICENSE_TABLE_LOCKED_CHECK' . $this->hhh] + $this->fileContentDynamic[$view][Placefix::_h('LICENSE_TABLE_LOCKED_CHECK')] = ''; } } @@ -416,15 +384,15 @@ class Interpretation extends Fields */ public function checkStatmentLicenseLocked($boolMethod, $thIIS = '$this') { - $statment[] = PHP_EOL . $this->_t(2) . "if (!" . $thIIS . "->" + $statment[] = PHP_EOL . Indent::_(2) . "if (!" . $thIIS . "->" . $boolMethod . "())"; - $statment[] = $this->_t(2) . "{"; - $statment[] = $this->_t(3) . "\$app = JFactory::getApplication();"; - $statment[] = $this->_t(3) . "\$app->enqueueMessage(JText:" + $statment[] = Indent::_(2) . "{"; + $statment[] = Indent::_(3) . "\$app = JFactory::getApplication();"; + $statment[] = Indent::_(3) . "\$app->enqueueMessage(JText:" . ":_('NIE_REG_NIE'), 'error');"; - $statment[] = $this->_t(3) . "\$app->redirect('index.php');"; - $statment[] = $this->_t(3) . "return false;"; - $statment[] = $this->_t(2) . "}"; + $statment[] = Indent::_(3) . "\$app->redirect('index.php');"; + $statment[] = Indent::_(3) . "return false;"; + $statment[] = Indent::_(2) . "}"; // return the genuine mentod statement return implode(PHP_EOL, $statment); @@ -440,38 +408,38 @@ class Interpretation extends Fields */ public function setBoolLicenseLock($boolMethod, $globalbool) { - $bool[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $bool[] = $this->_t(1) . " * The private bool."; - $bool[] = $this->_t(1) . " **/"; - $bool[] = $this->_t(1) . "private $" . $globalbool . ";"; - $bool[] = PHP_EOL . $this->_t(1) . "/**"; - $bool[] = $this->_t(1) . " * Check if this install has a license."; - $bool[] = $this->_t(1) . " **/"; - $bool[] = $this->_t(1) . "public function " . $boolMethod . "()"; - $bool[] = $this->_t(1) . "{"; - $bool[] = $this->_t(2) . "if(!empty(\$this->" . $globalbool . "))"; - $bool[] = $this->_t(2) . "{"; - $bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";"; - $bool[] = $this->_t(2) . "}"; - $bool[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $bool[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $bool[] = Indent::_(1) . " * The private bool."; + $bool[] = Indent::_(1) . " **/"; + $bool[] = Indent::_(1) . "private $" . $globalbool . ";"; + $bool[] = PHP_EOL . Indent::_(1) . "/**"; + $bool[] = Indent::_(1) . " * Check if this install has a license."; + $bool[] = Indent::_(1) . " **/"; + $bool[] = Indent::_(1) . "public function " . $boolMethod . "()"; + $bool[] = Indent::_(1) . "{"; + $bool[] = Indent::_(2) . "if(!empty(\$this->" . $globalbool . "))"; + $bool[] = Indent::_(2) . "{"; + $bool[] = Indent::_(3) . "return \$this->" . $globalbool . ";"; + $bool[] = Indent::_(2) . "}"; + $bool[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get the global params"; - $bool[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" - . Config::get('component_code_name') . "', true);"; - $bool[] = $this->_t(2) + $bool[] = Indent::_(2) . "\$params = JComponentHelper::getParams('com_" + . CFactory::_('Config')->component_code_name . "', true);"; + $bool[] = Indent::_(2) . "\$whmcs_key = \$params->get('whmcs_key', null);"; - $bool[] = $this->_t(2) . "if (\$whmcs_key)"; - $bool[] = $this->_t(2) . "{"; - $bool[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $bool[] = Indent::_(2) . "if (\$whmcs_key)"; + $bool[] = Indent::_(2) . "{"; + $bool[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " load the file"; - $bool[] = $this->_t(3) + $bool[] = Indent::_(3) . "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_" - . Config::get('component_code_name') . "');"; - $bool[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);"; - $bool[] = $this->_t(3) . "\$this->" . $globalbool . " = \$the->_is;"; - $bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";"; - $bool[] = $this->_t(2) . "}"; - $bool[] = $this->_t(2) . "return false;"; - $bool[] = $this->_t(1) . "}"; + . CFactory::_('Config')->component_code_name . "');"; + $bool[] = Indent::_(3) . "\$the = new WHMCS(\$whmcs_key);"; + $bool[] = Indent::_(3) . "\$this->" . $globalbool . " = \$the->_is;"; + $bool[] = Indent::_(3) . "return \$this->" . $globalbool . ";"; + $bool[] = Indent::_(2) . "}"; + $bool[] = Indent::_(2) . "return false;"; + $bool[] = Indent::_(1) . "}"; // return the genuine method statement return implode(PHP_EOL, $bool); @@ -487,30 +455,30 @@ class Interpretation extends Fields */ public function setHelperLicenseLock($_WHMCS, $target) { - $helper[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $helper[] = $this->_t(1) . " * Check if this install has a license."; - $helper[] = $this->_t(1) . " **/"; - $helper[] = $this->_t(1) . "public static function isGenuine()"; - $helper[] = $this->_t(1) . "{"; - $helper[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $helper[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $helper[] = Indent::_(1) . " * Check if this install has a license."; + $helper[] = Indent::_(1) . " **/"; + $helper[] = Indent::_(1) . "public static function isGenuine()"; + $helper[] = Indent::_(1) . "{"; + $helper[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get the global params"; - $helper[] = $this->_t(2) + $helper[] = Indent::_(2) . "\$params = JComponentHelper::getParams('com_" - . Config::get('component_code_name') . "', true);"; - $helper[] = $this->_t(2) + . CFactory::_('Config')->component_code_name . "', true);"; + $helper[] = Indent::_(2) . "\$whmcs_key = \$params->get('whmcs_key', null);"; - $helper[] = $this->_t(2) . "if (\$whmcs_key)"; - $helper[] = $this->_t(2) . "{"; - $helper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $helper[] = Indent::_(2) . "if (\$whmcs_key)"; + $helper[] = Indent::_(2) . "{"; + $helper[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " load the file"; - $helper[] = $this->_t(3) + $helper[] = Indent::_(3) . "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_" - . Config::get('component_code_name') . "');"; - $helper[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);"; - $helper[] = $this->_t(3) . "return \$the->_is;"; - $helper[] = $this->_t(2) . "}"; - $helper[] = $this->_t(2) . "return false;"; - $helper[] = $this->_t(1) . "}"; + . CFactory::_('Config')->component_code_name . "');"; + $helper[] = Indent::_(3) . "\$the = new WHMCS(\$whmcs_key);"; + $helper[] = Indent::_(3) . "return \$the->_is;"; + $helper[] = Indent::_(2) . "}"; + $helper[] = Indent::_(2) . "return false;"; + $helper[] = Indent::_(1) . "}"; // return the genuine mentod statement return implode(PHP_EOL, $helper); @@ -527,13 +495,13 @@ class Interpretation extends Fields { $init[] = PHP_EOL . "if (!defined('" . $_WHMCS . "'))"; $init[] = "{"; - $init[] = $this->_t(1) . "\$allow = " - . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] + $init[] = Indent::_(1) . "\$allow = " + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::isGenuine();"; - $init[] = $this->_t(1) . "if (\$allow)"; - $init[] = $this->_t(1) . "{"; - $init[] = $this->_t(2) . "define('" . $_WHMCS . "', 1);"; - $init[] = $this->_t(1) . "}"; + $init[] = Indent::_(1) . "if (\$allow)"; + $init[] = Indent::_(1) . "{"; + $init[] = Indent::_(2) . "define('" . $_WHMCS . "', 1);"; + $init[] = Indent::_(1) . "}"; $init[] = "}"; // return the initializing statement @@ -575,252 +543,252 @@ class Interpretation extends Fields $theKey = base64_encode(serialize($key)); // set the script $encrypt[] = "/**"; - $encrypt[] = "* " . $this->setLine(__LINE__) . "WHMCS Class "; + $encrypt[] = "* " . Line::_(__Line__, __Class__) . "WHMCS Class "; $encrypt[] = "**/"; $encrypt[] = "class WHMCS"; $encrypt[] = "{"; - $encrypt[] = $this->_t(1) . "public \$_key = false;"; - $encrypt[] = $this->_t(1) . "public \$_is = false;"; - $encrypt[] = PHP_EOL . $this->_t(1) + $encrypt[] = Indent::_(1) . "public \$_key = false;"; + $encrypt[] = Indent::_(1) . "public \$_is = false;"; + $encrypt[] = PHP_EOL . Indent::_(1) . "public function __construct(\$Vk5smi0wjnjb)"; - $encrypt[] = $this->_t(1) . "{"; - $encrypt[] = $this->_t(2) . "// get the session"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(1) . "{"; + $encrypt[] = Indent::_(2) . "// get the session"; + $encrypt[] = Indent::_(2) . "\$session = JFactory::getSession();"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "\$V2uekt2wcgwk = \$session->get(\$Vk5smi0wjnjb, null);"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "\$h4sgrGsqq = \$this->get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk);"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "if (isset(\$h4sgrGsqq['nuut']) && \$h4sgrGsqq['nuut'] && (isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['eiegrendel']) && strlen(\$h4sgrGsqq['eiegrendel']) > 300)"; - $encrypt[] = $this->_t(2) . "{"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(2) . "{"; + $encrypt[] = Indent::_(3) . "\$session->set(\$Vk5smi0wjnjb, \$h4sgrGsqq['eiegrendel']);"; - $encrypt[] = $this->_t(2) . "}"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "}"; + $encrypt[] = Indent::_(2) . "if ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 && isset(\$h4sgrGsqq['customfields']) && strlen(\$h4sgrGsqq['customfields']) > 4)"; - $encrypt[] = $this->_t(2) . "{"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(2) . "{"; + $encrypt[] = Indent::_(3) . "\$this->_key = md5(\$h4sgrGsqq['customfields']);"; - $encrypt[] = $this->_t(2) . "}"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "}"; + $encrypt[] = Indent::_(2) . "if ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 )"; - $encrypt[] = $this->_t(2) . "{"; - $encrypt[] = $this->_t(3) . "\$this->_is = true;"; - $encrypt[] = $this->_t(2) . "}"; - $encrypt[] = $this->_t(1) . "}"; - $encrypt[] = PHP_EOL . $this->_t(1) + $encrypt[] = Indent::_(2) . "{"; + $encrypt[] = Indent::_(3) . "\$this->_is = true;"; + $encrypt[] = Indent::_(2) . "}"; + $encrypt[] = Indent::_(1) . "}"; + $encrypt[] = PHP_EOL . Indent::_(1) . "private function get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk)"; - $encrypt[] = $this->_t(1) . "{"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(1) . "{"; + $encrypt[] = Indent::_(2) . "\$Viioj50xuqu2 = unserialize(base64_decode('" . $theKey . "'));"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "\$Visqfrd1caus = time() . md5(mt_rand(1000000000, 9999999999) . \$Vk5smi0wjnjb);"; - $encrypt[] = $this->_t(2) . "\$Vo4tezfgcf3e = date(\"Ymd\");"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "\$Vo4tezfgcf3e = date(\"Ymd\");"; + $encrypt[] = Indent::_(2) . "\$Vozblwvfym2f = \$_SERVER['SERVER_NAME'];"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "\$Vozblwvfym2fdie = isset(\$_SERVER['SERVER_ADDR']) ? \$_SERVER['SERVER_ADDR'] : \$_SERVER['LOCAL_ADDR'];"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "\$V343jp03dxco = dirname(__FILE__);"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(2) . "\$Vc2rayehw4f0 = unserialize(base64_decode('czozNjoibW9kdWxlcy9zZXJ2ZXJzL2xpY2Vuc2luZy92ZXJpZnkucGhwIjs='));"; - $encrypt[] = $this->_t(2) . "\$Vlpolphukogz = false;"; - $encrypt[] = $this->_t(2) . "if (\$V2uekt2wcgwk) {"; - $encrypt[] = $this->_t(3) . "\$V2uekt2wcgwk = str_replace(\"" + $encrypt[] = Indent::_(2) . "\$Vlpolphukogz = false;"; + $encrypt[] = Indent::_(2) . "if (\$V2uekt2wcgwk) {"; + $encrypt[] = Indent::_(3) . "\$V2uekt2wcgwk = str_replace(\"" . '".PHP_EOL."' . "\", '', \$V2uekt2wcgwk);"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(3) . "\$Vm5cxjdc43g4 = substr(\$V2uekt2wcgwk, 0, strlen(\$V2uekt2wcgwk) - 32);"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(3) . "\$Vbgx0efeu2sy = substr(\$V2uekt2wcgwk, strlen(\$V2uekt2wcgwk) - 32);"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(3) . "if (\$Vbgx0efeu2sy == md5(\$Vm5cxjdc43g4 . \$Viioj50xuqu2['geheim'])) {"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vm5cxjdc43g4 = strrev(\$Vm5cxjdc43g4);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vbgx0efeu2sy = substr(\$Vm5cxjdc43g4, 0, 32);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vm5cxjdc43g4 = substr(\$Vm5cxjdc43g4, 32);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vm5cxjdc43g4 = base64_decode(\$Vm5cxjdc43g4);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vm5cxjdc43g4finding = unserialize(\$Vm5cxjdc43g4);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$V3qqz0p00fbq = \$Vm5cxjdc43g4finding['dan'];"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "if (\$Vbgx0efeu2sy == md5(\$V3qqz0p00fbq . \$Viioj50xuqu2['geheim'])) {"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "if (\$V3qqz0p00fbq > \$Vbfbwv2y4kre) {"; - $encrypt[] = $this->_t(6) . "\$Vlpolphukogz = true;"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(6) . "\$Vlpolphukogz = true;"; + $encrypt[] = Indent::_(6) . "\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(6) . "\$Vcixw3trerrt = explode(',', \$Vwasqoybpyed['validdomain']);"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(6) . "if (!in_array(\$_SERVER['SERVER_NAME'], \$Vcixw3trerrt)) {"; - $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;"; - $encrypt[] = $this->_t(7) + $encrypt[] = Indent::_(7) . "\$Vlpolphukogz = false;"; + $encrypt[] = Indent::_(7) . "\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; - $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();"; - $encrypt[] = $this->_t(6) . "}"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(7) . "\$Vwasqoybpyed = array();"; + $encrypt[] = Indent::_(6) . "}"; + $encrypt[] = Indent::_(6) . "\$Vkni3xyhkqzv = explode(',', \$Vwasqoybpyed['validip']);"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(6) . "if (!in_array(\$Vozblwvfym2fdie, \$Vkni3xyhkqzv)) {"; - $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;"; - $encrypt[] = $this->_t(7) + $encrypt[] = Indent::_(7) . "\$Vlpolphukogz = false;"; + $encrypt[] = Indent::_(7) . "\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; - $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();"; - $encrypt[] = $this->_t(6) . "}"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(7) . "\$Vwasqoybpyed = array();"; + $encrypt[] = Indent::_(6) . "}"; + $encrypt[] = Indent::_(6) . "\$Vckfvnepoaxj = explode(',', \$Vwasqoybpyed['validdirectory']);"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(6) . "if (!in_array(\$V343jp03dxco, \$Vckfvnepoaxj)) {"; - $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;"; - $encrypt[] = $this->_t(7) + $encrypt[] = Indent::_(7) . "\$Vlpolphukogz = false;"; + $encrypt[] = Indent::_(7) . "\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; - $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();"; - $encrypt[] = $this->_t(6) . "}"; - $encrypt[] = $this->_t(5) . "}"; - $encrypt[] = $this->_t(4) . "}"; - $encrypt[] = $this->_t(3) . "}"; - $encrypt[] = $this->_t(2) . "}"; - $encrypt[] = $this->_t(2) . "if (!\$Vlpolphukogz) {"; - $encrypt[] = $this->_t(3) . "\$V1u0c4dl3ehp = array("; - $encrypt[] = $this->_t(4) . "'licensekey' => \$Vk5smi0wjnjb,"; - $encrypt[] = $this->_t(4) . "'domain' => \$Vozblwvfym2f,"; - $encrypt[] = $this->_t(4) . "'ip' => \$Vozblwvfym2fdie,"; - $encrypt[] = $this->_t(4) . "'dir' => \$V343jp03dxco,"; - $encrypt[] = $this->_t(3) . ");"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(7) . "\$Vwasqoybpyed = array();"; + $encrypt[] = Indent::_(6) . "}"; + $encrypt[] = Indent::_(5) . "}"; + $encrypt[] = Indent::_(4) . "}"; + $encrypt[] = Indent::_(3) . "}"; + $encrypt[] = Indent::_(2) . "}"; + $encrypt[] = Indent::_(2) . "if (!\$Vlpolphukogz) {"; + $encrypt[] = Indent::_(3) . "\$V1u0c4dl3ehp = array("; + $encrypt[] = Indent::_(4) . "'licensekey' => \$Vk5smi0wjnjb,"; + $encrypt[] = Indent::_(4) . "'domain' => \$Vozblwvfym2f,"; + $encrypt[] = Indent::_(4) . "'ip' => \$Vozblwvfym2fdie,"; + $encrypt[] = Indent::_(4) . "'dir' => \$V343jp03dxco,"; + $encrypt[] = Indent::_(3) . ");"; + $encrypt[] = Indent::_(3) . "if (\$Visqfrd1caus) \$V1u0c4dl3ehp['check_token'] = \$Visqfrd1caus;"; - $encrypt[] = $this->_t(3) . "\$Vdsjeyjmpq2o = '';"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(3) . "\$Vdsjeyjmpq2o = '';"; + $encrypt[] = Indent::_(3) . "foreach (\$V1u0c4dl3ehp AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vdsjeyjmpq2o .= \$V2sgyscukmgi.'='.urlencode(\$V1u00zkzmb1d).'&';"; - $encrypt[] = $this->_t(3) . "}"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(3) . "}"; + $encrypt[] = Indent::_(3) . "if (function_exists('curl_exec')) {"; - $encrypt[] = $this->_t(4) . "\$Vdathuqgjyf0 = curl_init();"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vdathuqgjyf0 = curl_init();"; + $encrypt[] = Indent::_(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_URL, \$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_POST, 1);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_POSTFIELDS, \$Vdsjeyjmpq2o);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_TIMEOUT, 30);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_RETURNTRANSFER, 1);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vqojefyeohg5 = curl_exec(\$Vdathuqgjyf0);"; - $encrypt[] = $this->_t(4) . "curl_close(\$Vdathuqgjyf0);"; - $encrypt[] = $this->_t(3) . "} else {"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "curl_close(\$Vdathuqgjyf0);"; + $encrypt[] = Indent::_(3) . "} else {"; + $encrypt[] = Indent::_(4) . "\$Vrpmu4bvnmkp = fsockopen(\$Viioj50xuqu2['kasier'], 80, \$Vc0t5kmpwkwk, \$Va3g41fnofhu, 5);"; - $encrypt[] = $this->_t(4) . "if (\$Vrpmu4bvnmkp) {"; - $encrypt[] = $this->_t(5) . "\$Vznkm0a0me1y = \"\r" . PHP_EOL + $encrypt[] = Indent::_(4) . "if (\$Vrpmu4bvnmkp) {"; + $encrypt[] = Indent::_(5) . "\$Vznkm0a0me1y = \"\r" . PHP_EOL . "\";"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$V2sgyscukmgiop = \"POST \".\$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0 . \" HTTP/1.0\" . \$Vznkm0a0me1y;"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$V2sgyscukmgiop .= \"Host: \".\$Viioj50xuqu2['kasier'] . \$Vznkm0a0me1y;"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$V2sgyscukmgiop .= \"Content-type: application/x-www-form-urlencoded\" . \$Vznkm0a0me1y;"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$V2sgyscukmgiop .= \"Content-length: \".@strlen(\$Vdsjeyjmpq2o) . \$Vznkm0a0me1y;"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$V2sgyscukmgiop .= \"Connection: close\" . \$Vznkm0a0me1y . \$Vznkm0a0me1y;"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$V2sgyscukmgiop .= \$Vdsjeyjmpq2o;"; - $encrypt[] = $this->_t(5) . "\$Vqojefyeohg5 = '';"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$Vqojefyeohg5 = '';"; + $encrypt[] = Indent::_(5) . "@stream_set_timeout(\$Vrpmu4bvnmkp, 20);"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "@fputs(\$Vrpmu4bvnmkp, \$V2sgyscukmgiop);"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "while (!@feof(\$Vrpmu4bvnmkp)&&\$V2czq24pjexf) {"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(6) . "\$Vqojefyeohg5 .= @fgets(\$Vrpmu4bvnmkp, 1024);"; - $encrypt[] = $this->_t(6) + $encrypt[] = Indent::_(6) . "\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);"; - $encrypt[] = $this->_t(5) . "}"; - $encrypt[] = $this->_t(5) . "@fclose (\$Vqojefyeohg5);"; - $encrypt[] = $this->_t(4) . "}"; - $encrypt[] = $this->_t(3) . "}"; - $encrypt[] = $this->_t(3) . "if (!\$Vqojefyeohg5) {"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(5) . "}"; + $encrypt[] = Indent::_(5) . "@fclose (\$Vqojefyeohg5);"; + $encrypt[] = Indent::_(4) . "}"; + $encrypt[] = Indent::_(3) . "}"; + $encrypt[] = Indent::_(3) . "if (!\$Vqojefyeohg5) {"; + $encrypt[] = Indent::_(4) . "\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "if (isset(\$V3qqz0p00fbq) && \$V3qqz0p00fbq > \$Vbfbwv2y4kre) {"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;"; - $encrypt[] = $this->_t(4) . "} else {"; - $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed = array();"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(4) . "} else {"; + $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed = array();"; + $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed['status'] = \"sleg\";"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed['description'] = \"Remote Check Failed\";"; - $encrypt[] = $this->_t(5) . "return \$Vwasqoybpyed;"; - $encrypt[] = $this->_t(4) . "}"; - $encrypt[] = $this->_t(3) . "} else {"; - $encrypt[] = $this->_t(4) . "preg_match_all('" + $encrypt[] = Indent::_(5) . "return \$Vwasqoybpyed;"; + $encrypt[] = Indent::_(4) . "}"; + $encrypt[] = Indent::_(3) . "} else {"; + $encrypt[] = Indent::_(4) . "preg_match_all('" . '/<(.*?)>([^<]+)<\/\\1>/i' . "', \$Vqojefyeohg5, \$V1ot20wob03f);"; - $encrypt[] = $this->_t(4) . "\$Vwasqoybpyed = array();"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vwasqoybpyed = array();"; + $encrypt[] = Indent::_(4) . "foreach (\$V1ot20wob03f[1] AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed[\$V1u00zkzmb1d] = \$V1ot20wob03f[2][\$V2sgyscukmgi];"; - $encrypt[] = $this->_t(4) . "}"; - $encrypt[] = $this->_t(3) . "}"; - $encrypt[] = $this->_t(3) . "if (!is_array(\$Vwasqoybpyed)) {"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "}"; + $encrypt[] = Indent::_(3) . "}"; + $encrypt[] = Indent::_(3) . "if (!is_array(\$Vwasqoybpyed)) {"; + $encrypt[] = Indent::_(4) . "die(\"Invalid License Server Response\");"; - $encrypt[] = $this->_t(3) . "}"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(3) . "}"; + $encrypt[] = Indent::_(3) . "if (isset(\$Vwasqoybpyed['md5hash']) && \$Vwasqoybpyed['md5hash']) {"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "if (\$Vwasqoybpyed['md5hash'] != md5(\$Viioj50xuqu2['geheim'] . \$Visqfrd1caus)) {"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed['status'] = \"sleg\";"; - $encrypt[] = $this->_t(5) + $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed['description'] = \"MD5 Checksum Verification Failed\";"; - $encrypt[] = $this->_t(5) . "return \$Vwasqoybpyed;"; - $encrypt[] = $this->_t(4) . "}"; - $encrypt[] = $this->_t(3) . "}"; - $encrypt[] = $this->_t(3) + $encrypt[] = Indent::_(5) . "return \$Vwasqoybpyed;"; + $encrypt[] = Indent::_(4) . "}"; + $encrypt[] = Indent::_(3) . "}"; + $encrypt[] = Indent::_(3) . "if (isset(\$Vwasqoybpyed['status']) && \$Vwasqoybpyed['status'] == \"Active\") {"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vwasqoybpyed['dan'] = \$Vo4tezfgcf3e;"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vqojefyeohg5ing = serialize(\$Vwasqoybpyed);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vqojefyeohg5ing = base64_encode(\$Vqojefyeohg5ing);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vqojefyeohg5ing = md5(\$Vo4tezfgcf3e . \$Viioj50xuqu2['geheim']) . \$Vqojefyeohg5ing;"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vqojefyeohg5ing = strrev(\$Vqojefyeohg5ing);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vqojefyeohg5ing = \$Vqojefyeohg5ing . md5(\$Vqojefyeohg5ing . \$Viioj50xuqu2['geheim']);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vqojefyeohg5ing = wordwrap(\$Vqojefyeohg5ing, 80, \"" . '".PHP_EOL."' . "\", true);"; - $encrypt[] = $this->_t(4) + $encrypt[] = Indent::_(4) . "\$Vwasqoybpyed['eiegrendel'] = \$Vqojefyeohg5ing;"; - $encrypt[] = $this->_t(3) . "}"; - $encrypt[] = $this->_t(3) . "\$Vwasqoybpyed['nuut'] = true;"; - $encrypt[] = $this->_t(2) . "}"; - $encrypt[] = $this->_t(2) + $encrypt[] = Indent::_(3) . "}"; + $encrypt[] = Indent::_(3) . "\$Vwasqoybpyed['nuut'] = true;"; + $encrypt[] = Indent::_(2) . "}"; + $encrypt[] = Indent::_(2) . "unset(\$V1u0c4dl3ehp,\$Vqojefyeohg5,\$V1ot20wob03f,\$Viioj50xuqu2['kasier'],\$Viioj50xuqu2['geheim'],\$Vo4tezfgcf3e,\$Vozblwvfym2fdie,\$Viioj50xuqu2['onthou'],\$Vbgx0efeu2sy);"; - $encrypt[] = $this->_t(2) . "return \$Vwasqoybpyed;"; - $encrypt[] = $this->_t(1) . "}"; + $encrypt[] = Indent::_(2) . "return \$Vwasqoybpyed;"; + $encrypt[] = Indent::_(1) . "}"; $encrypt[] = "}"; // return the help methods @@ -837,9 +805,9 @@ class Interpretation extends Fields ), 'Error' ); - return "//" . $this->setLine(__LINE__) + return "//" . Line::_(__Line__, __Class__) . " The WHMCS class could not be added to this component." . PHP_EOL - . "//" . $this->setLine(__LINE__) + . "//" . Line::_(__Line__, __Class__) . " Please note that you will need to enable the add-on in the Joomla Component area (Add WHMCS)->Yes."; } @@ -851,7 +819,7 @@ class Interpretation extends Fields public function setGetCryptKey() { // WHMCS_ENCRYPT_FILE - $this->fileContentStatic[$this->hhh . 'WHMCS_ENCRYPT_FILE' . $this->hhh] + $this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')] = ''; // check if encryption is ative if ((isset($this->basicFieldModeling) @@ -876,36 +844,34 @@ class Interpretation extends Fields $target = array('admin' => 'whmcs'); $done = $this->buildDynamique($target, 'whmcs'); // the text for the file WHMCS_ENCRYPTION_BODY - $this->fileContentDynamic['whmcs'][$this->hhh - . 'WHMCS_ENCRYPTION_BODY' . $this->hhh] + $this->fileContentDynamic['whmcs'][Placefix::_h('WHMCS_ENCRYPTION_BODY')] = $this->setWHMCSCryption(); // ENCRYPT_FILE - $this->fileContentStatic[$this->hhh . 'WHMCS_ENCRYPT_FILE' - . $this->hhh] - = PHP_EOL . $this->_t(3) . "whmcs.php"; + $this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')] + = PHP_EOL . Indent::_(3) . "whmcs.php"; } // get component name - $component = Config::get('component_code_name'); + $component = CFactory::_('Config')->component_code_name; // set the getCryptKey function to the helper class $function = array(); // start building the getCryptKey function/class method - $function[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $function[] = $this->_t(1) . " * Get The Encryption Keys"; - $function[] = $this->_t(1) . " *"; - $function[] = $this->_t(1) + $function[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $function[] = Indent::_(1) . " * Get The Encryption Keys"; + $function[] = Indent::_(1) . " *"; + $function[] = Indent::_(1) . " * @param string \$type The type of key"; - $function[] = $this->_t(1) + $function[] = Indent::_(1) . " * @param string/bool \$default The return value if no key was found"; - $function[] = $this->_t(1) . " *"; - $function[] = $this->_t(1) . " * @return string On success"; - $function[] = $this->_t(1) . " *"; - $function[] = $this->_t(1) . " **/"; - $function[] = $this->_t(1) + $function[] = Indent::_(1) . " *"; + $function[] = Indent::_(1) . " * @return string On success"; + $function[] = Indent::_(1) . " *"; + $function[] = Indent::_(1) . " **/"; + $function[] = Indent::_(1) . "public static function getCryptKey(\$type, \$default = false)"; - $function[] = $this->_t(1) . "{"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(1) . "{"; + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get the global params"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$params = JComponentHelper::getParams('com_" . $component . "', true);"; // add the basic option @@ -914,18 +880,18 @@ class Interpretation extends Fields $this->basicFieldModeling )) { - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Basic Encryption Type"; - $function[] = $this->_t(2) . "if ('basic' === \$type)"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) + $function[] = Indent::_(2) . "if ('basic' === \$type)"; + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "\$basic_key = \$params->get('basic_key', \$default);"; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "if (self::checkString(\$basic_key))"; - $function[] = $this->_t(3) . "{"; - $function[] = $this->_t(4) . "return \$basic_key;"; - $function[] = $this->_t(3) . "}"; - $function[] = $this->_t(2) . "}"; + $function[] = Indent::_(3) . "{"; + $function[] = Indent::_(4) . "return \$basic_key;"; + $function[] = Indent::_(3) . "}"; + $function[] = Indent::_(2) . "}"; } // add the medium option if (isset($this->mediumFieldModeling) @@ -933,166 +899,166 @@ class Interpretation extends Fields $this->mediumFieldModeling )) { - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Medium Encryption Type"; - $function[] = $this->_t(2) . "if ('medium' === \$type)"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "if ('medium' === \$type)"; + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " check if medium key is already loaded."; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "if (self::checkString(self::\$mediumCryptKey))"; - $function[] = $this->_t(3) . "{"; - $function[] = $this->_t(4) + $function[] = Indent::_(3) . "{"; + $function[] = Indent::_(4) . "return (self::\$mediumCryptKey !== 'none') ? trim(self::\$mediumCryptKey) : \$default;"; - $function[] = $this->_t(3) . "}"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "}"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get the path to the medium encryption key."; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "\$medium_key_path = \$params->get('medium_key_path', null);"; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "if (self::checkString(\$medium_key_path))"; - $function[] = $this->_t(3) . "{"; - $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "{"; + $function[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " load the key from the file."; - $function[] = $this->_t(4) + $function[] = Indent::_(4) . "if (self::getMediumCryptKey(\$medium_key_path))"; - $function[] = $this->_t(4) . "{"; - $function[] = $this->_t(5) + $function[] = Indent::_(4) . "{"; + $function[] = Indent::_(5) . "return trim(self::\$mediumCryptKey);"; - $function[] = $this->_t(4) . "}"; - $function[] = $this->_t(3) . "}"; - $function[] = $this->_t(2) . "}"; + $function[] = Indent::_(4) . "}"; + $function[] = Indent::_(3) . "}"; + $function[] = Indent::_(2) . "}"; } // add the whmcs option if (isset($this->whmcsFieldModeling) && ArrayHelper::check($this->whmcsFieldModeling) || $this->componentData->add_license) { - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " WHMCS Encryption Type"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "if ('whmcs' === \$type || 'advanced' === \$type)"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "\$key = \$params->get('whmcs_key', \$default);"; - $function[] = $this->_t(3) . "if (self::checkString(\$key))"; - $function[] = $this->_t(3) . "{"; - $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "if (self::checkString(\$key))"; + $function[] = Indent::_(3) . "{"; + $function[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " load the file"; - $function[] = $this->_t(4) + $function[] = Indent::_(4) . "JLoader::import( 'whmcs', JPATH_COMPONENT_ADMINISTRATOR);"; - $function[] = PHP_EOL . $this->_t(4) + $function[] = PHP_EOL . Indent::_(4) . "\$the = new WHMCS(\$key);"; - $function[] = PHP_EOL . $this->_t(4) . "return \$the->_key;"; - $function[] = $this->_t(3) . "}"; - $function[] = $this->_t(2) . "}"; + $function[] = PHP_EOL . Indent::_(4) . "return \$the->_key;"; + $function[] = Indent::_(3) . "}"; + $function[] = Indent::_(2) . "}"; } // end the function - $function[] = PHP_EOL . $this->_t(2) . "return \$default;"; - $function[] = $this->_t(1) . "}"; + $function[] = PHP_EOL . Indent::_(2) . "return \$default;"; + $function[] = Indent::_(1) . "}"; // set the getMediumCryptKey class/method if (isset($this->mediumFieldModeling) && ArrayHelper::check( $this->mediumFieldModeling )) { - $function[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $function[] = $this->_t(1) . " * The Medium Encryption Key"; - $function[] = $this->_t(1) . " *"; - $function[] = $this->_t(1) . " * @var string/bool"; - $function[] = $this->_t(1) . " **/"; - $function[] = $this->_t(1) + $function[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $function[] = Indent::_(1) . " * The Medium Encryption Key"; + $function[] = Indent::_(1) . " *"; + $function[] = Indent::_(1) . " * @var string/bool"; + $function[] = Indent::_(1) . " **/"; + $function[] = Indent::_(1) . "protected static \$mediumCryptKey = false;"; - $function[] = PHP_EOL . $this->_t(1) . "/**"; - $function[] = $this->_t(1) + $function[] = PHP_EOL . Indent::_(1) . "/**"; + $function[] = Indent::_(1) . " * Get The Medium Encryption Key"; - $function[] = $this->_t(1) . " *"; - $function[] = $this->_t(1) + $function[] = Indent::_(1) . " *"; + $function[] = Indent::_(1) . " * @param string \$path The path to the medium crypt key folder"; - $function[] = $this->_t(1) . " *"; - $function[] = $this->_t(1) + $function[] = Indent::_(1) . " *"; + $function[] = Indent::_(1) . " * @return string On success"; - $function[] = $this->_t(1) . " *"; - $function[] = $this->_t(1) . " **/"; - $function[] = $this->_t(1) + $function[] = Indent::_(1) . " *"; + $function[] = Indent::_(1) . " **/"; + $function[] = Indent::_(1) . "public static function getMediumCryptKey(\$path)"; - $function[] = $this->_t(1) . "{"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(1) . "{"; + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Prep the path a little"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$path = '/'. trim(str_replace('//', '/', \$path), '/');"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if folder exist"; - $function[] = $this->_t(2) . "if (!Folder::exists(\$path))"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "if (!Folder::exists(\$path))"; + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Lock key."; - $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "self::\$mediumCryptKey = 'none';"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set the error message."; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "JFactory::getApplication()->enqueueMessage(JText::_('" - . $this->langPrefix + . CFactory::_('Config')->lang_prefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; - $function[] = $this->_t(3) . "return false;"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "return false;"; + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Create FileName and set file path"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$filePath = \$path.'/.'.md5('medium_crypt_key_file');"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if we already have the file set"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "if ((self::\$mediumCryptKey = @file_get_contents(\$filePath)) !== FALSE)"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) . "return true;"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "return true;"; + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Set the key for the first time"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "self::\$mediumCryptKey = self::randomkey(128);"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Open the key file"; - $function[] = $this->_t(2) . "\$fh = @fopen(\$filePath, 'w');"; - $function[] = $this->_t(2) . "if (!is_resource(\$fh))"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "\$fh = @fopen(\$filePath, 'w');"; + $function[] = Indent::_(2) . "if (!is_resource(\$fh))"; + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Lock key."; - $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "self::\$mediumCryptKey = 'none';"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set the error message."; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "JFactory::getApplication()->enqueueMessage(JText::_('" - . $this->langPrefix + . CFactory::_('Config')->lang_prefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; - $function[] = $this->_t(3) . "return false;"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "return false;"; + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Write to the key file"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "if (!fwrite(\$fh, self::\$mediumCryptKey))"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Close key file."; - $function[] = $this->_t(3) . "fclose(\$fh);"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "fclose(\$fh);"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Lock key."; - $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';"; - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "self::\$mediumCryptKey = 'none';"; + $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set the error message."; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "JFactory::getApplication()->enqueueMessage(JText::_('" - . $this->langPrefix + . CFactory::_('Config')->lang_prefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; - $function[] = $this->_t(3) . "return false;"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(3) . "return false;"; + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Close key file."; - $function[] = $this->_t(2) . "fclose(\$fh);"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "fclose(\$fh);"; + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Key is set."; - $function[] = $this->_t(2) . "return true;"; - $function[] = $this->_t(1) . "}"; + $function[] = Indent::_(2) . "return true;"; + $function[] = Indent::_(1) . "}"; } // return the help methods @@ -1172,8 +1138,7 @@ class Interpretation extends Fields $name = explode('.xml', $name)[0]; $target = array('admin' => $name); $this->buildDynamique($target, 'update_server'); - $this->fileContentDynamic[$name][$this->hhh - . 'UPDATE_SERVER_XML' . $this->hhh] + $this->fileContentDynamic[$name][Placefix::_h('UPDATE_SERVER_XML')] = implode(PHP_EOL, $updateXML); // set the Update server file name @@ -1189,24 +1154,23 @@ class Interpretation extends Fields { // UPDATESERVER $updateServer = array(); - $updateServer[] = PHP_EOL . $this->_t(1) . ""; - $updateServer[] = $this->_t(2) + $updateServer[] = PHP_EOL . Indent::_(1) . ""; + $updateServer[] = Indent::_(2) . '' . $this->componentData->update_server_url + . CFactory::_('Config')->component_code_name . '" name="' + . $this->fileContentStatic[Placefix::_h('Component_name')] . '">' . $this->componentData->update_server_url . ''; - $updateServer[] = $this->_t(1) . ''; + $updateServer[] = Indent::_(1) . ''; // return the array to string $updateServer = implode(PHP_EOL, $updateServer); // add update server details to component XML file - $this->fileContentStatic[$this->hhh . 'UPDATESERVER' . $this->hhh] + $this->fileContentStatic[Placefix::_h('UPDATESERVER')] = $updateServer; } else { // add update server details to component XML file - $this->fileContentStatic[$this->hhh . 'UPDATESERVER' . $this->hhh] + $this->fileContentStatic[Placefix::_h('UPDATESERVER')] = ''; } // ensure to update Component version data @@ -1221,14 +1185,14 @@ class Interpretation extends Fields } // update the joomla component table $newJ = array(); - $newJ['id'] = (int) Config::get('component_id'); + $newJ['id'] = (int) CFactory::_('Config')->component_id; $newJ['component_version'] = $this->componentData->component_version; // update the component with the new dynamic SQL $modelJ = ComponentbuilderHelper::getModel('joomla_component'); $modelJ->save($newJ); // <-- to insure the history is also updated // reset the watch here - $this->getHistoryWatch('joomla_component', Config::get('component_id')); + $this->getHistoryWatch('joomla_component', CFactory::_('Config')->component_id); // update the component update table $newU = array(); @@ -1239,7 +1203,7 @@ class Interpretation extends Fields } else { - $newU['joomla_component'] = (int) Config::get('component_id'); + $newU['joomla_component'] = (int) CFactory::_('Config')->component_id; } $newU['version_update'] = json_encode($buket); // update the component with the new dynamic SQL @@ -1297,7 +1261,7 @@ class Interpretation extends Fields '.', '', $this->componentData->old_component_version ) ); - $update_['url'] = $this->setPlaceholders( + $update_['url'] = CFactory::_('Placeholder')->update( $this->lastupdateURL, $paceholders ); } @@ -1328,8 +1292,8 @@ class Interpretation extends Fields // setup SQL if (StringHelper::check($update['mysql'])) { - $update['mysql'] = $this->setPlaceholders( - $update['mysql'], $this->placeholders + $update['mysql'] = CFactory::_('Placeholder')->update( + $update['mysql'], CFactory::_('Placeholder')->active ); } // add dynamic SQL @@ -1363,8 +1327,7 @@ class Interpretation extends Fields $target = array('admin' => $name); $this->buildDynamique($target, 'sql_update', $update['version']); $this->fileContentDynamic[$name . '_' - . $update['version']][$this->hhh . 'UPDATE_VERSION_MYSQL' - . $this->hhh] + . $update['version']][Placefix::_h('UPDATE_VERSION_MYSQL')] = $update['mysql']; } elseif (isset($update['url']) @@ -1379,7 +1342,7 @@ class Interpretation extends Fields && $this->componentData->update_server_target != 3) { // we set the defaults - $u_element = 'com_' . Config::get('component_code_name'); + $u_element = 'com_' . CFactory::_('Config')->component_code_name; $u_server_type = 'component'; $u_state = 'stable'; $u_target_version = '3.*'; @@ -1399,27 +1362,23 @@ class Interpretation extends Fields ? $update['update_client'] : $u_client; } // build update xml - $updateXML[] = $this->_t(1) . ""; - $updateXML[] = $this->_t(2) . "" - . $this->fileContentStatic[$this->hhh . 'Component_name' - . $this->hhh] . ""; - $updateXML[] = $this->_t(2) . "" - . $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' - . $this->hhh] . ""; - $updateXML[] = $this->_t(2) . "$u_element"; - $updateXML[] = $this->_t(2) . "$u_server_type"; + $updateXML[] = Indent::_(1) . ""; + $updateXML[] = Indent::_(2) . "" + . $this->fileContentStatic[Placefix::_h('Component_name')] . ""; + $updateXML[] = Indent::_(2) . "" + . $this->fileContentStatic[Placefix::_h('SHORT_DESCRIPTION')] . ""; + $updateXML[] = Indent::_(2) . "$u_element"; + $updateXML[] = Indent::_(2) . "$u_server_type"; // check if we should add the target client value if ($u_client) { - $updateXML[] = $this->_t(2) . "$u_client"; + $updateXML[] = Indent::_(2) . "$u_client"; } - $updateXML[] = $this->_t(2) . "" . $update['version'] + $updateXML[] = Indent::_(2) . "" . $update['version'] . ""; - $updateXML[] = $this->_t(2) . '' . $this->fileContentStatic[$this->hhh - . 'AUTHORWEBSITE' . $this->hhh] . ''; - $updateXML[] = $this->_t(2) . ""; + $updateXML[] = Indent::_(2) . '' . $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . ''; + $updateXML[] = Indent::_(2) . ""; if (!isset($update['url']) || !StringHelper::check( $update['url'] @@ -1427,22 +1386,21 @@ class Interpretation extends Fields { $update['url'] = 'http://domain.com/demo.zip'; } - $updateXML[] = $this->_t(3) + $updateXML[] = Indent::_(3) . '' . $update['url'] . ''; - $updateXML[] = $this->_t(2) . ""; - $updateXML[] = $this->_t(2) . ""; - $updateXML[] = $this->_t(3) . "$u_state"; - $updateXML[] = $this->_t(2) . ""; - $updateXML[] = $this->_t(2) . "" - . $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] + $updateXML[] = Indent::_(2) . ""; + $updateXML[] = Indent::_(2) . ""; + $updateXML[] = Indent::_(3) . "$u_state"; + $updateXML[] = Indent::_(2) . ""; + $updateXML[] = Indent::_(2) . "" + . $this->fileContentStatic[Placefix::_h('AUTHOR')] . ""; - $updateXML[] = $this->_t(2) . "" - . $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' - . $this->hhh] . ""; - $updateXML[] = $this->_t(2) + $updateXML[] = Indent::_(2) . "" + . $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . ""; + $updateXML[] = Indent::_(2) . ''; - $updateXML[] = $this->_t(1) . ""; + $updateXML[] = Indent::_(1) . ""; } } @@ -1454,13 +1412,13 @@ class Interpretation extends Fields public function noHelp() { $help = array(); - $help[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $help[] = $this->_t(1) . " * Can be used to build help urls."; - $help[] = $this->_t(1) . " **/"; - $help[] = $this->_t(1) . "public static function getHelpUrl(\$view)"; - $help[] = $this->_t(1) . "{"; - $help[] = $this->_t(2) . "return false;"; - $help[] = $this->_t(1) . "}"; + $help[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $help[] = Indent::_(1) . " * Can be used to build help urls."; + $help[] = Indent::_(1) . " **/"; + $help[] = Indent::_(1) . "public static function getHelpUrl(\$view)"; + $help[] = Indent::_(1) . "{"; + $help[] = Indent::_(2) . "return false;"; + $help[] = Indent::_(1) . "}"; // return the no help method return implode(PHP_EOL, $help); @@ -1479,14 +1437,13 @@ class Interpretation extends Fields if ($admindone && $sitedone) { // HELP - $this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELP')] = $this->setHelp(1); // HELP_SITE - $this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELP_SITE')] = $this->setHelp(2); // to make sure the file is updated TODO - $this->fileContentDynamic['help'][$this->hhh . 'BLABLA' - . $this->hhh] + $this->fileContentDynamic['help'][Placefix::_h('BLABLA')] = 'blabla'; return true; @@ -1505,91 +1462,91 @@ class Interpretation extends Fields $target = 'site_view'; } $help = array(); - $help[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $help[] = $this->_t(1) . " * Load the Component Help URLs."; - $help[] = $this->_t(1) . " **/"; - $help[] = $this->_t(1) . "public static function getHelpUrl(\$view)"; - $help[] = $this->_t(1) . "{"; - $help[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $help[] = $this->_t(2) . "\$groups = \$user->get('groups');"; - $help[] = $this->_t(2) . "\$db = JFactory::getDbo();"; - $help[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; - $help[] = $this->_t(2) + $help[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $help[] = Indent::_(1) . " * Load the Component Help URLs."; + $help[] = Indent::_(1) . " **/"; + $help[] = Indent::_(1) . "public static function getHelpUrl(\$view)"; + $help[] = Indent::_(1) . "{"; + $help[] = Indent::_(2) . "\$user = JFactory::getUser();"; + $help[] = Indent::_(2) . "\$groups = \$user->get('groups');"; + $help[] = Indent::_(2) . "\$db = JFactory::getDbo();"; + $help[] = Indent::_(2) . "\$query = \$db->getQuery(true);"; + $help[] = Indent::_(2) . "\$query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url'));"; - $help[] = $this->_t(2) . "\$query->from('#__" . Config::get('component_code_name') + $help[] = Indent::_(2) . "\$query->from('#__" . CFactory::_('Config')->component_code_name . "_help_document AS a');"; - $help[] = $this->_t(2) . "\$query->where('a." . $target + $help[] = Indent::_(2) . "\$query->where('a." . $target . " = '.\$db->quote(\$view));"; - $help[] = $this->_t(2) . "\$query->where('a.location = " + $help[] = Indent::_(2) . "\$query->where('a.location = " . (int) $location . "');"; - $help[] = $this->_t(2) . "\$query->where('a.published = 1');"; - $help[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $help[] = $this->_t(2) . "\$db->execute();"; - $help[] = $this->_t(2) . "if(\$db->getNumRows())"; - $help[] = $this->_t(2) . "{"; - $help[] = $this->_t(3) . "\$helps = \$db->loadObjectList();"; - $help[] = $this->_t(3) . "if (self::checkArray(\$helps))"; - $help[] = $this->_t(3) . "{"; - $help[] = $this->_t(4) . "foreach (\$helps as \$nr => \$help)"; - $help[] = $this->_t(4) . "{"; - $help[] = $this->_t(5) . "if (\$help->target == 1)"; - $help[] = $this->_t(5) . "{"; - $help[] = $this->_t(6) + $help[] = Indent::_(2) . "\$query->where('a.published = 1');"; + $help[] = Indent::_(2) . "\$db->setQuery(\$query);"; + $help[] = Indent::_(2) . "\$db->execute();"; + $help[] = Indent::_(2) . "if(\$db->getNumRows())"; + $help[] = Indent::_(2) . "{"; + $help[] = Indent::_(3) . "\$helps = \$db->loadObjectList();"; + $help[] = Indent::_(3) . "if (self::checkArray(\$helps))"; + $help[] = Indent::_(3) . "{"; + $help[] = Indent::_(4) . "foreach (\$helps as \$nr => \$help)"; + $help[] = Indent::_(4) . "{"; + $help[] = Indent::_(5) . "if (\$help->target == 1)"; + $help[] = Indent::_(5) . "{"; + $help[] = Indent::_(6) . "\$targetgroups = json_decode(\$help->groups, true);"; - $help[] = $this->_t(6) + $help[] = Indent::_(6) . "if (!array_intersect(\$targetgroups, \$groups))"; - $help[] = $this->_t(6) . "{"; - $help[] = $this->_t(7) . "//" . $this->setLine(__LINE__) + $help[] = Indent::_(6) . "{"; + $help[] = Indent::_(7) . "//" . Line::_(__Line__, __Class__) . " if user not in those target groups then remove the item"; - $help[] = $this->_t(7) . "unset(\$helps[\$nr]);"; - $help[] = $this->_t(7) . "continue;"; - $help[] = $this->_t(6) . "}"; - $help[] = $this->_t(5) . "}"; - $help[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $help[] = Indent::_(7) . "unset(\$helps[\$nr]);"; + $help[] = Indent::_(7) . "continue;"; + $help[] = Indent::_(6) . "}"; + $help[] = Indent::_(5) . "}"; + $help[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " set the return type"; - $help[] = $this->_t(5) . "switch (\$help->type)"; - $help[] = $this->_t(5) . "{"; - $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__) + $help[] = Indent::_(5) . "switch (\$help->type)"; + $help[] = Indent::_(5) . "{"; + $help[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) . " set joomla article"; - $help[] = $this->_t(6) . "case 1:"; - $help[] = $this->_t(7) + $help[] = Indent::_(6) . "case 1:"; + $help[] = Indent::_(7) . "return self::loadArticleLink(\$help->article);"; - $help[] = $this->_t(7) . "break;"; - $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__) + $help[] = Indent::_(7) . "break;"; + $help[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) . " set help text"; - $help[] = $this->_t(6) . "case 2:"; - $help[] = $this->_t(7) . "return self::loadHelpTextLink(\$help->id);"; - $help[] = $this->_t(7) . "break;"; - $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " set Link"; - $help[] = $this->_t(6) . "case 3:"; - $help[] = $this->_t(7) . "return \$help->url;"; - $help[] = $this->_t(7) . "break;"; - $help[] = $this->_t(5) . "}"; - $help[] = $this->_t(4) . "}"; - $help[] = $this->_t(3) . "}"; - $help[] = $this->_t(2) . "}"; - $help[] = $this->_t(2) . "return false;"; - $help[] = $this->_t(1) . "}"; - $help[] = PHP_EOL . $this->_t(1) . "/**"; - $help[] = $this->_t(1) . " * Get the Article Link."; - $help[] = $this->_t(1) . " **/"; - $help[] = $this->_t(1) + $help[] = Indent::_(6) . "case 2:"; + $help[] = Indent::_(7) . "return self::loadHelpTextLink(\$help->id);"; + $help[] = Indent::_(7) . "break;"; + $help[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) . " set Link"; + $help[] = Indent::_(6) . "case 3:"; + $help[] = Indent::_(7) . "return \$help->url;"; + $help[] = Indent::_(7) . "break;"; + $help[] = Indent::_(5) . "}"; + $help[] = Indent::_(4) . "}"; + $help[] = Indent::_(3) . "}"; + $help[] = Indent::_(2) . "}"; + $help[] = Indent::_(2) . "return false;"; + $help[] = Indent::_(1) . "}"; + $help[] = PHP_EOL . Indent::_(1) . "/**"; + $help[] = Indent::_(1) . " * Get the Article Link."; + $help[] = Indent::_(1) . " **/"; + $help[] = Indent::_(1) . "protected static function loadArticleLink(\$id)"; - $help[] = $this->_t(1) . "{"; - $help[] = $this->_t(2) + $help[] = Indent::_(1) . "{"; + $help[] = Indent::_(2) . "return JURI::root().'index.php?option=com_content&view=article&id='.\$id.'&tmpl=component&layout=modal';"; - $help[] = $this->_t(1) . "}"; - $help[] = PHP_EOL . $this->_t(1) . "/**"; - $help[] = $this->_t(1) . " * Get the Help Text Link."; - $help[] = $this->_t(1) . " **/"; - $help[] = $this->_t(1) + $help[] = Indent::_(1) . "}"; + $help[] = PHP_EOL . Indent::_(1) . "/**"; + $help[] = Indent::_(1) . " * Get the Help Text Link."; + $help[] = Indent::_(1) . " **/"; + $help[] = Indent::_(1) . "protected static function loadHelpTextLink(\$id)"; - $help[] = $this->_t(1) . "{"; - $help[] = $this->_t(2) . "\$token = JSession::getFormToken();"; - $help[] = $this->_t(2) . "return 'index.php?option=com_" - . Config::get('component_code_name') + $help[] = Indent::_(1) . "{"; + $help[] = Indent::_(2) . "\$token = JSession::getFormToken();"; + $help[] = Indent::_(2) . "return 'index.php?option=com_" + . CFactory::_('Config')->component_code_name . "&task=help.getText&id=' . (int) \$id . '&token=' . \$token;"; - $help[] = $this->_t(1) . "}"; + $help[] = Indent::_(1) . "}"; // return the help methods return implode(PHP_EOL, $help); @@ -1600,286 +1557,285 @@ class Interpretation extends Fields if ($this->addEximport) { // we use the company name set in the GUI - $company_name = $this->fileContentStatic[$this->hhh . 'COMPANYNAME' - . $this->hhh]; + $company_name = $this->fileContentStatic[Placefix::_h('COMPANYNAME')]; // start building the xml function $exel = array(); - $exel[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $exel[] = $this->_t(1) . "* Prepares the xml document"; - $exel[] = $this->_t(1) . "*/"; - $exel[] = $this->_t(1) + $exel[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $exel[] = Indent::_(1) . "* Prepares the xml document"; + $exel[] = Indent::_(1) . "*/"; + $exel[] = Indent::_(1) . "public static function xls(\$rows, \$fileName = null, \$title = null, \$subjectTab = null, \$creator = '$company_name', \$description = null, \$category = null,\$keywords = null, \$modified = null)"; - $exel[] = $this->_t(1) . "{"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(1) . "{"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set the user"; - $exel[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "\$user = JFactory::getUser();"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set fileName if not set"; - $exel[] = $this->_t(2) . "if (!\$fileName)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(2) . "if (!\$fileName)"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');"; - $exel[] = $this->_t(2) . "}"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "}"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set modified if not set"; - $exel[] = $this->_t(2) . "if (!\$modified)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) . "\$modified = \$user->name;"; - $exel[] = $this->_t(2) . "}"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "if (!\$modified)"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$modified = \$user->name;"; + $exel[] = Indent::_(2) . "}"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set title if not set"; - $exel[] = $this->_t(2) . "if (!\$title)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) . "\$title = 'Book1';"; - $exel[] = $this->_t(2) . "}"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "if (!\$title)"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$title = 'Book1';"; + $exel[] = Indent::_(2) . "}"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set tab name if not set"; - $exel[] = $this->_t(2) . "if (!\$subjectTab)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) . "\$subjectTab = 'Sheet1';"; - $exel[] = $this->_t(2) . "}"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "if (!\$subjectTab)"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$subjectTab = 'Sheet1';"; + $exel[] = Indent::_(2) . "}"; + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " make sure we have the composer classes loaded"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "self::composerAutoload('phpspreadsheet');"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Create new Spreadsheet object"; - $exel[] = $this->_t(2) . "\$spreadsheet = new Spreadsheet();"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "\$spreadsheet = new Spreadsheet();"; + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Set document properties"; - $exel[] = $this->_t(2) . "\$spreadsheet->getProperties()"; - $exel[] = $this->_t(3) . "->setCreator(\$creator)"; - $exel[] = $this->_t(3) . "->setCompany('$company_name')"; - $exel[] = $this->_t(3) . "->setLastModifiedBy(\$modified)"; - $exel[] = $this->_t(3) . "->setTitle(\$title)"; - $exel[] = $this->_t(3) . "->setSubject(\$subjectTab);"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "\$spreadsheet->getProperties()"; + $exel[] = Indent::_(3) . "->setCreator(\$creator)"; + $exel[] = Indent::_(3) . "->setCompany('$company_name')"; + $exel[] = Indent::_(3) . "->setLastModifiedBy(\$modified)"; + $exel[] = Indent::_(3) . "->setTitle(\$title)"; + $exel[] = Indent::_(3) . "->setSubject(\$subjectTab);"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " The file type"; - $exel[] = $this->_t(2) . "\$file_type = 'Xls';"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "\$file_type = 'Xls';"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set description"; - $exel[] = $this->_t(2) . "if (\$description)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(2) . "if (\$description)"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$spreadsheet->getProperties()->setDescription(\$description);"; - $exel[] = $this->_t(2) . "}"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "}"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set keywords"; - $exel[] = $this->_t(2) . "if (\$keywords)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(2) . "if (\$keywords)"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$spreadsheet->getProperties()->setKeywords(\$keywords);"; - $exel[] = $this->_t(2) . "}"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "}"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set category"; - $exel[] = $this->_t(2) . "if (\$category)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(2) . "if (\$category)"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$spreadsheet->getProperties()->setCategory(\$category);"; - $exel[] = $this->_t(2) . "}"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "}"; + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Some styles"; - $exel[] = $this->_t(2) . "\$headerStyles = array("; - $exel[] = $this->_t(3) . "'font' => array("; - $exel[] = $this->_t(4) . "'bold' => true,"; - $exel[] = $this->_t(4) . "'color' => array('rgb' => '1171A3'),"; - $exel[] = $this->_t(4) . "'size' => 12,"; - $exel[] = $this->_t(4) . "'name' => 'Verdana'"; - $exel[] = $this->_t(2) . "));"; - $exel[] = $this->_t(2) . "\$sideStyles = array("; - $exel[] = $this->_t(3) . "'font' => array("; - $exel[] = $this->_t(4) . "'bold' => true,"; - $exel[] = $this->_t(4) . "'color' => array('rgb' => '444444'),"; - $exel[] = $this->_t(4) . "'size' => 11,"; - $exel[] = $this->_t(4) . "'name' => 'Verdana'"; - $exel[] = $this->_t(2) . "));"; - $exel[] = $this->_t(2) . "\$normalStyles = array("; - $exel[] = $this->_t(3) . "'font' => array("; - $exel[] = $this->_t(4) . "'color' => array('rgb' => '444444'),"; - $exel[] = $this->_t(4) . "'size' => 11,"; - $exel[] = $this->_t(4) . "'name' => 'Verdana'"; - $exel[] = $this->_t(2) . "));"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "\$headerStyles = array("; + $exel[] = Indent::_(3) . "'font' => array("; + $exel[] = Indent::_(4) . "'bold' => true,"; + $exel[] = Indent::_(4) . "'color' => array('rgb' => '1171A3'),"; + $exel[] = Indent::_(4) . "'size' => 12,"; + $exel[] = Indent::_(4) . "'name' => 'Verdana'"; + $exel[] = Indent::_(2) . "));"; + $exel[] = Indent::_(2) . "\$sideStyles = array("; + $exel[] = Indent::_(3) . "'font' => array("; + $exel[] = Indent::_(4) . "'bold' => true,"; + $exel[] = Indent::_(4) . "'color' => array('rgb' => '444444'),"; + $exel[] = Indent::_(4) . "'size' => 11,"; + $exel[] = Indent::_(4) . "'name' => 'Verdana'"; + $exel[] = Indent::_(2) . "));"; + $exel[] = Indent::_(2) . "\$normalStyles = array("; + $exel[] = Indent::_(3) . "'font' => array("; + $exel[] = Indent::_(4) . "'color' => array('rgb' => '444444'),"; + $exel[] = Indent::_(4) . "'size' => 11,"; + $exel[] = Indent::_(4) . "'name' => 'Verdana'"; + $exel[] = Indent::_(2) . "));"; + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Add some data"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "if ((\$size = self::checkArray(\$rows)) !== false)"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) . "\$i = 1;"; - $exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "\$i = 1;"; + $exel[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Based on data size we adapt the behaviour."; - $exel[] = $this->_t(3) . "\$xls_mode = 1;"; - $exel[] = $this->_t(3) . "if (\$size > 3000)"; - $exel[] = $this->_t(3) . "{"; - $exel[] = $this->_t(4) . "\$xls_mode = 3;"; - $exel[] = $this->_t(4) . "\$file_type = 'Csv';"; - $exel[] = $this->_t(3) . "}"; - $exel[] = $this->_t(3) . "elseif (\$size > 2000)"; - $exel[] = $this->_t(3) . "{"; - $exel[] = $this->_t(4) . "\$xls_mode = 2;"; - $exel[] = $this->_t(3) . "}"; - $exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(3) . "\$xls_mode = 1;"; + $exel[] = Indent::_(3) . "if (\$size > 3000)"; + $exel[] = Indent::_(3) . "{"; + $exel[] = Indent::_(4) . "\$xls_mode = 3;"; + $exel[] = Indent::_(4) . "\$file_type = 'Csv';"; + $exel[] = Indent::_(3) . "}"; + $exel[] = Indent::_(3) . "elseif (\$size > 2000)"; + $exel[] = Indent::_(3) . "{"; + $exel[] = Indent::_(4) . "\$xls_mode = 2;"; + $exel[] = Indent::_(3) . "}"; + $exel[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set active sheet and get it."; - $exel[] = $this->_t(3) + $exel[] = Indent::_(3) . "\$active_sheet = \$spreadsheet->setActiveSheetIndex(0);"; - $exel[] = $this->_t(3) . "foreach (\$rows as \$array)"; - $exel[] = $this->_t(3) . "{"; - $exel[] = $this->_t(4) . "\$a = 'A';"; - $exel[] = $this->_t(4) . "foreach (\$array as \$value)"; - $exel[] = $this->_t(4) . "{"; - $exel[] = $this->_t(5) + $exel[] = Indent::_(3) . "foreach (\$rows as \$array)"; + $exel[] = Indent::_(3) . "{"; + $exel[] = Indent::_(4) . "\$a = 'A';"; + $exel[] = Indent::_(4) . "foreach (\$array as \$value)"; + $exel[] = Indent::_(4) . "{"; + $exel[] = Indent::_(5) . "\$active_sheet->setCellValue(\$a.\$i, \$value);"; - $exel[] = $this->_t(5) . "if (\$xls_mode != 3)"; - $exel[] = $this->_t(5) . "{"; - $exel[] = $this->_t(6) . "if (\$i == 1)"; - $exel[] = $this->_t(6) . "{"; - $exel[] = $this->_t(7) + $exel[] = Indent::_(5) . "if (\$xls_mode != 3)"; + $exel[] = Indent::_(5) . "{"; + $exel[] = Indent::_(6) . "if (\$i == 1)"; + $exel[] = Indent::_(6) . "{"; + $exel[] = Indent::_(7) . "\$active_sheet->getColumnDimension(\$a)->setAutoSize(true);"; - $exel[] = $this->_t(7) + $exel[] = Indent::_(7) . "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);"; - $exel[] = $this->_t(7) + $exel[] = Indent::_(7) . "\$active_sheet->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);"; - $exel[] = $this->_t(6) . "}"; - $exel[] = $this->_t(6) . "elseif (\$a === 'A')"; - $exel[] = $this->_t(6) . "{"; - $exel[] = $this->_t(7) + $exel[] = Indent::_(6) . "}"; + $exel[] = Indent::_(6) . "elseif (\$a === 'A')"; + $exel[] = Indent::_(6) . "{"; + $exel[] = Indent::_(7) . "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);"; - $exel[] = $this->_t(6) . "}"; - $exel[] = $this->_t(6) . "elseif (\$xls_mode == 1)"; - $exel[] = $this->_t(6) . "{"; - $exel[] = $this->_t(7) + $exel[] = Indent::_(6) . "}"; + $exel[] = Indent::_(6) . "elseif (\$xls_mode == 1)"; + $exel[] = Indent::_(6) . "{"; + $exel[] = Indent::_(7) . "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);"; - $exel[] = $this->_t(6) . "}"; - $exel[] = $this->_t(5) . "}"; - $exel[] = $this->_t(5) . "\$a++;"; - $exel[] = $this->_t(4) . "}"; - $exel[] = $this->_t(4) . "\$i++;"; - $exel[] = $this->_t(3) . "}"; - $exel[] = $this->_t(2) . "}"; - $exel[] = $this->_t(2) . "else"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) . "return false;"; - $exel[] = $this->_t(2) . "}"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(6) . "}"; + $exel[] = Indent::_(5) . "}"; + $exel[] = Indent::_(5) . "\$a++;"; + $exel[] = Indent::_(4) . "}"; + $exel[] = Indent::_(4) . "\$i++;"; + $exel[] = Indent::_(3) . "}"; + $exel[] = Indent::_(2) . "}"; + $exel[] = Indent::_(2) . "else"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "return false;"; + $exel[] = Indent::_(2) . "}"; + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Rename worksheet"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "\$spreadsheet->getActiveSheet()->setTitle(\$subjectTab);"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Set active sheet index to the first sheet, so Excel opens this as the first sheet"; - $exel[] = $this->_t(2) . "\$spreadsheet->setActiveSheetIndex(0);"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "\$spreadsheet->setActiveSheetIndex(0);"; + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Redirect output to a client's web browser (Excel5)"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "header('Content-Type: application/vnd.ms-excel');"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "header('Content-Disposition: attachment;filename=\"' . \$fileName . '.' . strtolower(\$file_type) .'\"');"; - $exel[] = $this->_t(2) . "header('Cache-Control: max-age=0');"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "header('Cache-Control: max-age=0');"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " If you're serving to IE 9, then the following may be needed"; - $exel[] = $this->_t(2) . "header('Cache-Control: max-age=1');"; - $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "header('Cache-Control: max-age=1');"; + $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " If you're serving to IE over SSL, then the following may be needed"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); //" - . $this->setLine(__LINE__) . " Date in the past"; - $exel[] = $this->_t(2) + . Line::_(__Line__, __Class__) . " Date in the past"; + $exel[] = Indent::_(2) . "header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); //" - . $this->setLine(__LINE__) . " always modified"; - $exel[] = $this->_t(2) + . Line::_(__Line__, __Class__) . " always modified"; + $exel[] = Indent::_(2) . "header ('Cache-Control: cache, must-revalidate'); //" - . $this->setLine(__LINE__) . " HTTP/1.1"; - $exel[] = $this->_t(2) . "header ('Pragma: public'); //" - . $this->setLine(__LINE__) . " HTTP/1.0"; - $exel[] = PHP_EOL . $this->_t(2) + . Line::_(__Line__, __Class__) . " HTTP/1.1"; + $exel[] = Indent::_(2) . "header ('Pragma: public'); //" + . Line::_(__Line__, __Class__) . " HTTP/1.0"; + $exel[] = PHP_EOL . Indent::_(2) . "\$writer = IOFactory::createWriter(\$spreadsheet, \$file_type);"; - $exel[] = $this->_t(2) . "\$writer->save('php://output');"; - $exel[] = $this->_t(2) . "jexit();"; - $exel[] = $this->_t(1) . "}"; - $exel[] = PHP_EOL . $this->_t(1) . "/**"; - $exel[] = $this->_t(1) . "* Get CSV Headers"; - $exel[] = $this->_t(1) . "*/"; - $exel[] = $this->_t(1) + $exel[] = Indent::_(2) . "\$writer->save('php://output');"; + $exel[] = Indent::_(2) . "jexit();"; + $exel[] = Indent::_(1) . "}"; + $exel[] = PHP_EOL . Indent::_(1) . "/**"; + $exel[] = Indent::_(1) . "* Get CSV Headers"; + $exel[] = Indent::_(1) . "*/"; + $exel[] = Indent::_(1) . "public static function getFileHeaders(\$dataType)"; - $exel[] = $this->_t(1) . "{"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(1) . "{"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " make sure we have the composer classes loaded"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "self::composerAutoload('phpspreadsheet');"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get session object"; - $exel[] = $this->_t(2) . "\$session = JFactory::getSession();"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "\$session = JFactory::getSession();"; + $exel[] = Indent::_(2) . "\$package = \$session->get('package', null);"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "\$package = json_decode(\$package, true);"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set the headers"; - $exel[] = $this->_t(2) . "if(isset(\$package['dir']))"; - $exel[] = $this->_t(2) . "{"; - $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "if(isset(\$package['dir']))"; + $exel[] = Indent::_(2) . "{"; + $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " only load first three rows"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(3) . "\$chunkFilter = new PhpOffice\PhpSpreadsheet\Reader\chunkReadFilter(2,1);"; - $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " identify the file type"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(3) . "\$inputFileType = IOFactory::identify(\$package['dir']);"; - $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " create the reader for this file type"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(3) . "\$excelReader = IOFactory::createReader(\$inputFileType);"; - $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " load the limiting filter"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(3) . "\$excelReader->setReadFilter(\$chunkFilter);"; - $exel[] = $this->_t(3) . "\$excelReader->setReadDataOnly(true);"; - $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(3) . "\$excelReader->setReadDataOnly(true);"; + $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " load the rows (only first three)"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(3) . "\$excelObj = \$excelReader->load(\$package['dir']);"; - $exel[] = $this->_t(3) . "\$headers = array();"; - $exel[] = $this->_t(3) + $exel[] = Indent::_(3) . "\$headers = array();"; + $exel[] = Indent::_(3) . "foreach (\$excelObj->getActiveSheet()->getRowIterator() as \$row)"; - $exel[] = $this->_t(3) . "{"; - $exel[] = $this->_t(4) . "if(\$row->getRowIndex() == 1)"; - $exel[] = $this->_t(4) . "{"; - $exel[] = $this->_t(5) + $exel[] = Indent::_(3) . "{"; + $exel[] = Indent::_(4) . "if(\$row->getRowIndex() == 1)"; + $exel[] = Indent::_(4) . "{"; + $exel[] = Indent::_(5) . "\$cellIterator = \$row->getCellIterator();"; - $exel[] = $this->_t(5) + $exel[] = Indent::_(5) . "\$cellIterator->setIterateOnlyExistingCells(false);"; - $exel[] = $this->_t(5) . "foreach (\$cellIterator as \$cell)"; - $exel[] = $this->_t(5) . "{"; - $exel[] = $this->_t(6) . "if (!is_null(\$cell))"; - $exel[] = $this->_t(6) . "{"; - $exel[] = $this->_t(7) + $exel[] = Indent::_(5) . "foreach (\$cellIterator as \$cell)"; + $exel[] = Indent::_(5) . "{"; + $exel[] = Indent::_(6) . "if (!is_null(\$cell))"; + $exel[] = Indent::_(6) . "{"; + $exel[] = Indent::_(7) . "\$headers[\$cell->getColumn()] = \$cell->getValue();"; - $exel[] = $this->_t(6) . "}"; - $exel[] = $this->_t(5) . "}"; - $exel[] = $this->_t(5) . "\$excelObj->disconnectWorksheets();"; - $exel[] = $this->_t(5) . "unset(\$excelObj);"; - $exel[] = $this->_t(5) . "break;"; - $exel[] = $this->_t(4) . "}"; - $exel[] = $this->_t(3) . "}"; - $exel[] = $this->_t(3) . "return \$headers;"; - $exel[] = $this->_t(2) . "}"; - $exel[] = $this->_t(2) . "return false;"; - $exel[] = $this->_t(1) . "}"; - $exel[] = PHP_EOL . $this->_t(1) . "/**"; - $exel[] = $this->_t(1) + $exel[] = Indent::_(6) . "}"; + $exel[] = Indent::_(5) . "}"; + $exel[] = Indent::_(5) . "\$excelObj->disconnectWorksheets();"; + $exel[] = Indent::_(5) . "unset(\$excelObj);"; + $exel[] = Indent::_(5) . "break;"; + $exel[] = Indent::_(4) . "}"; + $exel[] = Indent::_(3) . "}"; + $exel[] = Indent::_(3) . "return \$headers;"; + $exel[] = Indent::_(2) . "}"; + $exel[] = Indent::_(2) . "return false;"; + $exel[] = Indent::_(1) . "}"; + $exel[] = PHP_EOL . Indent::_(1) . "/**"; + $exel[] = Indent::_(1) . "* Load the Composer Vendor phpspreadsheet"; - $exel[] = $this->_t(1) . "*/"; - $exel[] = $this->_t(1) + $exel[] = Indent::_(1) . "*/"; + $exel[] = Indent::_(1) . "protected static function composephpspreadsheet()"; - $exel[] = $this->_t(1) . "{"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(1) . "{"; + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " load the autoloader for phpspreadsheet"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "require_once JPATH_SITE . '/libraries/phpspreadsheet/vendor/autoload.php';"; - $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " do not load again"; - $exel[] = $this->_t(2) + $exel[] = Indent::_(2) . "self::\$composer['phpspreadsheet'] = true;"; - $exel[] = PHP_EOL . $this->_t(2) . "return true;"; - $exel[] = $this->_t(1) . "}"; + $exel[] = PHP_EOL . Indent::_(2) . "return true;"; + $exel[] = Indent::_(1) . "}"; // return the help methods return implode(PHP_EOL, $exel); @@ -1893,320 +1849,320 @@ class Interpretation extends Fields if ($add) { $method = array(); - $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $method[] = $this->_t(1) . " * Greate user and update given table"; - $method[] = $this->_t(1) . " *"; - $method[] = $this->_t(1) + $method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $method[] = Indent::_(1) . " * Greate user and update given table"; + $method[] = Indent::_(1) . " *"; + $method[] = Indent::_(1) . " * @param array \$credentials Array('name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string)"; - $method[] = $this->_t(1) . " * @param int \$autologin"; - $method[] = $this->_t(1) + $method[] = Indent::_(1) . " * @param int \$autologin"; + $method[] = Indent::_(1) . " * @param array \$params Array('useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int)"; - $method[] = $this->_t(1) + $method[] = Indent::_(1) . " * @param array \$mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser"; - $method[] = $this->_t(1) . " *"; - $method[] = $this->_t(1) + $method[] = Indent::_(1) . " *"; + $method[] = Indent::_(1) . " * @return int|Error User ID on success, or an error."; - $method[] = $this->_t(1) . " */"; - $method[] = $this->_t(1) + $method[] = Indent::_(1) . " */"; + $method[] = Indent::_(1) . "public static function createUser(\$credentials, \$autologin = 0,"; - $method[] = $this->_t(2) . "\$params = array("; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "\$params = array("; + $method[] = Indent::_(3) . "'useractivation' => 0, 'sendpassword' => 1"; - $method[] = $this->_t(2) . "), \$mode = 1"; - $method[] = $this->_t(1) . ")"; - $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "), \$mode = 1"; + $method[] = Indent::_(1) . ")"; + $method[] = Indent::_(1) . "{"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Override mode"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "if (\$mode == 2 && method_exists(__CLASS__, 'registerUser'))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Update params"; - $method[] = $this->_t(3) . "\$params['autologin'] = \$autologin;"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "\$params['autologin'] = \$autologin;"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Now Register User"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "return self::registerUser(\$credentials, \$params);"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "elseif (\$mode == 2)"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "elseif (\$mode == 2)"; + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Fallback to Site Registrations"; - $method[] = $this->_t(3) . "\$mode = 1;"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "\$mode = 1;"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " load the user component language files if there is an error."; - $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();"; - $method[] = $this->_t(2) . "\$extension = 'com_users';"; - $method[] = $this->_t(2) . "\$base_dir = JPATH_SITE;"; - $method[] = $this->_t(2) . "\$language_tag = '" . Config::get('lang_tag', 'en-GB') + $method[] = Indent::_(2) . "\$lang = JFactory::getLanguage();"; + $method[] = Indent::_(2) . "\$extension = 'com_users';"; + $method[] = Indent::_(2) . "\$base_dir = JPATH_SITE;"; + $method[] = Indent::_(2) . "\$language_tag = '" . CFactory::_('Config')->get('lang_tag', 'en-GB') . "';"; - $method[] = $this->_t(2) . "\$reload = true;"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "\$reload = true;"; + $method[] = Indent::_(2) . "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Load the correct user model."; - $method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine( - __LINE__ + $method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_( + __LINE__,__CLASS__ ) . " 1 = Site Registrations"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Load the user site-registration model"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$model = self::getModel('registration', \$base_dir . '/components/' . \$extension, 'Users');"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__) . " 0 = Admin Registration"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Load the backend-user model"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/' . \$extension, 'Users');"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if we have params/config"; - $method[] = $this->_t(2) . "if (self::checkArray(\$params))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "if (self::checkArray(\$params))"; + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Make changes to user config"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "foreach (\$params as \$param => \$set)"; - $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "{"; + $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " If you know of a better path, let me know"; - $method[] = $this->_t(4) + $method[] = Indent::_(4) . "\$params[\$param] = self::setParams(\$extension, \$param, \$set);"; - $method[] = $this->_t(3) . "}"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "}"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Set username to email if not set"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "if (!isset(\$credentials['username']) || !self::checkString(\$credentials['username']))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$credentials['username'] = \$credentials['email'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Lineup new user data array"; - $method[] = $this->_t(2) . "\$data = array("; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "\$data = array("; + $method[] = Indent::_(3) . "'username' => \$credentials['username'],"; - $method[] = $this->_t(3) . "'name' => \$credentials['name'],"; - $method[] = $this->_t(3) . "'block' => 0 );"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "'name' => \$credentials['name'],"; + $method[] = Indent::_(3) . "'block' => 0 );"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Added details based on mode"; - $method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine( - __LINE__ + $method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_( + __LINE__,__CLASS__ ) . " 1 = Site-registration mode"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$data['email1'] = \$credentials['email'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__) . " 0 = Admin-registration mode"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$data['email'] = \$credentials['email'];"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$data['registerDate'] = JFactory::getDate()->toSql();"; - $method[] = $this->_t(2) . "}"; + $method[] = Indent::_(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if password was set"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "if (\$mode == 1 && (!isset(\$credentials['password']) || !isset(\$credentials['password2']) || !self::checkString(\$credentials['password']) || !self::checkString(\$credentials['password2'])))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set random password when empty password was submitted,"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " when using the 1 = site-registration mode"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$credentials['password'] = self::randomkey(8);"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$credentials['password2'] = \$credentials['password'];"; - $method[] = $this->_t(2) . "}"; + $method[] = Indent::_(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Now Add password if set"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "if (isset(\$credentials['password']) && isset(\$credentials['password2']) && self::checkString(\$credentials['password']) && self::checkString(\$credentials['password2']))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "if (\$mode == 1) //" . $this->setLine( - __LINE__ + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "if (\$mode == 1) //" . Line::_( + __LINE__,__CLASS__ ) . " 1 = Site-registration mode"; - $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) + $method[] = Indent::_(3) . "{"; + $method[] = Indent::_(4) . "\$data['password1'] = \$credentials['password'];"; - $method[] = $this->_t(3) . "}"; - $method[] = $this->_t(3) . "else //" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "}"; + $method[] = Indent::_(3) . "else //" . Line::_(__Line__, __Class__) . " 0 = Admin-registration mode"; - $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) + $method[] = Indent::_(3) . "{"; + $method[] = Indent::_(4) . "\$data['password'] = \$credentials['password'];"; - $method[] = $this->_t(3) . "}"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "}"; + $method[] = Indent::_(3) . "\$data['password2'] = \$credentials['password2'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Load the group/s value if set, only for Admin Registration (\$mode == 0)"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "if (\$mode == 0 && isset(\$credentials['groups']) && self::checkArray(\$credentials['groups']))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$data['groups'] = \$credentials['groups'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Create the new user"; - $method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine( - __LINE__ + $method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_( + __LINE__,__CLASS__ ) . " 1 = Site-registration mode"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "\$userId = \$model->register(\$data);"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$userId = \$model->register(\$data);"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__) . " 0 = Admin-registration mode"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "\$model->save(\$data);"; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$model->save(\$data);"; + $method[] = Indent::_(3) . "\$userId = \$model->getState('user.id', 0);"; - $method[] = $this->_t(2) . "}"; + $method[] = Indent::_(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if we have params"; - $method[] = $this->_t(2) . "if (self::checkArray(\$params))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "if (self::checkArray(\$params))"; + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Change user params/config back"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "foreach (\$params as \$param => \$set)"; - $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "{"; + $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " If you know of a better path, let me know"; - $method[] = $this->_t(4) + $method[] = Indent::_(4) . "self::setParams(\$extension, \$param, \$set);"; - $method[] = $this->_t(3) . "}"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "}"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " if user is created"; - $method[] = $this->_t(2) . "if (\$userId > 0)"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "if (\$userId > 0)"; + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Auto Login if Needed"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "if (\$autologin && isset(\$credentials['password']))"; - $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "{"; + $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Try to login"; - $method[] = $this->_t(4) . "try{"; - $method[] = $this->_t(5) + $method[] = Indent::_(4) . "try{"; + $method[] = Indent::_(5) . "JFactory::getApplication()->login(\$credentials);"; - $method[] = $this->_t(4) . "} catch (Exception \$exception){"; - $method[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(4) . "} catch (Exception \$exception){"; + $method[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Do noting for now, may want to set redirect."; - $method[] = $this->_t(4) . "}"; - $method[] = $this->_t(3) . "}"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(4) . "}"; + $method[] = Indent::_(3) . "}"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Return ID"; - $method[] = $this->_t(3) . "return \$userId;"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "return \$model->getError();"; - $method[] = $this->_t(1) . "}"; + $method[] = Indent::_(3) . "return \$userId;"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "return \$model->getError();"; + $method[] = Indent::_(1) . "}"; - $method[] = PHP_EOL . $this->_t(1) + $method[] = PHP_EOL . Indent::_(1) . "public static function setParams(\$component,\$target,\$value)"; - $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(1) . "{"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get the params and set the new values"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "\$params = JComponentHelper::getParams(\$component);"; - $method[] = $this->_t(2) . "\$was = \$params->get(\$target, null);"; - $method[] = $this->_t(2) . "if (\$was != \$value)"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "\$params->set(\$target, \$value);"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "\$was = \$params->get(\$target, null);"; + $method[] = Indent::_(2) . "if (\$was != \$value)"; + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$params->set(\$target, \$value);"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get a new database query instance"; - $method[] = $this->_t(3) . "\$db = JFactory::getDBO();"; - $method[] = $this->_t(3) . "\$query = \$db->getQuery(true);"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "\$db = JFactory::getDBO();"; + $method[] = Indent::_(3) . "\$query = \$db->getQuery(true);"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Build the query"; - $method[] = $this->_t(3) . "\$query->update('#__extensions AS a');"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$query->update('#__extensions AS a');"; + $method[] = Indent::_(3) . "\$query->set('a.params = ' . \$db->quote((string)\$params));"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$query->where('a.element = ' . \$db->quote((string)\$component));"; - $method[] = $this->_t(3); - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3); + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Execute the query"; - $method[] = $this->_t(3) . "\$db->setQuery(\$query);"; - $method[] = $this->_t(3) . "\$db->execute();"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "return \$was;"; - $method[] = $this->_t(1) . "}"; + $method[] = Indent::_(3) . "\$db->setQuery(\$query);"; + $method[] = Indent::_(3) . "\$db->execute();"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "return \$was;"; + $method[] = Indent::_(1) . "}"; - $method[] = PHP_EOL . $this->_t(1) . "/**"; - $method[] = $this->_t(1) . " * Update user values"; - $method[] = $this->_t(1) . " */"; - $method[] = $this->_t(1) + $method[] = PHP_EOL . Indent::_(1) . "/**"; + $method[] = Indent::_(1) . " * Update user values"; + $method[] = Indent::_(1) . " */"; + $method[] = Indent::_(1) . "public static function updateUser(\$new)"; - $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) + $method[] = Indent::_(1) . "{"; + $method[] = Indent::_(2) . "// load the user component language files if there is an error."; - $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();"; - $method[] = $this->_t(2) . "\$extension = 'com_users';"; - $method[] = $this->_t(2) . "\$base_dir = JPATH_ADMINISTRATOR;"; - $method[] = $this->_t(2) . "\$language_tag = '" . Config::get('lang_tag', 'en-GB') + $method[] = Indent::_(2) . "\$lang = JFactory::getLanguage();"; + $method[] = Indent::_(2) . "\$extension = 'com_users';"; + $method[] = Indent::_(2) . "\$base_dir = JPATH_ADMINISTRATOR;"; + $method[] = Indent::_(2) . "\$language_tag = '" . CFactory::_('Config')->get('lang_tag', 'en-GB') . "';"; - $method[] = $this->_t(2) . "\$reload = true;"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "\$reload = true;"; + $method[] = Indent::_(2) . "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; - $method[] = $this->_t(2) . "// load the user model"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "// load the user model"; + $method[] = Indent::_(2) . "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');"; - $method[] = $this->_t(2) . "// Check if password was set"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "// Check if password was set"; + $method[] = Indent::_(2) . "if (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "// Use the users passwords"; - $method[] = $this->_t(3) . "\$password = \$new['password'];"; - $method[] = $this->_t(3) . "\$password2 = \$new['password2'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "// set username"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "// Use the users passwords"; + $method[] = Indent::_(3) . "\$password = \$new['password'];"; + $method[] = Indent::_(3) . "\$password2 = \$new['password2'];"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "// set username"; + $method[] = Indent::_(2) . "if (!isset(\$new['username']) || !self::checkString(\$new['username']))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$new['username'] = \$new['email'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "// lineup update user data"; - $method[] = $this->_t(2) . "\$data = array("; - $method[] = $this->_t(3) . "'id' => \$new['id'],"; - $method[] = $this->_t(3) . "'username' => \$new['username'],"; - $method[] = $this->_t(3) . "'name' => \$new['name'],"; - $method[] = $this->_t(3) . "'email' => \$new['email'],"; - $method[] = $this->_t(3) + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "// lineup update user data"; + $method[] = Indent::_(2) . "\$data = array("; + $method[] = Indent::_(3) . "'id' => \$new['id'],"; + $method[] = Indent::_(3) . "'username' => \$new['username'],"; + $method[] = Indent::_(3) . "'name' => \$new['name'],"; + $method[] = Indent::_(3) . "'email' => \$new['email'],"; + $method[] = Indent::_(3) . "'password' => \$password, // First password field"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "'password2' => \$password2, // Confirm password field"; - $method[] = $this->_t(3) . "'block' => 0 );"; - $method[] = $this->_t(2) . "// set groups if found"; - $method[] = $this->_t(2) + $method[] = Indent::_(3) . "'block' => 0 );"; + $method[] = Indent::_(2) . "// set groups if found"; + $method[] = Indent::_(2) . "if (isset(\$new['groups']) && self::checkArray(\$new['groups']))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "\$data['groups'] = \$new['groups'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "// register the new user"; - $method[] = $this->_t(2) . "\$done = \$model->save(\$data);"; - $method[] = $this->_t(2) . "// if user is updated"; - $method[] = $this->_t(2) . "if (\$done)"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "return \$new['id'];"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "return \$model->getError();"; - $method[] = $this->_t(1) . "}"; + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "\$data['groups'] = \$new['groups'];"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "// register the new user"; + $method[] = Indent::_(2) . "\$done = \$model->save(\$data);"; + $method[] = Indent::_(2) . "// if user is updated"; + $method[] = Indent::_(2) . "if (\$done)"; + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "return \$new['id'];"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "return \$model->getError();"; + $method[] = Indent::_(1) . "}"; // return the help method return implode(PHP_EOL, $method); @@ -2225,31 +2181,31 @@ class Interpretation extends Fields { // set the lang $lang = StringHelper::safe( - 'com_' . Config::get('component_code_name') . '_menu_' + 'com_' . CFactory::_('Config')->component_code_name . '_menu_' . $nameSingleCode, 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_TITLE', 'Create ' . $view['settings']->name_single ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_OPTION', 'Create ' . $view['settings']->name_single ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_DESC', $view['settings']->short_description ); //start loading xml $xml = ''; $xml .= PHP_EOL . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(3) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; $xml .= PHP_EOL . ''; } else @@ -2275,42 +2231,42 @@ class Interpretation extends Fields { // set the lang $lang = StringHelper::safe( - 'com_' . Config::get('component_code_name') . '_menu_' + 'com_' . CFactory::_('Config')->component_code_name . '_menu_' . $view['settings']->code, 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_TITLE', $view['settings']->name ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_OPTION', $view['settings']->name ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_DESC', $view['settings']->description ); //start loading xml $xml = ''; $xml .= PHP_EOL . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(3) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; if (isset($this->hasIdRequest[$view['settings']->code]) || isset($this->hasCatIdRequest[$view['settings']->code])) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '
_t(3) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . '
_t(3) + . CFactory::_('Config')->component_code_name . '/models/rules"'; + $xml .= PHP_EOL . Indent::_(3) . 'addfieldpath="/administrator/components/com_' - . Config::get('component_code_name') . '/models/fields">'; + . CFactory::_('Config')->component_code_name . '/models/fields">'; if (isset($this->hasIdRequest[$view['settings']->code]) && ArrayHelper::check( $this->hasIdRequest[$view['settings']->code] @@ -2321,7 +2277,7 @@ class Interpretation extends Fields $requestFieldXML ) { - $xml .= PHP_EOL . $this->_t(3) . $requestFieldXML; + $xml .= PHP_EOL . Indent::_(3) . $requestFieldXML; } } if (isset($this->hasCatIdRequest[$view['settings']->code]) @@ -2334,11 +2290,11 @@ class Interpretation extends Fields $requestFieldXML ) { - $xml .= PHP_EOL . $this->_t(3) . $requestFieldXML; + $xml .= PHP_EOL . Indent::_(3) . $requestFieldXML; } } - $xml .= PHP_EOL . $this->_t(2) . '
'; - $xml .= PHP_EOL . $this->_t(1) . '
'; + $xml .= PHP_EOL . Indent::_(2) . '
'; + $xml .= PHP_EOL . Indent::_(1) . '
'; } if (isset($this->frontEndParams) && isset($this->frontEndParams[$view['settings']->name])) @@ -2351,23 +2307,22 @@ class Interpretation extends Fields // now load the fields if (ArrayHelper::check($params)) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . '
_t(3) + . $this->fileContentStatic[Placefix::_h('COMPONENT')] . '"'; + $xml .= PHP_EOL . Indent::_(3) . 'addrulepath="/administrator/components/com_' - . Config::get('component_code_name') . '/models/rules"'; - $xml .= PHP_EOL . $this->_t(3) + . CFactory::_('Config')->component_code_name . '/models/rules"'; + $xml .= PHP_EOL . Indent::_(3) . 'addfieldpath="/administrator/components/com_' - . Config::get('component_code_name') . '/models/fields">'; - $xml .= implode($this->_t(3), $params); - $xml .= PHP_EOL . $this->_t(2) . '
'; - $xml .= PHP_EOL . $this->_t(1) . '
'; + . CFactory::_('Config')->component_code_name . '/models/fields">'; + $xml .= implode(Indent::_(3), $params); + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(1) . '
'; } } $xml .= PHP_EOL . '
'; @@ -2408,9 +2363,9 @@ class Interpretation extends Fields // we add the global option $field = str_replace( 'Option Set. -->', - $this->setLine(__LINE__) . ' Global & Option Set. -->' - . PHP_EOL . $this->_t(3) . '', $field + Line::_(__Line__, __Class__) . ' Global & Option Set. -->' + . PHP_EOL . Indent::_(3) . '', $field ); // update the default to be global $field = preg_replace( @@ -2449,34 +2404,34 @@ class Interpretation extends Fields { // to insure that there be no double entries of a call $checker = md5(serialize($the_get) . $code); - if (!isset($this->customViewQueryChecker[$this->target]) - || !isset($checker, $this->customViewQueryChecker[$this->target][$checker])) + if (!isset($this->customViewQueryChecker[CFactory::_('Config')->build_target]) + || !isset($checker, $this->customViewQueryChecker[CFactory::_('Config')->build_target][$checker])) { // load this unuiqe key - $this->customViewQueryChecker[$this->target][$checker] + $this->customViewQueryChecker[CFactory::_('Config')->build_target][$checker] = true; if (isset($the_get['selection']['type']) && StringHelper::check( $the_get['selection']['type'] )) { - $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "//" . $this->setLine(__LINE__) + $getItem = PHP_EOL . PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " Get from " . $the_get['selection']['table'] . " as " . $the_get['as']; // set the selection - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . $the_get['selection']['select']; } else { - $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "//" . $this->setLine(__LINE__) + $getItem = PHP_EOL . PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " Get data"; // set the selection - $getItem .= PHP_EOL . $this->setPlaceholders( + $getItem .= PHP_EOL . CFactory::_('Placeholder')->update( $the_get['selection']['select'], - $this->placeholders + CFactory::_('Placeholder')->active ); } // load the from selection @@ -2495,7 +2450,7 @@ class Interpretation extends Fields $the_get['selection']['type'] )))) { - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . '$query->from(' . $the_get['selection']['from'] . ');'; } @@ -2508,7 +2463,7 @@ class Interpretation extends Fields $the_get['selection']['type'] )) { - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$query->join('" . $the_get['type']; $getItem .= "', (" . $the_get['selection']['from']; $getItem .= ") . ' ON (' . \$db->quoteName('" @@ -2525,19 +2480,19 @@ class Interpretation extends Fields $the_get, $code )) !== false) { - if (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) + if (isset($this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]) && StringHelper::check( - $this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']] + $this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']] ) && !in_array($check, $mainAsArray)) { // load to other query - if (!isset($this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) + if (!isset($this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) { - $this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] + $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] = ''; } - $this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] + $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] .= $getItem; } else @@ -2586,196 +2541,193 @@ class Interpretation extends Fields { case 4: // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS - $filter .= PHP_EOL . PHP_EOL . $this->_t(1) - . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) . " filter " + $filter .= PHP_EOL . PHP_EOL . Indent::_(1) + . $tab . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " filter " . $as . " based on user groups"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "\$remove = (count(array_intersect((array) \$this->groups, (array) " . $string . "->" . $field . "))) ? false : true;"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "if (\$remove)"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "{"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "if (\$remove)"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $string . " if user not in groups"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . $string . " = null;"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "return false;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . $string . " = null;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "return false;"; } else { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Unset " . $string . " if user not in groups"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "unset(" + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "unset(" . $removeString . ");"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "continue;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "continue;"; } - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "}"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "}"; break; case 9: // COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE - $filter .= PHP_EOL . PHP_EOL . $this->_t(1) - . $tab . $this->_t(1) . "if (" - . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + $filter .= PHP_EOL . PHP_EOL . Indent::_(1) + . $tab . Indent::_(1) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(" . $string . "->" . $field . "))"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "{"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "{"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " do your thing here"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "}"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "else"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "{"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "}"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "else"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $string . " if not array."; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . $string . " = null;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . $string . " = null;"; } else { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Unset " . $string . " if not array."; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "unset(" + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "unset(" . $removeString . ");"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "continue;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "continue;"; } - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "}"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "}"; break; case 10: // COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE - $filter .= PHP_EOL . PHP_EOL . $this->_t(1) - . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) . " filter " + $filter .= PHP_EOL . PHP_EOL . Indent::_(1) + . $tab . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " filter " . $as . " based on repeatable value"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "if (" - . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(" . $string . "->" . $field . "))"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "{"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "{"; - $filter .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "\$array = json_decode(" + $filter .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "\$array = json_decode(" . $string . "->" . $field . ",true);"; - $filter .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "if (" - . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + $filter .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$array))"; - $filter .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "{"; + $filter .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "{"; - $filter .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " do your thing here"; - $filter .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "}"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "else"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "{"; + $filter .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "}"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "else"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $string . " if not array."; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . $string . " = null;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . $string . " = null;"; } else { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Unset " . $string . " if not array."; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "unset(" + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "unset(" . $removeString . ");"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "continue;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "continue;"; } - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "}"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "}"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "}"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "else"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "{"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "}"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "else"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $string . " if not string."; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . $string . " = null;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . $string . " = null;"; } else { - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Unset " . $string . " if not string."; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "unset(" + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "unset(" . $removeString . ");"; - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . "continue;"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . "continue;"; } - $filter .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "}"; + $filter .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "}"; break; } } @@ -2816,23 +2768,22 @@ class Interpretation extends Fields $decoder = ''; if ('json' === $decode) { - $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "if (" . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] . "Helper::checkJson(" + $if = PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "if (" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL - . $this->_t(1) . $tab . $this->_t(1) . "{"; + . Indent::_(1) . $tab . Indent::_(1) . "{"; // json_decode $decoder = $string . "->" . $field . " = json_decode(" . $string . "->" . $field . ", true);"; } elseif ('base64' === $decode) { - $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $if = PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "if (!empty(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string - . "->" . $field . ")))" . PHP_EOL . $this->_t(1) - . $tab . $this->_t(1) . "{"; + . "->" . $field . ")))" . PHP_EOL . Indent::_(1) + . $tab . Indent::_(1) . "{"; // base64_decode $decoder = $string . "->" . $field . " = base64_decode(" . $string . "->" . $field . ");"; @@ -2847,16 +2798,16 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $if = PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "if (!empty(" . $string + $if = PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "if (!empty(" . $string . "->" . $field . ") && \$" . $cryptionType . "key && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" - . PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "{"; + . PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "{"; // set decryption $decoder = $string . "->" . $field . " = rtrim(\$" . $cryptionType @@ -2871,11 +2822,11 @@ class Interpretation extends Fields $_placeholder_for_field = array('[[[field]]]' => $string . "->" . $field); - $fieldDecode .= $this->setPlaceholders( - PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . implode( - PHP_EOL . $this->_t(1) . $tab - . $this->_t(1), + $fieldDecode .= CFactory::_('Placeholder')->update( + PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . implode( + PHP_EOL . Indent::_(1) . $tab + . Indent::_(1), $this->{$cryptionType . 'FieldModeling'}[$array['admin_view']][$field]['get'] ), $_placeholder_for_field @@ -2890,19 +2841,19 @@ class Interpretation extends Fields if (StringHelper::check($if)) { // build decoder string - $fieldDecode .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "//" . $this->setLine(__LINE__) + $fieldDecode .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " Check if we can decode " . $field . $if - . PHP_EOL . $this->_t(1) . $tab . $this->_t(2) - . "//" . $this->setLine(__LINE__) . " Decode " + . PHP_EOL . Indent::_(1) . $tab . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Decode " . $field; } if (StringHelper::check($decoder)) { // build decoder string - $fieldDecode .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(2) . $decoder . PHP_EOL . $this->_t(1) - . $tab . $this->_t(1) . "}"; + $fieldDecode .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(2) . $decoder . PHP_EOL . Indent::_(1) + . $tab . Indent::_(1) . "}"; } } } @@ -2918,11 +2869,10 @@ class Interpretation extends Fields $fieldPrepare = ''; $runplugins = false; // set component - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; // set context $context = (isset($get['context'])) ? $get['context'] : $code; - $context = 'com_' . Config::get('component_code_name') . '.' . $context; + $context = 'com_' . CFactory::_('Config')->component_code_name . '.' . $context; // load parms builder only once $params = false; foreach ($checker as $field => $array) @@ -2941,21 +2891,21 @@ class Interpretation extends Fields // build decoder string if (!$runplugins) { - $runplugins = PHP_EOL . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) + $runplugins = PHP_EOL . $tab . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " Load the JEvent Dispatcher"; - $runplugins .= PHP_EOL . $tab . $this->_t(1) + $runplugins .= PHP_EOL . $tab . Indent::_(1) . "JPluginHelper::importPlugin('content');"; - $runplugins .= PHP_EOL . $tab . $this->_t(1) + $runplugins .= PHP_EOL . $tab . Indent::_(1) . '$this->_dispatcher = JFactory::getApplication();'; } if (!$params) { - $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t( + $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_( 1 - ) . "//" . $this->setLine(__LINE__) + ) . "//" . Line::_(__Line__, __Class__) . " Check if item has params, or pass whole item."; - $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t( + $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_( 1 ) . "\$params = (isset(" . $string . "->params) && " . $Component . "Helper::checkJson(" . $string @@ -2963,21 +2913,21 @@ class Interpretation extends Fields . $string . ";"; $params = true; } - $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "//" . $this->setLine(__LINE__) + $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "//" . Line::_(__Line__, __Class__) . " Make sure the content prepare plugins fire on " . $field; - $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$_" . $field . " = new stdClass();"; - $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$_" . $field . '->text =& ' . $string . '->' . $field - . '; //' . $this->setLine(__LINE__) + . '; //' . Line::_(__Line__, __Class__) . ' value must be in text'; - $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "//" . $this->setLine(__LINE__) + $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "//" . Line::_(__Line__, __Class__) . " Since all values are now in text (Joomla Limitation), we also add the field name (" . $field . ") to context"; - $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . '$this->_dispatcher->triggerEvent("onContentPrepare", array(\'' . $context . '.' . $field . '\', &$_' . $field . ', &$params, 0));'; @@ -2986,8 +2936,7 @@ class Interpretation extends Fields // load dispatcher if ($runplugins) { - $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' - . $this->hhh => $runplugins); + $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => $runplugins); } // return content prepare fix @@ -3015,13 +2964,12 @@ class Interpretation extends Fields // only load for uikit version 2 (TODO) we may need to add another check here if (2 == $this->uikit || 1 == $this->uikit) { - $fieldUikit .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "//" . $this->setLine(__LINE__) . " Checking if " + $fieldUikit .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "//" . Line::_(__Line__, __Class__) . " Checking if " . $field . " has uikit components that must be loaded."; - $fieldUikit .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $fieldUikit .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$this->uikitComp = " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::getUikitComp(" . $string . "->" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::getUikitComp(" . $string . "->" . $field . ",\$this->uikitComp);"; } } @@ -3047,37 +2995,34 @@ class Interpretation extends Fields if ($this->checkJoint($default, $get, $asBucket)) { // build custom join string - $otherJoin = PHP_EOL . $this->_t(1) . $this->hhh . "TAB" - . $this->hhh . $this->_t(1) . "//" . $this->setLine( - __LINE__ - ) . " set " . $default['valueName'] . " to the " - . $this->hhh . "STRING" . $this->hhh . " object."; - $otherJoin .= PHP_EOL . $this->_t(1) . $this->hhh - . "TAB" . $this->hhh . $this->_t(1) . $this->hhh - . "STRING" . $this->hhh . "->" + $otherJoin = PHP_EOL . Indent::_(1) . Placefix::_h("TAB") + . Indent::_(1) . "//" . Line::_(__LINE__,__CLASS__) + . " set " . $default['valueName'] . " to the " + . Placefix::_h("STRING") . " object."; + $otherJoin .= PHP_EOL . Indent::_(1) . Placefix::_h("TAB") + . Indent::_(1) . Placefix::_h("STRING") . "->" . $default['valueName'] . " = \$this->get" - . $default['methodName'] . "(" . $this->hhh - . "STRING" . $this->hhh . "->" + . $default['methodName'] . "(" . Placefix::_h("STRING") . "->" . $this->getAsLookup[$get['key']][$get['on_field']] . ");"; // load to other join - if (!isset($this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) + if (!isset($this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) { - $this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] + $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] = ''; } - $this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] + $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']] .= $otherJoin; } else { // build custom join string - $customJoin .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "//" . $this->setLine(__LINE__) + $customJoin .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " set " . $default['valueName'] . " to the " . $string . " object."; - $customJoin .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . $string . "->" + $customJoin .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . $string . "->" . $default['valueName'] . " = \$this->get" . $default['methodName'] . "(" . $string . "->" . $this->getAsLookup[$get['key']][$get['on_field']] @@ -3104,9 +3049,9 @@ class Interpretation extends Fields return false; } // default fallback - elseif (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) + elseif (isset($this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]) && StringHelper::check( - $this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']] + $this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']] )) { return true; @@ -3135,19 +3080,19 @@ class Interpretation extends Fields { case 1: // COM_COMPONENTBUILDER_DYNAMIC_GET_ID - $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$pk);"; break; case 2: // COM_COMPONENTBUILDER_DYNAMIC_GET_USER - $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$this->userId);"; break; case 3: // COM_COMPONENTBUILDER_DYNAMIC_GET_ACCESS_LEVEL - $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->levels) . ')');"; @@ -3160,12 +3105,12 @@ class Interpretation extends Fields || $ter['state_key'] === 'array') { // set needed fields to filter after query - $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] + $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$ter['key']][$as][$field] = $ter; } else { - $string = PHP_EOL . $this->_t(1) . $tab . $this->_t( + $string = PHP_EOL . Indent::_(1) . $tab . Indent::_( 1 ) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] @@ -3174,20 +3119,20 @@ class Interpretation extends Fields break; case 5: // COM_COMPONENTBUILDER_DYNAMIC_GET_CATEGORIES - $string = PHP_EOL . $this->_t(2) . $tab . "//" - . $this->setLine(__LINE__) + $string = PHP_EOL . Indent::_(2) . $tab . "//" + . Line::_(__Line__, __Class__) . " (TODO) The dynamic category filter is not ready."; break; case 6: // COM_COMPONENTBUILDER_DYNAMIC_GET_TAGS - $string = PHP_EOL . $this->_t(2) . $tab . "//" - . $this->setLine(__LINE__) + $string = PHP_EOL . Indent::_(2) . $tab . "//" + . Line::_(__Line__, __Class__) . " (TODO) The dynamic tags filter is not ready."; break; case 7: // COM_COMPONENTBUILDER_DYNAMIC_GET_DATE - $string = PHP_EOL . $this->_t(2) . $tab . "//" - . $this->setLine(__LINE__) + $string = PHP_EOL . Indent::_(2) . $tab . "//" + . Line::_(__Line__, __Class__) . " (TODO) The dynamic date filter is not ready."; break; case 8: @@ -3195,70 +3140,68 @@ class Interpretation extends Fields if ($ter['operator'] === 'IN' || $ter['operator'] === 'NOT IN') { - $string = PHP_EOL . $this->_t(2) . $tab . "//" - . $this->setLine(__LINE__) . " Check if " + $string = PHP_EOL . Indent::_(2) . $tab . "//" + . Line::_(__Line__, __Class__) . " Check if " . $ter['state_key'] . " is an array with values."; - $string .= PHP_EOL . $this->_t(2) . $tab + $string .= PHP_EOL . Indent::_(2) . $tab . "\$array = " . $ter['state_key'] . ";"; - $string .= PHP_EOL . $this->_t(2) . $tab + $string .= PHP_EOL . Indent::_(2) . $tab . "if (isset(\$array) && " - . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$array))"; - $string .= PHP_EOL . $this->_t(2) . $tab . "{"; - $string .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "\$query->where('" + $string .= PHP_EOL . Indent::_(2) . $tab . "{"; + $string .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$array) . ')');"; - $string .= PHP_EOL . $this->_t(2) . $tab . "}"; + $string .= PHP_EOL . Indent::_(2) . $tab . "}"; // check if empty is allowed if (!isset($ter['empty']) || !$ter['empty']) { - $string .= PHP_EOL . $this->_t(2) . $tab + $string .= PHP_EOL . Indent::_(2) . $tab . "else"; - $string .= PHP_EOL . $this->_t(2) . $tab . "{"; - $string .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "return false;"; - $string .= PHP_EOL . $this->_t(2) . $tab . "}"; + $string .= PHP_EOL . Indent::_(2) . $tab . "{"; + $string .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "return false;"; + $string .= PHP_EOL . Indent::_(2) . $tab . "}"; } } else { - $string = PHP_EOL . $this->_t(2) . $tab . "//" - . $this->setLine(__LINE__) . " Check if " + $string = PHP_EOL . Indent::_(2) . $tab . "//" + . Line::_(__Line__, __Class__) . " Check if " . $ter['state_key'] . " is a string or numeric value."; - $string .= PHP_EOL . $this->_t(2) . $tab + $string .= PHP_EOL . Indent::_(2) . $tab . "\$checkValue = " . $ter['state_key'] . ";"; - $string .= PHP_EOL . $this->_t(2) . $tab + $string .= PHP_EOL . Indent::_(2) . $tab . "if (isset(\$checkValue) && " - . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$checkValue))"; - $string .= PHP_EOL . $this->_t(2) . $tab . "{"; - $string .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "\$query->where('" + $string .= PHP_EOL . Indent::_(2) . $tab . "{"; + $string .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$db->quote(\$checkValue));"; - $string .= PHP_EOL . $this->_t(2) . $tab . "}"; - $string .= PHP_EOL . $this->_t(2) . $tab + $string .= PHP_EOL . Indent::_(2) . $tab . "}"; + $string .= PHP_EOL . Indent::_(2) . $tab . "elseif (is_numeric(\$checkValue))"; - $string .= PHP_EOL . $this->_t(2) . $tab . "{"; - $string .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "\$query->where('" + $string .= PHP_EOL . Indent::_(2) . $tab . "{"; + $string .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$checkValue);"; - $string .= PHP_EOL . $this->_t(2) . $tab . "}"; + $string .= PHP_EOL . Indent::_(2) . $tab . "}"; // check if empty is allowed if (!isset($ter['empty']) || !$ter['empty']) { - $string .= PHP_EOL . $this->_t(2) . $tab + $string .= PHP_EOL . Indent::_(2) . $tab . "else"; - $string .= PHP_EOL . $this->_t(2) . $tab . "{"; - $string .= PHP_EOL . $this->_t(2) . $tab - . $this->_t(1) . "return false;"; - $string .= PHP_EOL . $this->_t(2) . $tab . "}"; + $string .= PHP_EOL . Indent::_(2) . $tab . "{"; + $string .= PHP_EOL . Indent::_(2) . $tab + . Indent::_(1) . "return false;"; + $string .= PHP_EOL . Indent::_(2) . $tab . "}"; } } break; @@ -3266,14 +3209,14 @@ class Interpretation extends Fields // COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE $string = ""; // set needed fields to filter after query - $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] + $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$ter['key']][$as][$field] = $ter; break; case 10: // COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE $string = ""; // set needed fields to filter after query - $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] + $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$ter['key']][$as][$field] = $ter; break; case 11: @@ -3286,7 +3229,7 @@ class Interpretation extends Fields ); $field = trim(str_replace(')', '', $field)); } - $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " " . $ter['state_key'] . "');"; @@ -3297,16 +3240,16 @@ class Interpretation extends Fields { // sort where if ($as === 'a' - || (isset($this->siteMainGet[$this->target][$code][$as]) + || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]) && StringHelper::check( - $this->siteMainGet[$this->target][$code][$as] + $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as] ))) { $filters .= $string; } elseif ($as !== 'a') { - $this->otherFilter[$this->target][$code][$as][$field] + $this->otherFilter[CFactory::_('Config')->build_target][$code][$as][$field] = $string; } } @@ -3330,18 +3273,18 @@ class Interpretation extends Fields $string = "\$query->group('" . $gr['table_key'] . "');"; // sort where if ($as === 'a' - || (isset($this->siteMainGet[$this->target][$code][$as]) + || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]) && StringHelper::check( - $this->siteMainGet[$this->target][$code][$as] + $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as] ))) { - $grouping .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $grouping .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . $string; } else { - $this->otherGroup[$this->target][$code][$as][$field] - = PHP_EOL . $this->_t(2) . $string; + $this->otherGroup[CFactory::_('Config')->build_target][$code][$as][$field] + = PHP_EOL . Indent::_(2) . $string; } } } @@ -3373,18 +3316,18 @@ class Interpretation extends Fields } // sort where if ($as === 'a' - || (isset($this->siteMainGet[$this->target][$code][$as]) + || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]) && StringHelper::check( - $this->siteMainGet[$this->target][$code][$as] + $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as] ))) { - $ordering .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $ordering .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . $string; } else { - $this->otherOrder[$this->target][$code][$as][$field] - = PHP_EOL . $this->_t(2) . $string; + $this->otherOrder[CFactory::_('Config')->build_target][$code][$as][$field] + = PHP_EOL . Indent::_(2) . $string; } } } @@ -3452,51 +3395,50 @@ class Interpretation extends Fields || $whe['operator'] === 'NOT IN') { $string = "if (isset(" . $whe['value_key'] . ") && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(" . $whe['value_key'] . "))"; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1) . "{"; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2) - . "//" . $this->setLine(__LINE__) . " Get where " + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Get where " . $whe['table_key'] . " is " . $whe['value_key']; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(2) . "\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1) . "}"; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1) . "else"; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1) . "{"; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(2) . "return false;"; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1) . "}"; } else { - $string = "//" . $this->setLine(__LINE__) + $string = "//" . Line::_(__Line__, __Class__) . " Get where " . $whe['table_key'] . " is " . $whe['value_key']; - $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) + $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1) . "\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; } // sort where if ($as === 'a' - || (isset($this->siteMainGet[$this->target][$code][$as]) + || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]) && StringHelper::check( - $this->siteMainGet[$this->target][$code][$as] + $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as] ))) { - $wheres .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $wheres .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . $string; } elseif ($as !== 'a') { - $this->otherWhere[$this->target][$code][$as][$field] - = PHP_EOL . $this->_t(2) . $string; + $this->otherWhere[CFactory::_('Config')->build_target][$code][$as][$field] + = PHP_EOL . Indent::_(2) . $string; } } } @@ -3533,10 +3475,10 @@ class Interpretation extends Fields // only add if the filter is set if (StringHelper::check($value)) { - $globals .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "//" . $this->setLine(__LINE__) + $globals .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "//" . Line::_(__Line__, __Class__) . " set the global " . $glo['name'] . " value." - . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . $value; } } @@ -3585,54 +3527,51 @@ class Interpretation extends Fields } // check that the default and the redirect page is not the same if (isset( - $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] ) - && $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' - . $this->hhh] != $view['settings']->code) + && $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $view['settings']->code) { - $redirectMessage = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $redirectMessage = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " redirect away to the default view if no access allowed."; $redirectString = "JRoute::_('index.php?option=com_" - . Config::get('component_code_name') . "&view=" - . $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' - . $this->hhh] . "')"; + . CFactory::_('Config')->component_code_name . "&view=" + . $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')"; } else { - $redirectMessage = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $redirectMessage = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " redirect away to the home page if no access allowed."; $redirectString = 'JURI::root()'; } - $accessCheck[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $accessCheck[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " check if this user has permission to access item"; - $accessCheck[] = $this->_t(2) . "if (!" . $userString + $accessCheck[] = Indent::_(2) . "if (!" . $userString . "->authorise('site." . $view['settings']->code - . ".access', 'com_" . Config::get('component_code_name') . "'))"; - $accessCheck[] = $this->_t(2) . "{"; - $accessCheck[] = $this->_t(3) + . ".access', 'com_" . CFactory::_('Config')->component_code_name . "'))"; + $accessCheck[] = Indent::_(2) . "{"; + $accessCheck[] = Indent::_(3) . "\$app = JFactory::getApplication();"; // set lang - $langKeyWord = $this->langPrefix . '_' + $langKeyWord = CFactory::_('Config')->lang_prefix . '_' . StringHelper::safe( 'Not authorised to view ' . $view['settings']->code . '!', 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'site', $langKeyWord, 'Not authorised to view ' . $view['settings']->code . '!' ); - $accessCheck[] = $this->_t(3) . "\$app->enqueueMessage(JText:" + $accessCheck[] = Indent::_(3) . "\$app->enqueueMessage(JText:" . ":_('" . $langKeyWord . "'), 'error');"; $accessCheck[] = $redirectMessage; - $accessCheck[] = $this->_t(3) . "\$app->redirect(" . $redirectString + $accessCheck[] = Indent::_(3) . "\$app->redirect(" . $redirectString . ");"; - $accessCheck[] = $this->_t(3) . "return false;"; - $accessCheck[] = $this->_t(2) . "}"; + $accessCheck[] = Indent::_(3) . "return false;"; + $accessCheck[] = Indent::_(2) . "}"; // return the access check return implode(PHP_EOL, $accessCheck); @@ -3670,18 +3609,18 @@ class Interpretation extends Fields $get->php_before_getitem )) { - $getItem .= $this->setPlaceholders( - $get->php_before_getitem, $this->placeholders + $getItem .= CFactory::_('Placeholder')->update( + $get->php_before_getitem, CFactory::_('Placeholder')->active ); } // start loadin the get Item - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) . " Get a db connection."; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " Get a db connection."; + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$db = JFactory::getDbo();"; - $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Create a new query object."; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $getItem .= PHP_EOL . PHP_EOL . $tab . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$query = \$db->getQuery(true);"; // set main get query $getItem .= $this->setCustomViewQuery($get->main_get, $code, $tab); @@ -3708,106 +3647,103 @@ class Interpretation extends Fields $getItem .= $this->setCustomViewGroup($get->group, $code, $tab); } // db set query data placeholder - $getItem .= $this->hhh . "DB_SET_QUERY_DATA" . $this->hhh; + $getItem .= Placefix::_h("DB_SET_QUERY_DATA") ; // set after item php if (isset($get->add_php_after_getitem) && $get->add_php_after_getitem == 1 && isset($get->php_after_getitem) && StringHelper::check($get->php_after_getitem)) { - $getItem .= $this->setPlaceholders( - $get->php_after_getitem, $this->placeholders + $getItem .= CFactory::_('Placeholder')->update( + $get->php_after_getitem, CFactory::_('Placeholder')->active ); } // check the getItem string to see if we should still add set query to data if (strpos($getItem, '$data =') === false) { // get ready to get query - $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] = - PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] = + PHP_EOL . PHP_EOL . $tab . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Reset the query using our newly populated query object."; - $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .= - PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] .= + PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$db->setQuery(\$query);"; - $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .= - PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) + $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] .= + PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " Load the results as a stdClass object."; - $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .= - PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] .= + PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$data = \$db->loadObject();"; // add the db set query to data } else { // remove our placeholder - $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] = ''; + $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] = ''; } // add the db set query to data $getItem = str_replace( array_keys($setQuery), array_values($setQuery), $getItem ); - $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) + $getItem .= PHP_EOL . PHP_EOL . $tab . Indent::_(2) . "if (empty(\$data))"; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "{"; if ($type === 'main') { - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "\$app = JFactory::getApplication();"; - $langKeyWoord = $this->langPrefix . '_' + $langKeyWoord = CFactory::_('Config')->lang_prefix . '_' . StringHelper::safe( 'Not found or access denied', 'U' ); - $this->setLangContent( - $this->lang, $langKeyWoord, 'Not found, or access denied.' + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langKeyWoord, 'Not found, or access denied.' ); - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " If no data is found redirect to default page and show warning."; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "\$app->enqueueMessage(JText:" . ":_('" . $langKeyWoord . "'), 'warning');"; - if ('site' === $this->target) + if ('site' === CFactory::_('Config')->build_target) { // check that the default and the redirect page is not the same if (isset( - $this->fileContentStatic[$this->hhh - . 'SITE_DEFAULT_VIEW' . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] ) - && $this->fileContentStatic[$this->hhh - . 'SITE_DEFAULT_VIEW' . $this->hhh] != $code) + && $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $code) { $redirectString = "JRoute::_('index.php?option=com_" - . Config::get('component_code_name') . "&view=" - . $this->fileContentStatic[$this->hhh - . 'SITE_DEFAULT_VIEW' . $this->hhh] . "')"; + . CFactory::_('Config')->component_code_name . "&view=" + . $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')"; } else { $redirectString = 'JURI::root()'; } - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "\$app->redirect(" . $redirectString . ");"; } else { - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "\$app->redirect('index.php?option=com_" - . Config::get('component_code_name') . "');"; + . CFactory::_('Config')->component_code_name . "');"; } - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "return false;"; } else { - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "return false;"; } - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "}"; // dispatcher placeholder - $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; + $getItem .= Placefix::_h("DISPATCHER") ; if (ArrayHelper::check($get->main_get)) { $asBucket = array(); @@ -3831,10 +3767,10 @@ class Interpretation extends Fields } } - if (isset($this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']])) + if (isset($this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']])) { $decodeFilter - = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]; + = $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']]; if (ArrayHelper::check( $decodeFilter )) @@ -3883,8 +3819,7 @@ class Interpretation extends Fields } } // set the scripts - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; $script = ''; foreach ($this->cryptionTypes as $cryptionType) { @@ -3893,16 +3828,16 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "//" . Line::_(__Line__, __Class__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; } @@ -3920,8 +3855,8 @@ class Interpretation extends Fields . 'FieldModelInitiator'}[$code]['get'] as $block ) { - $script .= PHP_EOL . $this->_t(1) . implode( - PHP_EOL . $this->_t(1), $block + $script .= PHP_EOL . Indent::_(1) . implode( + PHP_EOL . Indent::_(1), $block ); } } @@ -3940,38 +3875,38 @@ class Interpretation extends Fields if ($get->addcalculation == 1) { $get->php_calculation = (array) explode( - PHP_EOL, $this->setPlaceholders( - $get->php_calculation, $this->placeholders + PHP_EOL, CFactory::_('Placeholder')->update( + $get->php_calculation, CFactory::_('Placeholder')->active ) ); - $getItem .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . implode( - PHP_EOL . $this->_t(1) . $tab . $this->_t(1), + $getItem .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . implode( + PHP_EOL . Indent::_(1) . $tab . Indent::_(1), $get->php_calculation ); } if ($type === 'custom') { // return the object - $getItem .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t( + $getItem .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab . Indent::_( 1 - ) . "//" . $this->setLine(__LINE__) + ) . "//" . Line::_(__Line__, __Class__) . " return data object."; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "return \$data;"; } else { // set the object - $getItem .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t( + $getItem .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab . Indent::_( 1 - ) . "//" . $this->setLine(__LINE__) + ) . "//" . Line::_(__Line__, __Class__) . " set data object to item."; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$this->_item[\$pk] = \$data;"; } // only update if dispacher placholder is found - if (strpos($getItem, $this->hhh . 'DISPATCHER' . $this->hhh) + if (strpos($getItem, Placefix::_h('DISPATCHER')) !== false) { // check if the dispather should be added @@ -3980,8 +3915,7 @@ class Interpretation extends Fields $this->JEventDispatcher )) { - $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' - . $this->hhh => ''); + $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => ''); } $getItem = str_replace( array_keys($this->JEventDispatcher), @@ -3992,8 +3926,8 @@ class Interpretation extends Fields return $getItem; } - return PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) . "add your custom code here."; + return PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . "add your custom code here."; } public function setCustomViewCustomMethods($main_view, $code) @@ -4033,23 +3967,23 @@ class Interpretation extends Fields if ($view->gettype == 3) { // SITE_GET_ITEM <<>> - $main .= PHP_EOL . PHP_EOL . $this->_t(2) + $main .= PHP_EOL . PHP_EOL . Indent::_(2) . "if (!isset(\$this->initSet) || !\$this->initSet)"; - $main .= PHP_EOL . $this->_t(2) . "{"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(2) . "{"; + $main .= PHP_EOL . Indent::_(3) . "\$this->user = JFactory::getUser();"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->userId = \$this->user->get('id');"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->guest = \$this->user->get('guest');"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->groups = \$this->user->get('groups');"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->authorisedGroups = \$this->user->getAuthorisedGroups();"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->levels = \$this->user->getAuthorisedViewLevels();"; - $main .= PHP_EOL . $this->_t(3) . "\$this->initSet = true;"; - $main .= PHP_EOL . $this->_t(2) . "}"; + $main .= PHP_EOL . Indent::_(3) . "\$this->initSet = true;"; + $main .= PHP_EOL . Indent::_(2) . "}"; $main .= $this->setCustomViewGetItem( $view, $view->code, '', 'custom' ); @@ -4058,28 +3992,28 @@ class Interpretation extends Fields } elseif ($view->gettype == 4) { - $main .= PHP_EOL . PHP_EOL . $this->_t(2) + $main .= PHP_EOL . PHP_EOL . Indent::_(2) . "if (!isset(\$this->initSet) || !\$this->initSet)"; - $main .= PHP_EOL . $this->_t(2) . "{"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(2) . "{"; + $main .= PHP_EOL . Indent::_(3) . "\$this->user = JFactory::getUser();"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->userId = \$this->user->get('id');"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->guest = \$this->user->get('guest');"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->groups = \$this->user->get('groups');"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->authorisedGroups = \$this->user->getAuthorisedGroups();"; - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . "\$this->levels = \$this->user->getAuthorisedViewLevels();"; - $main .= PHP_EOL . $this->_t(3) . "\$this->initSet = true;"; - $main .= PHP_EOL . $this->_t(2) . "}"; - $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Get the global params"; - $main .= PHP_EOL . $this->_t(2) + $main .= PHP_EOL . Indent::_(3) . "\$this->initSet = true;"; + $main .= PHP_EOL . Indent::_(2) . "}"; + $main .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Get the global params"; + $main .= PHP_EOL . Indent::_(2) . "\$globalParams = JComponentHelper::getParams('com_" - . Config::get('component_code_name') . "', true);"; + . CFactory::_('Config')->component_code_name . "', true);"; // set php before listquery if (isset($view->add_php_getlistquery) && $view->add_php_getlistquery == 1 @@ -4088,8 +4022,8 @@ class Interpretation extends Fields $view->php_getlistquery )) { - $main .= $this->setPlaceholders( - $view->php_getlistquery, $this->placeholders + $main .= CFactory::_('Placeholder')->update( + $view->php_getlistquery, CFactory::_('Placeholder')->active ); } // SITE_GET_LIST_QUERY <<>> @@ -4104,17 +4038,17 @@ class Interpretation extends Fields $view->php_before_getitems )) { - $main .= $this->setPlaceholders( - $view->php_before_getitems, $this->placeholders + $main .= CFactory::_('Placeholder')->update( + $view->php_before_getitems, CFactory::_('Placeholder')->active ); } // load the object list - $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $main .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Reset the query using our newly populated query object."; - $main .= PHP_EOL . $this->_t(2) + $main .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);"; - $main .= PHP_EOL . $this->_t(2) + $main .= PHP_EOL . Indent::_(2) . "\$items = \$db->loadObjectList();"; // set after items php if (isset($view->add_php_after_getitems) @@ -4124,21 +4058,21 @@ class Interpretation extends Fields $view->php_after_getitems )) { - $main .= $this->setPlaceholders( - $view->php_after_getitems, $this->placeholders + $main .= CFactory::_('Placeholder')->update( + $view->php_after_getitems, CFactory::_('Placeholder')->active ); } - $main .= PHP_EOL . PHP_EOL . $this->_t(2) + $main .= PHP_EOL . PHP_EOL . Indent::_(2) . "if (empty(\$items))"; - $main .= PHP_EOL . $this->_t(2) . "{"; - $main .= PHP_EOL . $this->_t(3) . "return false;"; - $main .= PHP_EOL . $this->_t(2) . "}"; + $main .= PHP_EOL . Indent::_(2) . "{"; + $main .= PHP_EOL . Indent::_(3) . "return false;"; + $main .= PHP_EOL . Indent::_(2) . "}"; // SITE_GET_ITEMS <<>> $main .= $this->setCustomViewGetItems($view, $view->code); - $main .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $main .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " return items"; - $main .= PHP_EOL . $this->_t(2) . "return \$items;"; + $main .= PHP_EOL . Indent::_(2) . "return \$items;"; $type = 'mixed An array of objects on success, false on failure.'; } @@ -4169,115 +4103,115 @@ class Interpretation extends Fields { // build uikit get method $ukit = array(); - $ukit[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $ukit[] = $this->_t(1) . " * UIKIT Component Classes"; - $ukit[] = $this->_t(1) . " **/"; - $ukit[] = $this->_t(1) . "public static \$uk_components = array("; - $ukit[] = $this->_t(3) . "'data-uk-grid' => array("; - $ukit[] = $this->_t(4) . "'grid' ),"; - $ukit[] = $this->_t(3) . "'uk-accordion' => array("; - $ukit[] = $this->_t(4) . "'accordion' ),"; - $ukit[] = $this->_t(3) . "'uk-autocomplete' => array("; - $ukit[] = $this->_t(4) . "'autocomplete' ),"; - $ukit[] = $this->_t(3) . "'data-uk-datepicker' => array("; - $ukit[] = $this->_t(4) . "'datepicker' ),"; - $ukit[] = $this->_t(3) . "'uk-form-password' => array("; - $ukit[] = $this->_t(4) . "'form-password' ),"; - $ukit[] = $this->_t(3) . "'uk-form-select' => array("; - $ukit[] = $this->_t(4) . "'form-select' ),"; - $ukit[] = $this->_t(3) . "'data-uk-htmleditor' => array("; - $ukit[] = $this->_t(4) . "'htmleditor' ),"; - $ukit[] = $this->_t(3) . "'data-uk-lightbox' => array("; - $ukit[] = $this->_t(4) . "'lightbox' ),"; - $ukit[] = $this->_t(3) . "'uk-nestable' => array("; - $ukit[] = $this->_t(4) . "'nestable' ),"; - $ukit[] = $this->_t(3) . "'UIkit.notify' => array("; - $ukit[] = $this->_t(4) . "'notify' ),"; - $ukit[] = $this->_t(3) . "'data-uk-parallax' => array("; - $ukit[] = $this->_t(4) . "'parallax' ),"; - $ukit[] = $this->_t(3) . "'uk-search' => array("; - $ukit[] = $this->_t(4) . "'search' ),"; - $ukit[] = $this->_t(3) . "'uk-slider' => array("; - $ukit[] = $this->_t(4) . "'slider' ),"; - $ukit[] = $this->_t(3) . "'uk-slideset' => array("; - $ukit[] = $this->_t(4) . "'slideset' ),"; - $ukit[] = $this->_t(3) . "'uk-slideshow' => array("; - $ukit[] = $this->_t(4) . "'slideshow',"; - $ukit[] = $this->_t(4) . "'slideshow-fx' ),"; - $ukit[] = $this->_t(3) . "'uk-sortable' => array("; - $ukit[] = $this->_t(4) . "'sortable' ),"; - $ukit[] = $this->_t(3) . "'data-uk-sticky' => array("; - $ukit[] = $this->_t(4) . "'sticky' ),"; - $ukit[] = $this->_t(3) . "'data-uk-timepicker' => array("; - $ukit[] = $this->_t(4) . "'timepicker' ),"; - $ukit[] = $this->_t(3) . "'data-uk-tooltip' => array("; - $ukit[] = $this->_t(4) . "'tooltip' ),"; - $ukit[] = $this->_t(3) . "'uk-placeholder' => array("; - $ukit[] = $this->_t(4) . "'placeholder' ),"; - $ukit[] = $this->_t(3) . "'uk-dotnav' => array("; - $ukit[] = $this->_t(4) . "'dotnav' ),"; - $ukit[] = $this->_t(3) . "'uk-slidenav' => array("; - $ukit[] = $this->_t(4) . "'slidenav' ),"; - $ukit[] = $this->_t(3) . "'uk-form' => array("; - $ukit[] = $this->_t(4) . "'form-advanced' ),"; - $ukit[] = $this->_t(3) . "'uk-progress' => array("; - $ukit[] = $this->_t(4) . "'progress' ),"; - $ukit[] = $this->_t(3) . "'upload-drop' => array("; - $ukit[] = $this->_t(4) . "'upload', 'form-file' )"; - $ukit[] = $this->_t(3) . ");"; - $ukit[] = PHP_EOL . $this->_t(1) . "/**"; - $ukit[] = $this->_t(1) . " * Add UIKIT Components"; - $ukit[] = $this->_t(1) . " **/"; - $ukit[] = $this->_t(1) . "public static \$uikit = false;"; + $ukit[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $ukit[] = Indent::_(1) . " * UIKIT Component Classes"; + $ukit[] = Indent::_(1) . " **/"; + $ukit[] = Indent::_(1) . "public static \$uk_components = array("; + $ukit[] = Indent::_(3) . "'data-uk-grid' => array("; + $ukit[] = Indent::_(4) . "'grid' ),"; + $ukit[] = Indent::_(3) . "'uk-accordion' => array("; + $ukit[] = Indent::_(4) . "'accordion' ),"; + $ukit[] = Indent::_(3) . "'uk-autocomplete' => array("; + $ukit[] = Indent::_(4) . "'autocomplete' ),"; + $ukit[] = Indent::_(3) . "'data-uk-datepicker' => array("; + $ukit[] = Indent::_(4) . "'datepicker' ),"; + $ukit[] = Indent::_(3) . "'uk-form-password' => array("; + $ukit[] = Indent::_(4) . "'form-password' ),"; + $ukit[] = Indent::_(3) . "'uk-form-select' => array("; + $ukit[] = Indent::_(4) . "'form-select' ),"; + $ukit[] = Indent::_(3) . "'data-uk-htmleditor' => array("; + $ukit[] = Indent::_(4) . "'htmleditor' ),"; + $ukit[] = Indent::_(3) . "'data-uk-lightbox' => array("; + $ukit[] = Indent::_(4) . "'lightbox' ),"; + $ukit[] = Indent::_(3) . "'uk-nestable' => array("; + $ukit[] = Indent::_(4) . "'nestable' ),"; + $ukit[] = Indent::_(3) . "'UIkit.notify' => array("; + $ukit[] = Indent::_(4) . "'notify' ),"; + $ukit[] = Indent::_(3) . "'data-uk-parallax' => array("; + $ukit[] = Indent::_(4) . "'parallax' ),"; + $ukit[] = Indent::_(3) . "'uk-search' => array("; + $ukit[] = Indent::_(4) . "'search' ),"; + $ukit[] = Indent::_(3) . "'uk-slider' => array("; + $ukit[] = Indent::_(4) . "'slider' ),"; + $ukit[] = Indent::_(3) . "'uk-slideset' => array("; + $ukit[] = Indent::_(4) . "'slideset' ),"; + $ukit[] = Indent::_(3) . "'uk-slideshow' => array("; + $ukit[] = Indent::_(4) . "'slideshow',"; + $ukit[] = Indent::_(4) . "'slideshow-fx' ),"; + $ukit[] = Indent::_(3) . "'uk-sortable' => array("; + $ukit[] = Indent::_(4) . "'sortable' ),"; + $ukit[] = Indent::_(3) . "'data-uk-sticky' => array("; + $ukit[] = Indent::_(4) . "'sticky' ),"; + $ukit[] = Indent::_(3) . "'data-uk-timepicker' => array("; + $ukit[] = Indent::_(4) . "'timepicker' ),"; + $ukit[] = Indent::_(3) . "'data-uk-tooltip' => array("; + $ukit[] = Indent::_(4) . "'tooltip' ),"; + $ukit[] = Indent::_(3) . "'uk-placeholder' => array("; + $ukit[] = Indent::_(4) . "'placeholder' ),"; + $ukit[] = Indent::_(3) . "'uk-dotnav' => array("; + $ukit[] = Indent::_(4) . "'dotnav' ),"; + $ukit[] = Indent::_(3) . "'uk-slidenav' => array("; + $ukit[] = Indent::_(4) . "'slidenav' ),"; + $ukit[] = Indent::_(3) . "'uk-form' => array("; + $ukit[] = Indent::_(4) . "'form-advanced' ),"; + $ukit[] = Indent::_(3) . "'uk-progress' => array("; + $ukit[] = Indent::_(4) . "'progress' ),"; + $ukit[] = Indent::_(3) . "'upload-drop' => array("; + $ukit[] = Indent::_(4) . "'upload', 'form-file' )"; + $ukit[] = Indent::_(3) . ");"; + $ukit[] = PHP_EOL . Indent::_(1) . "/**"; + $ukit[] = Indent::_(1) . " * Add UIKIT Components"; + $ukit[] = Indent::_(1) . " **/"; + $ukit[] = Indent::_(1) . "public static \$uikit = false;"; $ukit[] = ""; - $ukit[] = $this->_t(1) . "/**"; - $ukit[] = $this->_t(1) . " * Get UIKIT Components"; - $ukit[] = $this->_t(1) . " **/"; - $ukit[] = $this->_t(1) + $ukit[] = Indent::_(1) . "/**"; + $ukit[] = Indent::_(1) . " * Get UIKIT Components"; + $ukit[] = Indent::_(1) . " **/"; + $ukit[] = Indent::_(1) . "public static function getUikitComp(\$content,\$classes = array())"; - $ukit[] = $this->_t(1) . "{"; - $ukit[] = $this->_t(2) + $ukit[] = Indent::_(1) . "{"; + $ukit[] = Indent::_(2) . "if (strpos(\$content,'class=\"uk-') !== false)"; - $ukit[] = $this->_t(2) . "{"; - $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " reset"; - $ukit[] = $this->_t(3) . "\$temp = array();"; - $ukit[] = $this->_t(3) + $ukit[] = Indent::_(2) . "{"; + $ukit[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " reset"; + $ukit[] = Indent::_(3) . "\$temp = array();"; + $ukit[] = Indent::_(3) . "foreach (self::\$uk_components as \$looking => \$add)"; - $ukit[] = $this->_t(3) . "{"; - $ukit[] = $this->_t(4) + $ukit[] = Indent::_(3) . "{"; + $ukit[] = Indent::_(4) . "if (strpos(\$content,\$looking) !== false)"; - $ukit[] = $this->_t(4) . "{"; - $ukit[] = $this->_t(5) . "\$temp[] = \$looking;"; - $ukit[] = $this->_t(4) . "}"; - $ukit[] = $this->_t(3) . "}"; - $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $ukit[] = Indent::_(4) . "{"; + $ukit[] = Indent::_(5) . "\$temp[] = \$looking;"; + $ukit[] = Indent::_(4) . "}"; + $ukit[] = Indent::_(3) . "}"; + $ukit[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " make sure uikit is loaded to config"; - $ukit[] = $this->_t(3) + $ukit[] = Indent::_(3) . "if (strpos(\$content,'class=\"uk-') !== false)"; - $ukit[] = $this->_t(3) . "{"; - $ukit[] = $this->_t(4) . "self::\$uikit = true;"; - $ukit[] = $this->_t(3) . "}"; - $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $ukit[] = Indent::_(3) . "{"; + $ukit[] = Indent::_(4) . "self::\$uikit = true;"; + $ukit[] = Indent::_(3) . "}"; + $ukit[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " sorter"; - $ukit[] = $this->_t(3) . "if (self::checkArray(\$temp))"; - $ukit[] = $this->_t(3) . "{"; - $ukit[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $ukit[] = Indent::_(3) . "if (self::checkArray(\$temp))"; + $ukit[] = Indent::_(3) . "{"; + $ukit[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " merger"; - $ukit[] = $this->_t(4) . "if (self::checkArray(\$classes))"; - $ukit[] = $this->_t(4) . "{"; - $ukit[] = $this->_t(5) + $ukit[] = Indent::_(4) . "if (self::checkArray(\$classes))"; + $ukit[] = Indent::_(4) . "{"; + $ukit[] = Indent::_(5) . "\$newTemp = array_merge(\$temp,\$classes);"; - $ukit[] = $this->_t(5) . "\$temp = array_unique(\$newTemp);"; - $ukit[] = $this->_t(4) . "}"; - $ukit[] = $this->_t(4) . "return \$temp;"; - $ukit[] = $this->_t(3) . "}"; - $ukit[] = $this->_t(2) . "}"; - $ukit[] = $this->_t(2) . "if (self::checkArray(\$classes))"; - $ukit[] = $this->_t(2) . "{"; - $ukit[] = $this->_t(3) . "return \$classes;"; - $ukit[] = $this->_t(2) . "}"; - $ukit[] = $this->_t(2) . "return false;"; - $ukit[] = $this->_t(1) . "}"; + $ukit[] = Indent::_(5) . "\$temp = array_unique(\$newTemp);"; + $ukit[] = Indent::_(4) . "}"; + $ukit[] = Indent::_(4) . "return \$temp;"; + $ukit[] = Indent::_(3) . "}"; + $ukit[] = Indent::_(2) . "}"; + $ukit[] = Indent::_(2) . "if (self::checkArray(\$classes))"; + $ukit[] = Indent::_(2) . "{"; + $ukit[] = Indent::_(3) . "return \$classes;"; + $ukit[] = Indent::_(2) . "}"; + $ukit[] = Indent::_(2) . "return false;"; + $ukit[] = Indent::_(1) . "}"; // return the help methods return implode(PHP_EOL, $ukit); @@ -4293,26 +4227,25 @@ class Interpretation extends Fields if (2 == $this->uikit || 1 == $this->uikit) { // build uikit get method - $method .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $method .= PHP_EOL . $this->_t(1) + $method .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $method .= PHP_EOL . Indent::_(1) . " * Get the uikit needed components"; - $method .= PHP_EOL . $this->_t(1) . " *"; - $method .= PHP_EOL . $this->_t(1) + $method .= PHP_EOL . Indent::_(1) . " *"; + $method .= PHP_EOL . Indent::_(1) . " * @return mixed An array of objects on success."; - $method .= PHP_EOL . $this->_t(1) . " *"; - $method .= PHP_EOL . $this->_t(1) . " */"; - $method .= PHP_EOL . $this->_t(1) + $method .= PHP_EOL . Indent::_(1) . " *"; + $method .= PHP_EOL . Indent::_(1) . " */"; + $method .= PHP_EOL . Indent::_(1) . "public function getUikitComp()"; - $method .= PHP_EOL . $this->_t(1) . "{"; - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . Indent::_(1) . "{"; + $method .= PHP_EOL . Indent::_(2) . "if (isset(\$this->uikitComp) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$this->uikitComp))"; - $method .= PHP_EOL . $this->_t(2) . "{"; - $method .= PHP_EOL . $this->_t(3) . "return \$this->uikitComp;"; - $method .= PHP_EOL . $this->_t(2) . "}"; - $method .= PHP_EOL . $this->_t(2) . "return false;"; - $method .= PHP_EOL . $this->_t(1) . "}"; + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$this->uikitComp))"; + $method .= PHP_EOL . Indent::_(2) . "{"; + $method .= PHP_EOL . Indent::_(3) . "return \$this->uikitComp;"; + $method .= PHP_EOL . Indent::_(2) . "}"; + $method .= PHP_EOL . Indent::_(2) . "return false;"; + $method .= PHP_EOL . Indent::_(1) . "}"; } return $method; @@ -4324,16 +4257,16 @@ class Interpretation extends Fields if (StringHelper::check($body)) { // build custom method - $method .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $method .= PHP_EOL . $this->_t(1) . " * Custom Method"; - $method .= PHP_EOL . $this->_t(1) . " *"; - $method .= PHP_EOL . $this->_t(1) . " * @return " . $type; - $method .= PHP_EOL . $this->_t(1) . " *"; - $method .= PHP_EOL . $this->_t(1) . " */"; - $method .= PHP_EOL . $this->_t(1) . "public function " . $nAme + $method .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $method .= PHP_EOL . Indent::_(1) . " * Custom Method"; + $method .= PHP_EOL . Indent::_(1) . " *"; + $method .= PHP_EOL . Indent::_(1) . " * @return " . $type; + $method .= PHP_EOL . Indent::_(1) . " *"; + $method .= PHP_EOL . Indent::_(1) . " */"; + $method .= PHP_EOL . Indent::_(1) . "public function " . $nAme . "()"; - $method .= PHP_EOL . $this->_t(1) . "{" . $body; - $method .= PHP_EOL . $this->_t(1) . "}"; + $method .= PHP_EOL . Indent::_(1) . "{" . $body; + $method .= PHP_EOL . Indent::_(1) . "}"; } return $method; @@ -4362,87 +4295,84 @@ class Interpretation extends Fields )) !== false) { // build custom method - $methods .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $methods .= PHP_EOL . $this->_t(1) + $methods .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $methods .= PHP_EOL . Indent::_(1) . " * Method to get an array of " . $default['name'] . " Objects."; - $methods .= PHP_EOL . $this->_t(1) . " *"; - $methods .= PHP_EOL . $this->_t(1) + $methods .= PHP_EOL . Indent::_(1) . " *"; + $methods .= PHP_EOL . Indent::_(1) . " * @return mixed An array of " . $default['name'] . " Objects on success, false on failure."; - $methods .= PHP_EOL . $this->_t(1) . " *"; - $methods .= PHP_EOL . $this->_t(1) . " */"; - $methods .= PHP_EOL . $this->_t(1) + $methods .= PHP_EOL . Indent::_(1) . " *"; + $methods .= PHP_EOL . Indent::_(1) . " */"; + $methods .= PHP_EOL . Indent::_(1) . "public function get" . $default['methodName'] . "(\$" . $default['on_field'] . ")"; - $methods .= PHP_EOL . $this->_t(1) . "{" . $this->hhh - . "CRYPT" . $this->hhh; - $methods .= PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $methods .= PHP_EOL . Indent::_(1) . "{" . Placefix::_h("CRYPT") ; + $methods .= PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Get a db connection."; - $methods .= PHP_EOL . $this->_t(2) + $methods .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDbo();"; - $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; - $methods .= PHP_EOL . $this->_t(2) + $methods .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; - $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Get from " + $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Get from " . $get['selection']['table'] . " as " . $default['as']; - $methods .= PHP_EOL . $this->_t(2) + $methods .= PHP_EOL . Indent::_(2) . $get['selection']['select']; - $methods .= PHP_EOL . $this->_t(2) . '$query->from(' + $methods .= PHP_EOL . Indent::_(2) . '$query->from(' . $get['selection']['from'] . ');'; // set the string if ($get['operator'] === 'IN' || $get['operator'] === 'NOT IN') { - $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Check if \$" + $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Check if \$" . $default['on_field'] . " is an array with values."; - $methods .= PHP_EOL . $this->_t(2) . "\$array = (" - . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + $methods .= PHP_EOL . Indent::_(2) . "\$array = (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$" . $default['on_field'] . ", true)) ? json_decode(\$" . $default['on_field'] . ",true) : \$" . $default['on_field'] . ";"; - $methods .= PHP_EOL . $this->_t(2) + $methods .= PHP_EOL . Indent::_(2) . "if (isset(\$array) && " - . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$array, true))"; - $methods .= PHP_EOL . $this->_t(2) . "{"; - $methods .= PHP_EOL . $this->_t(3) + $methods .= PHP_EOL . Indent::_(2) . "{"; + $methods .= PHP_EOL . Indent::_(3) . "\$query->where('" . $get['join_field'] . " " . $get['operator'] . " (' . implode(',', \$array) . ')');"; - $methods .= PHP_EOL . $this->_t(2) . "}"; - $methods .= PHP_EOL . $this->_t(2) . "else"; - $methods .= PHP_EOL . $this->_t(2) . "{"; - $methods .= PHP_EOL . $this->_t(3) + $methods .= PHP_EOL . Indent::_(2) . "}"; + $methods .= PHP_EOL . Indent::_(2) . "else"; + $methods .= PHP_EOL . Indent::_(2) . "{"; + $methods .= PHP_EOL . Indent::_(3) . "return false;"; - $methods .= PHP_EOL . $this->_t(2) . "}"; + $methods .= PHP_EOL . Indent::_(2) . "}"; } else { - $methods .= PHP_EOL . $this->_t(2) + $methods .= PHP_EOL . Indent::_(2) . "\$query->where('" . $get['join_field'] . " " . $get['operator'] . " ' . \$db->quote(\$" . $default['on_field'] . "));"; } // check if other queries should be loaded $queryChecker - = (isset($this->otherQuery[$this->target][$default['code']][$default['as']]) + = (isset($this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$default['as']]) && ArrayHelper::check( - $this->otherQuery[$this->target][$default['code']][$default['as']] + $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$default['as']] )) - ? $this->otherQuery[$this->target][$default['code']][$default['as']] + ? $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$default['as']] : ''; if (ArrayHelper::check($queryChecker)) { @@ -4452,13 +4382,13 @@ class Interpretation extends Fields } } // add any other filter that was set - if (isset($this->otherFilter[$this->target][$default['code']][$default['as']]) + if (isset($this->otherFilter[CFactory::_('Config')->build_target][$default['code']][$default['as']]) && ArrayHelper::check( - $this->otherFilter[$this->target][$default['code']][$default['as']] + $this->otherFilter[CFactory::_('Config')->build_target][$default['code']][$default['as']] )) { foreach ( - $this->otherFilter[$this->target][$default['code']][$default['as']] + $this->otherFilter[CFactory::_('Config')->build_target][$default['code']][$default['as']] as $field => $string ) { @@ -4466,13 +4396,13 @@ class Interpretation extends Fields } } // add any other where that was set - if (isset($this->otherWhere[$this->target][$default['code']][$default['as']]) + if (isset($this->otherWhere[CFactory::_('Config')->build_target][$default['code']][$default['as']]) && ArrayHelper::check( - $this->otherWhere[$this->target][$default['code']][$default['as']] + $this->otherWhere[CFactory::_('Config')->build_target][$default['code']][$default['as']] )) { foreach ( - $this->otherWhere[$this->target][$default['code']][$default['as']] + $this->otherWhere[CFactory::_('Config')->build_target][$default['code']][$default['as']] as $field => $string ) { @@ -4480,13 +4410,13 @@ class Interpretation extends Fields } } // add any other order that was set - if (isset($this->otherOrder[$this->target][$default['code']][$default['as']]) + if (isset($this->otherOrder[CFactory::_('Config')->build_target][$default['code']][$default['as']]) && ArrayHelper::check( - $this->otherOrder[$this->target][$default['code']][$default['as']] + $this->otherOrder[CFactory::_('Config')->build_target][$default['code']][$default['as']] )) { foreach ( - $this->otherOrder[$this->target][$default['code']][$default['as']] + $this->otherOrder[CFactory::_('Config')->build_target][$default['code']][$default['as']] as $field => $string ) { @@ -4494,33 +4424,33 @@ class Interpretation extends Fields } } // add any other grouping that was set - if (isset($this->otherGroup[$this->target][$default['code']][$default['as']]) + if (isset($this->otherGroup[CFactory::_('Config')->build_target][$default['code']][$default['as']]) && ArrayHelper::check( - $this->otherGroup[$this->target][$default['code']][$default['as']] + $this->otherGroup[CFactory::_('Config')->build_target][$default['code']][$default['as']] )) { foreach ( - $this->otherGroup[$this->target][$default['code']][$default['as']] + $this->otherGroup[CFactory::_('Config')->build_target][$default['code']][$default['as']] as $field => $string ) { $methods .= $string; } } - $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Reset the query using our newly populated query object."; - $methods .= PHP_EOL . $this->_t(2) + $methods .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);"; - $methods .= PHP_EOL . $this->_t(2) . "\$db->execute();"; - $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $methods .= PHP_EOL . Indent::_(2) . "\$db->execute();"; + $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " check if there was data returned"; - $methods .= PHP_EOL . $this->_t(2) + $methods .= PHP_EOL . Indent::_(2) . "if (\$db->getNumRows())"; - $methods .= PHP_EOL . $this->_t(2) . "{"; + $methods .= PHP_EOL . Indent::_(2) . "{"; // set dispatcher placeholder - $methods .= $this->hhh . "DISPATCHER" . $this->hhh; + $methods .= Placefix::_h("DISPATCHER") ; // set decoding of needed fields if (isset($this->siteFieldData['decode'][$default['code']][$get['key']][$default['as']])) { @@ -4528,10 +4458,10 @@ class Interpretation extends Fields = $this->siteFieldData['decode'][$default['code']][$get['key']][$default['as']]; } // also filter fields if needed - if (isset($this->siteFieldDecodeFilter[$this->target][$default['code']][$get['key']][$default['as']])) + if (isset($this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$default['code']][$get['key']][$default['as']])) { $decodeFilter - = $this->siteFieldDecodeFilter[$this->target][$default['code']][$get['key']][$default['as']]; + = $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$default['code']][$get['key']][$default['as']]; } // set uikit checkers on needed fields if (isset($this->siteFieldData['uikit'][$default['code']][$get['key']][$default['as']])) @@ -4546,16 +4476,14 @@ class Interpretation extends Fields = $this->siteFieldData['textareas'][$default['code']][$get['key']][$default['as']]; } // set joined values - $placeholders = array($this->hhh . 'TAB' - . $this->hhh => $this->_t(2), - $this->hhh . 'STRING' - . $this->hhh => '$item'); + $placeholders = array(Placefix::_h('TAB') => Indent::_(2), + Placefix::_h('STRING') => '$item'); $joinedChecker - = (isset($this->otherJoin[$this->target][$default['code']][$default['as']]) + = (isset($this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$default['as']]) && ArrayHelper::check( - $this->otherJoin[$this->target][$default['code']][$default['as']] + $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$default['as']] )) - ? $this->otherJoin[$this->target][$default['code']][$default['as']] + ? $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$default['as']] : ''; if ((isset($decodeChecker) && ArrayHelper::check( @@ -4586,7 +4514,7 @@ class Interpretation extends Fields // also filter fields if needed $decoder = $this->setCustomViewFieldDecode( $get, $decodeChecker, '$item', - $default['code'], $this->_t(2) + $default['code'], Indent::_(2) ); } $decoder_filter = ''; @@ -4598,7 +4526,7 @@ class Interpretation extends Fields $decoder_filter = $this->setCustomViewFieldDecodeFilter( $get, $decodeFilter, '$item', '$items[$nr]', - $default['code'], $this->_t(2) + $default['code'], Indent::_(2) ); } $contentprepare = ''; @@ -4610,7 +4538,7 @@ class Interpretation extends Fields $contentprepare = $this->setCustomViewFieldonContentPrepareChecker( $get, $contentprepareChecker, '$item', - $default['code'], $this->_t(2) + $default['code'], Indent::_(2) ); } $uikit = ''; @@ -4621,7 +4549,7 @@ class Interpretation extends Fields { $uikit = $this->setCustomViewFieldUikitChecker( $get, $uikitChecker, '$item', - $default['code'], $this->_t(2) + $default['code'], Indent::_(2) ); } $joine = ''; @@ -4631,7 +4559,7 @@ class Interpretation extends Fields { foreach ($joinedChecker as $joinedString) { - $joine .= $this->setPlaceholders( + $joine .= CFactory::_('Placeholder')->update( $joinedString, $placeholders ); } @@ -4646,14 +4574,14 @@ class Interpretation extends Fields ) || StringHelper::check($joine)) { - $methods .= PHP_EOL . $this->_t(3) + $methods .= PHP_EOL . Indent::_(3) . "\$items = \$db->loadObjectList();"; - $methods .= PHP_EOL . PHP_EOL . $this->_t(3) - . "//" . $this->setLine(__LINE__) + $methods .= PHP_EOL . PHP_EOL . Indent::_(3) + . "//" . Line::_(__Line__, __Class__) . " Convert the parameter fields into objects."; - $methods .= PHP_EOL . $this->_t(3) + $methods .= PHP_EOL . Indent::_(3) . "foreach (\$items as \$nr => &\$item)"; - $methods .= PHP_EOL . $this->_t(3) . "{"; + $methods .= PHP_EOL . Indent::_(3) . "{"; if (StringHelper::check( $decoder )) @@ -4680,28 +4608,27 @@ class Interpretation extends Fields { $methods .= $joine; } - $methods .= PHP_EOL . $this->_t(3) . "}"; - $methods .= PHP_EOL . $this->_t(3) + $methods .= PHP_EOL . Indent::_(3) . "}"; + $methods .= PHP_EOL . Indent::_(3) . "return \$items;"; } else { - $methods .= PHP_EOL . $this->_t(3) + $methods .= PHP_EOL . Indent::_(3) . "return \$db->loadObjectList();"; } } else { - $methods .= PHP_EOL . $this->_t(3) + $methods .= PHP_EOL . Indent::_(3) . "return \$db->loadObjectList();"; } - $methods .= PHP_EOL . $this->_t(2) . "}"; - $methods .= PHP_EOL . $this->_t(2) . "return false;"; - $methods .= PHP_EOL . $this->_t(1) . "}"; + $methods .= PHP_EOL . Indent::_(2) . "}"; + $methods .= PHP_EOL . Indent::_(2) . "return false;"; + $methods .= PHP_EOL . Indent::_(1) . "}"; // set the script if it was found - $Component = $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; $script = ''; foreach ($this->cryptionTypes as $cryptionType) { @@ -4710,17 +4637,17 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $script .= PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Get the " + $script .= PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(2) . "\$" + $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(2) . "\$" + $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);" . PHP_EOL; @@ -4740,16 +4667,16 @@ class Interpretation extends Fields as $block ) { - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . implode( - PHP_EOL . $this->_t(2), $block + PHP_EOL . Indent::_(2), $block ); } } } } $methods = str_replace( - $this->hhh . 'CRYPT' . $this->hhh, $script, $methods + Placefix::_h('CRYPT'), $script, $methods ); } } @@ -4757,20 +4684,19 @@ class Interpretation extends Fields if (StringHelper::check($methods)) { $methods = str_replace( - $this->hhh . 'CRYPT' . $this->hhh, '', $methods + Placefix::_h('CRYPT'), '', $methods ); } } } // only update if dispacher placholder is found - if (strpos($methods, $this->hhh . 'DISPATCHER' . $this->hhh) !== false) + if (strpos($methods, Placefix::_h('DISPATCHER')) !== false) { // check if the dispather should be added if (!isset($this->JEventDispatcher) || !ArrayHelper::check($this->JEventDispatcher)) { - $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' - . $this->hhh => ''); + $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => ''); } $methods = str_replace( array_keys($this->JEventDispatcher), @@ -4834,34 +4760,34 @@ class Interpretation extends Fields { if ($get->pagination == 1) { - $getItem = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $getItem = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get a db connection."; } else { - $getItem = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $getItem = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Make sure all records load, since no pagination allowed."; - $getItem .= PHP_EOL . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(2) . "\$this->setState('list.limit', 0);"; - $getItem .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $getItem .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get a db connection."; } - $getItem .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDbo();"; - $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Create a new query object."; - $getItem .= PHP_EOL . $this->_t(2) + $getItem .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDbo();"; + $getItem .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; + $getItem .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; // set main get query $getItem .= $this->setCustomViewQuery($get->main_get, $code); // check if there is any custom script $getItem .= $this->getCustomScriptBuilder( - $this->target . '_php_getlistquery', $code, '', - PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + CFactory::_('Config')->build_target . '_php_getlistquery', $code, '', + PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filtering.", true ); // setup filters @@ -4887,15 +4813,15 @@ class Interpretation extends Fields if ($return) { // return the query object - $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " return the query object" - . PHP_EOL . $this->_t(2) . "return \$query;"; + $getItem .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " return the query object" + . PHP_EOL . Indent::_(2) . "return \$query;"; } return $getItem; } - return PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + return PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . "add your custom code here."; } @@ -4914,24 +4840,23 @@ class Interpretation extends Fields $this->siteDecrypt[$cryptionType][$code] = false; } // set the component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; // start load the get item if (ObjectHelper::check($get)) { - $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $getItem .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Insure all item fields are adapted where needed."; - $getItem .= PHP_EOL . $this->_t(2) . "if (" . $Component + $getItem .= PHP_EOL . Indent::_(2) . "if (" . $Component . "Helper::checkArray(\$items))"; - $getItem .= PHP_EOL . $this->_t(2) . "{"; - $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; - $getItem .= PHP_EOL . $this->_t(3) + $getItem .= PHP_EOL . Indent::_(2) . "{"; + $getItem .= Placefix::_h("DISPATCHER") ; + $getItem .= PHP_EOL . Indent::_(3) . "foreach (\$items as \$nr => &\$item)"; - $getItem .= PHP_EOL . $this->_t(3) . "{"; - $getItem .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $getItem .= PHP_EOL . Indent::_(3) . "{"; + $getItem .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Always create a slug for sef URL's"; - $getItem .= PHP_EOL . $this->_t(4) + $getItem .= PHP_EOL . Indent::_(4) . "\$item->slug = (isset(\$item->alias) && isset(\$item->id)) ? \$item->id.':'.\$item->alias : \$item->id;"; if (isset($get->main_get) && ArrayHelper::check( @@ -4950,20 +4875,20 @@ class Interpretation extends Fields // set decoding of needed fields $getItem .= $this->setCustomViewFieldDecode( $main_get, $decodeChecker, "\$item", $code, - $this->_t(2) + Indent::_(2) ); } } // also filter fields if needed - if (isset($this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']])) + if (isset($this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']])) { $decodeFilter - = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]; + = $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']]; if (ArrayHelper::check($decodeFilter)) { $getItem .= $this->setCustomViewFieldDecodeFilter( $main_get, $decodeFilter, "\$item", - '$items[$nr]', $code, $this->_t(2) + '$items[$nr]', $code, Indent::_(2) ); } } @@ -4978,7 +4903,7 @@ class Interpretation extends Fields // set contentprepare checkers on needed fields $getItem .= $this->setCustomViewFieldonContentPrepareChecker( $main_get, $contentprepareChecker, "\$item", - $code, $this->_t(2) + $code, Indent::_(2) ); } } @@ -4991,7 +4916,7 @@ class Interpretation extends Fields // set uikit checkers on needed fields $getItem .= $this->setCustomViewFieldUikitChecker( $main_get, $uikitChecker, "\$item", $code, - $this->_t(2) + Indent::_(2) ); } } @@ -4999,7 +4924,7 @@ class Interpretation extends Fields } } // only update if dispacher placholder is found - if (strpos($getItem, $this->hhh . 'DISPATCHER' . $this->hhh) + if (strpos($getItem, Placefix::_h('DISPATCHER')) !== false) { // check if the dispather should be added @@ -5008,8 +4933,7 @@ class Interpretation extends Fields $this->JEventDispatcher )) { - $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' - . $this->hhh => ''); + $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => ''); } $getItem = str_replace( array_keys($this->JEventDispatcher), @@ -5018,11 +4942,11 @@ class Interpretation extends Fields } // setup Globals $getItem .= $this->setCustomViewGlobals( - $get->global, '$item', $asBucket, $this->_t(2) + $get->global, '$item', $asBucket, Indent::_(2) ); // setup the custom gets that returns multipal values $getItem .= $this->setCustomViewCustomJoin( - $get->custom_get, "\$item", $code, $asBucket, $this->_t(2) + $get->custom_get, "\$item", $code, $asBucket, Indent::_(2) ); // set calculations if ($get->addcalculation == 1) @@ -5032,16 +4956,16 @@ class Interpretation extends Fields ); if (ArrayHelper::check($get->php_calculation)) { - $_tmp = PHP_EOL . $this->_t(4) . implode( - PHP_EOL . $this->_t(4), $get->php_calculation + $_tmp = PHP_EOL . Indent::_(4) . implode( + PHP_EOL . Indent::_(4), $get->php_calculation ); - $getItem .= $this->setPlaceholders( - $_tmp, $this->placeholders + $getItem .= CFactory::_('Placeholder')->update( + $_tmp, CFactory::_('Placeholder')->active ); } } - $getItem .= PHP_EOL . $this->_t(3) . "}"; - $getItem .= PHP_EOL . $this->_t(2) . "}"; + $getItem .= PHP_EOL . Indent::_(3) . "}"; + $getItem .= PHP_EOL . Indent::_(2) . "}"; // remove empty foreach if (strlen($getItem) <= 100) { @@ -5057,16 +4981,16 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Get the " . $cryptionType + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType + $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType + $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; } elseif (isset( @@ -5082,8 +5006,8 @@ class Interpretation extends Fields . 'FieldModelInitiator'}[$code]['get'] as $block ) { - $script .= PHP_EOL . $this->_t(2) . implode( - PHP_EOL . $this->_t(2), $block + $script .= PHP_EOL . Indent::_(2) . implode( + PHP_EOL . Indent::_(2), $block ); } } @@ -5108,30 +5032,30 @@ class Interpretation extends Fields if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 2) { - $script .= PHP_EOL . $this->_t(2) . "//" - . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Load the filter form from xml."; - $script .= PHP_EOL . $this->_t(2) . "\$this->filterForm " + $script .= PHP_EOL . Indent::_(2) . "\$this->filterForm " . "= \$this->get('FilterForm');"; - $script .= PHP_EOL . $this->_t(2) . "//" - . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Load the active filters."; - $script .= PHP_EOL . $this->_t(2) . "\$this->activeFilters " + $script .= PHP_EOL . Indent::_(2) . "\$this->activeFilters " . "= \$this->get('ActiveFilters');"; } // get the default ordering values $default_ordering = $this->getListViewDefaultOrdering($nameListCode); // now add the default ordering - $script .= PHP_EOL . $this->_t(2) . "//" - . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Add the list ordering clause."; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$this->listOrder = \$this->escape(\$this->state->get('list.ordering', '" . $default_ordering['name'] . "'));"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$this->listDirn = \$this->escape(\$this->state->get('list.direction', '" . $default_ordering['direction'] . "'));"; @@ -5152,33 +5076,33 @@ class Interpretation extends Fields )) { // load the dispatcher - $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Initialise dispatcher."; - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . Indent::_(2) . "\$dispatcher = JEventDispatcher::getInstance();"; } if ($view['settings']->main_get->gettype == 1) { // for single views - $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Initialise variables."; - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . Indent::_(2) . "\$this->item = \$this->get('Item');"; } elseif ($view['settings']->main_get->gettype == 2) { // for list views - $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Initialise variables."; - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . Indent::_(2) . "\$this->items = \$this->get('Items');"; // only add if pagination is requered if ($view['settings']->main_get->pagination == 1) { - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . Indent::_(2) . "\$this->pagination = \$this->get('Pagination');"; } } @@ -5193,7 +5117,7 @@ class Interpretation extends Fields $custom_get_name = str_replace( 'get', '', $custom_get->getcustom ); - $method .= PHP_EOL . $this->_t(2) . "\$this->" + $method .= PHP_EOL . Indent::_(2) . "\$this->" . StringHelper::safe($custom_get_name) . " = \$this->get('" . $custom_get_name . "');"; } @@ -5208,79 +5132,77 @@ class Interpretation extends Fields $view['settings']->php_jview_display )) { - $_tmp = PHP_EOL . $this->_t(2) . implode( - PHP_EOL . $this->_t(2), + $_tmp = PHP_EOL . Indent::_(2) . implode( + PHP_EOL . Indent::_(2), $view['settings']->php_jview_display ); - $method .= $this->setPlaceholders( - $_tmp, $this->placeholders + $method .= CFactory::_('Placeholder')->update( + $_tmp, CFactory::_('Placeholder')->active ); } } - if ('site' === $this->target) + if ('site' === CFactory::_('Config')->build_target) { - $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Set the toolbar"; - $method .= PHP_EOL . $this->_t(2) . "\$this->addToolBar();"; - $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " set the document"; - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Set the toolbar"; + $method .= PHP_EOL . Indent::_(2) . "\$this->addToolBar();"; + $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " set the document"; + $method .= PHP_EOL . Indent::_(2) . "\$this->_prepareDocument();"; } - elseif ('custom_admin' === $this->target) + elseif ('custom_admin' === CFactory::_('Config')->build_target) { - $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " We don't need toolbar in the modal window."; - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . Indent::_(2) . "if (\$this->getLayout() !== 'modal')"; - $method .= PHP_EOL . $this->_t(2) . "{"; - $method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . Indent::_(2) . "{"; + $method .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " add the tool bar"; - $method .= PHP_EOL . $this->_t(3) . "\$this->addToolBar();"; - $method .= PHP_EOL . $this->_t(2) . "}"; - $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " set the document"; - $method .= PHP_EOL . $this->_t(2) . "\$this->setDocument();"; + $method .= PHP_EOL . Indent::_(3) . "\$this->addToolBar();"; + $method .= PHP_EOL . Indent::_(2) . "}"; + $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " set the document"; + $method .= PHP_EOL . Indent::_(2) . "\$this->setDocument();"; } - $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Check for errors."; - $method .= PHP_EOL . $this->_t(2) + $method .= PHP_EOL . Indent::_(2) . "if (count(\$errors = \$this->get('Errors')))"; - $method .= PHP_EOL . $this->_t(2) . "{"; - $method .= PHP_EOL . $this->_t(3) + $method .= PHP_EOL . Indent::_(2) . "{"; + $method .= PHP_EOL . Indent::_(3) . "throw new Exception(implode(PHP_EOL, \$errors), 500);"; - $method .= PHP_EOL . $this->_t(2) . "}"; + $method .= PHP_EOL . Indent::_(2) . "}"; // add events if needed if ($view['settings']->main_get->gettype == 1 && ArrayHelper::check( $view['settings']->main_get->plugin_events )) { - $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Process the content plugins."; - $method .= PHP_EOL . $this->_t(2) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkObject(\$this->item))"; - $method .= PHP_EOL . $this->_t(2) . "{"; - $method .= PHP_EOL . $this->_t(3) + $method .= PHP_EOL . Indent::_(2) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$this->item))"; + $method .= PHP_EOL . Indent::_(2) . "{"; + $method .= PHP_EOL . Indent::_(3) . "JPluginHelper::importPlugin('content');"; - $method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Setup Event Object."; - $method .= PHP_EOL . $this->_t(3) + $method .= PHP_EOL . Indent::_(3) . "\$this->item->event = new stdClass;"; - $method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $method .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Check if item has params, or pass global params"; - $method .= PHP_EOL . $this->_t(3) + $method .= PHP_EOL . Indent::_(3) . "\$params = (isset(\$this->item->params) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$this->item->params)) ? json_decode(\$this->item->params) : \$this->params;"; // load the defaults foreach ( @@ -5291,28 +5213,28 @@ class Interpretation extends Fields if ('onContentPrepare' === $plugin_event) { // TODO the onContentPrepare already gets triggered on the fields of its relation - // $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " onContentPrepare Event Trigger."; - // $method .= PHP_EOL . $this->_t(2) . "\$dispatcher->trigger('onContentPrepare', array ('com_" . Config::get('component_code_name') . ".article', &\$this->item, &\$this->params, 0));"; + // $method .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " onContentPrepare Event Trigger."; + // $method .= PHP_EOL . Indent::_(2) . "\$dispatcher->trigger('onContentPrepare', array ('com_" . CFactory::_('Config')->component_code_name . ".article', &\$this->item, &\$this->params, 0));"; } else { - $method .= PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " " . $plugin_event + $method .= PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " " . $plugin_event . " Event Trigger."; - $method .= PHP_EOL . $this->_t(3) + $method .= PHP_EOL . Indent::_(3) . "\$results = \$dispatcher->trigger('" . $plugin_event . "', array('com_" - . Config::get('component_code_name') . "." + . CFactory::_('Config')->component_code_name . "." . $view['settings']->context . "', &\$this->item, &\$params, 0));"; - $method .= PHP_EOL . $this->_t(3) + $method .= PHP_EOL . Indent::_(3) . '$this->item->event->' . $plugin_event . ' = trim(implode("\n", $results));'; } } - $method .= PHP_EOL . $this->_t(2) . "}"; + $method .= PHP_EOL . Indent::_(2) . "}"; } - $method .= PHP_EOL . PHP_EOL . $this->_t(2) + $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "parent::display(\$tpl);"; } @@ -5322,190 +5244,186 @@ class Interpretation extends Fields public function setPrepareDocument(&$view) { // fix just incase we missed it somewhere - $tmp = $this->lang; - if ('site' === $this->target) + $tmp = CFactory::_('Config')->lang_target; + if ('site' === CFactory::_('Config')->build_target) { - $this->lang = 'site'; + CFactory::_('Config')->lang_target = 'site'; } else { - $this->lang = 'admin'; + CFactory::_('Config')->lang_target = 'admin'; } // ensure correct target is set - $TARGET = StringHelper::safe($this->target, 'U'); + $TARGET = StringHelper::safe(CFactory::_('Config')->build_target, 'U'); // set libraries $TARGET.'_LIBRARIES_LOADER - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_LIBRARIES_LOADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_LIBRARIES_LOADER' )] = $this->setLibrariesLoader($view); // set uikit $TARGET.'_UIKIT_LOADER - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_UIKIT_LOADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_UIKIT_LOADER' )] = $this->setUikitLoader($view); // set Google Charts $TARGET.'_GOOGLECHART_LOADER - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_GOOGLECHART_LOADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_GOOGLECHART_LOADER' )] = $this->setGoogleChartLoader($view); // set Footable FOOTABLE_LOADER - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_FOOTABLE_LOADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_FOOTABLE_LOADER' )] = $this->setFootableScriptsLoader($view); // set metadata DOCUMENT_METADATA - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_DOCUMENT_METADATA' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_DOCUMENT_METADATA' )] = $this->setDocumentMetadata($view); // set custom php scripting DOCUMENT_CUSTOM_PHP - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_DOCUMENT_CUSTOM_PHP' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_DOCUMENT_CUSTOM_PHP' )] = $this->setDocumentCustomPHP($view); // set custom css DOCUMENT_CUSTOM_CSS - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_DOCUMENT_CUSTOM_CSS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_DOCUMENT_CUSTOM_CSS' )] = $this->setDocumentCustomCSS($view); // set custom javascript DOCUMENT_CUSTOM_JS - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_DOCUMENT_CUSTOM_JS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_DOCUMENT_CUSTOM_JS' )] = $this->setDocumentCustomJS($view); // set custom css file VIEWCSS - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_VIEWCSS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_VIEWCSS' )] = $this->setCustomCSS($view); // incase no buttons are found - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_JAVASCRIPT_FOR_BUTTONS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_JAVASCRIPT_FOR_BUTTONS')] = ''; // set the custom buttons CUSTOM_BUTTONS - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_CUSTOM_BUTTONS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS' )] = $this->setCustomButtons($view); // see if we should add get modules to the view.html - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_GET_MODULE' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_GET_MODULE' )] = $this->setGetModules($view, $TARGET); // set a JavaScript file if needed - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_LIBRARIES_LOADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_LIBRARIES_LOADER' )] .= $this->setJavaScriptFile($view, $TARGET); // fix just incase we missed it somewhere - $this->lang = $tmp; + CFactory::_('Config')->lang_target = $tmp; } public function setGetModules($view, $TARGET) { - if (isset($this->getModule[$this->target][$view['settings']->code]) - && $this->getModule[$this->target][$view['settings']->code]) + if (isset($this->getModule[CFactory::_('Config')->build_target][$view['settings']->code]) + && $this->getModule[CFactory::_('Config')->build_target][$view['settings']->code]) { $addModule = array(); - $addModule[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $addModule[] = $this->_t(1) + $addModule[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $addModule[] = Indent::_(1) . " * Get the modules published in a position"; - $addModule[] = $this->_t(1) . " */"; - $addModule[] = $this->_t(1) + $addModule[] = Indent::_(1) . " */"; + $addModule[] = Indent::_(1) . "public function getModules(\$position, \$seperator = '', \$class = '')"; - $addModule[] = $this->_t(1) . "{"; - $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $addModule[] = Indent::_(1) . "{"; + $addModule[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set default"; - $addModule[] = $this->_t(2) . "\$found = false;"; - $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $addModule[] = Indent::_(2) . "\$found = false;"; + $addModule[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if we aleady have these modules loaded"; - $addModule[] = $this->_t(2) + $addModule[] = Indent::_(2) . "if (isset(\$this->setModules[\$position]))"; - $addModule[] = $this->_t(2) . "{"; - $addModule[] = $this->_t(3) . "\$found = true;"; - $addModule[] = $this->_t(2) . "}"; - $addModule[] = $this->_t(2) . "else"; - $addModule[] = $this->_t(2) . "{"; - $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addModule[] = Indent::_(2) . "{"; + $addModule[] = Indent::_(3) . "\$found = true;"; + $addModule[] = Indent::_(2) . "}"; + $addModule[] = Indent::_(2) . "else"; + $addModule[] = Indent::_(2) . "{"; + $addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " this is where you want to load your module position"; - $addModule[] = $this->_t(3) + $addModule[] = Indent::_(3) . "\$modules = JModuleHelper::getModules(\$position);"; - $addModule[] = $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + $addModule[] = Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$modules, true))"; - $addModule[] = $this->_t(3) . "{"; - $addModule[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $addModule[] = Indent::_(3) . "{"; + $addModule[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " set the place holder"; - $addModule[] = $this->_t(4) + $addModule[] = Indent::_(4) . "\$this->setModules[\$position] = array();"; - $addModule[] = $this->_t(4) . "foreach(\$modules as \$module)"; - $addModule[] = $this->_t(4) . "{"; - $addModule[] = $this->_t(5) + $addModule[] = Indent::_(4) . "foreach(\$modules as \$module)"; + $addModule[] = Indent::_(4) . "{"; + $addModule[] = Indent::_(5) . "\$this->setModules[\$position][] = JModuleHelper::renderModule(\$module);"; - $addModule[] = $this->_t(4) . "}"; - $addModule[] = $this->_t(4) . "\$found = true;"; - $addModule[] = $this->_t(3) . "}"; - $addModule[] = $this->_t(2) . "}"; - $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $addModule[] = Indent::_(4) . "}"; + $addModule[] = Indent::_(4) . "\$found = true;"; + $addModule[] = Indent::_(3) . "}"; + $addModule[] = Indent::_(2) . "}"; + $addModule[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if modules were found"; - $addModule[] = $this->_t(2) + $addModule[] = Indent::_(2) . "if (\$found && isset(\$this->setModules[\$position]) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$this->setModules[\$position]))"; - $addModule[] = $this->_t(2) . "{"; - $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addModule[] = Indent::_(2) . "{"; + $addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " set class"; - $addModule[] = $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkString(\$class))"; - $addModule[] = $this->_t(3) . "{"; - $addModule[] = $this->_t(4) + $addModule[] = Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$class))"; + $addModule[] = Indent::_(3) . "{"; + $addModule[] = Indent::_(4) . "\$class = ' class=\"'.\$class.'\" ';"; - $addModule[] = $this->_t(3) . "}"; - $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $addModule[] = Indent::_(3) . "}"; + $addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " set seperating return values"; - $addModule[] = $this->_t(3) . "switch(\$seperator)"; - $addModule[] = $this->_t(3) . "{"; - $addModule[] = $this->_t(4) . "case 'none':"; - $addModule[] = $this->_t(5) + $addModule[] = Indent::_(3) . "switch(\$seperator)"; + $addModule[] = Indent::_(3) . "{"; + $addModule[] = Indent::_(4) . "case 'none':"; + $addModule[] = Indent::_(5) . "return implode('', \$this->setModules[\$position]);"; - $addModule[] = $this->_t(5) . "break;"; - $addModule[] = $this->_t(4) . "case 'div':"; - $addModule[] = $this->_t(5) + $addModule[] = Indent::_(5) . "break;"; + $addModule[] = Indent::_(4) . "case 'div':"; + $addModule[] = Indent::_(5) . "return ''.implode('', \$this->setModules[\$position]).'';"; - $addModule[] = $this->_t(5) . "break;"; - $addModule[] = $this->_t(4) . "case 'list':"; - $addModule[] = $this->_t(5) + $addModule[] = Indent::_(5) . "break;"; + $addModule[] = Indent::_(4) . "case 'list':"; + $addModule[] = Indent::_(5) . "return '
  • '.implode('
  • ', \$this->setModules[\$position]).'
  • ';"; - $addModule[] = $this->_t(5) . "break;"; - $addModule[] = $this->_t(4) . "case 'array':"; - $addModule[] = $this->_t(4) . "case 'Array':"; - $addModule[] = $this->_t(5) + $addModule[] = Indent::_(5) . "break;"; + $addModule[] = Indent::_(4) . "case 'array':"; + $addModule[] = Indent::_(4) . "case 'Array':"; + $addModule[] = Indent::_(5) . "return \$this->setModules[\$position];"; - $addModule[] = $this->_t(5) . "break;"; - $addModule[] = $this->_t(4) . "default:"; - $addModule[] = $this->_t(5) + $addModule[] = Indent::_(5) . "break;"; + $addModule[] = Indent::_(4) . "default:"; + $addModule[] = Indent::_(5) . "return implode('
    ', \$this->setModules[\$position]);"; - $addModule[] = $this->_t(5) . "break;"; - $addModule[] = $this->_t(4); - $addModule[] = $this->_t(3) . "}"; - $addModule[] = $this->_t(2) . "}"; - $addModule[] = $this->_t(2) . "return false;"; - $addModule[] = $this->_t(1) . "}"; + $addModule[] = Indent::_(5) . "break;"; + $addModule[] = Indent::_(4); + $addModule[] = Indent::_(3) . "}"; + $addModule[] = Indent::_(2) . "}"; + $addModule[] = Indent::_(2) . "return false;"; + $addModule[] = Indent::_(1) . "}"; - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . $TARGET . '_GET_MODULE_JIMPORT' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_GET_MODULE_JIMPORT')] = PHP_EOL . "jimport('joomla.application.module.helper');"; return implode(PHP_EOL, $addModule); } - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET - . '_GET_MODULE_JIMPORT' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_GET_MODULE_JIMPORT')] = ''; return ''; @@ -5522,11 +5440,11 @@ class Interpretation extends Fields $view['settings']->php_document )) { - $_tmp = PHP_EOL . $this->_t(2) . implode( - PHP_EOL . $this->_t(2), $view['settings']->php_document + $_tmp = PHP_EOL . Indent::_(2) . implode( + PHP_EOL . Indent::_(2), $view['settings']->php_document ); - return $this->setPlaceholders($_tmp, $this->placeholders); + return CFactory::_('Placeholder')->update($_tmp, CFactory::_('Placeholder')->active); } } @@ -5538,7 +5456,7 @@ class Interpretation extends Fields // do not validate selection $validateSelection = 'false'; // ensure correct target is set - $TARGET = StringHelper::safe($this->target, 'U'); + $TARGET = StringHelper::safe(CFactory::_('Config')->build_target, 'U'); if (1 == $type || 2 == $type) { if (1 == $type) @@ -5550,11 +5468,11 @@ class Interpretation extends Fields $viewCodeName = $view['settings']->name_single_code; } // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET - . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] = ''; + $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_CONTROLLER' )] = ''; // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET - . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] = ''; + $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_METHOD' )] = ''; } elseif (3 == $type) { @@ -5562,12 +5480,12 @@ class Interpretation extends Fields $viewCodeName = $view['settings']->name_single_code; $viewsCodeName = $view['settings']->name_list_code; // set the custom buttons CUSTOM_BUTTONS_CONTROLLER_LIST - $this->fileContentDynamic[$viewsCodeName][$this->hhh . $TARGET - . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] + $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_CONTROLLER_LIST' )] = ''; // set the custom buttons CUSTOM_BUTTONS_METHOD_LIST - $this->fileContentDynamic[$viewsCodeName][$this->hhh . $TARGET - . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] + $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_METHOD_LIST' )] = ''; // validate selection $validateSelection = 'true'; @@ -5575,48 +5493,40 @@ class Interpretation extends Fields // reset buttons $buttons = array(); // if site add buttons to view - if ($this->target === 'site') + if (CFactory::_('Config')->build_target === 'site') { // set the custom buttons SITE_TOP_BUTTON - $this->fileContentDynamic[$viewCodeName][$this->hhh - . 'SITE_TOP_BUTTON' - . $this->hhh] + $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')] = ''; // set the custom buttons SITE_BOTTOM_BUTTON - $this->fileContentDynamic[$viewCodeName][$this->hhh - . 'SITE_BOTTOM_BUTTON' . $this->hhh] + $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')] = ''; // load into place switch ($view['settings']->button_position) { case 1: // set buttons to top right of the view - $this->fileContentDynamic[$viewCodeName][$this->hhh - . 'SITE_TOP_BUTTON' . $this->hhh] + $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')] = '
    toolbar->render(); ?>
    '; break; case 2: // set buttons to top left of the view - $this->fileContentDynamic[$viewCodeName][$this->hhh - . 'SITE_TOP_BUTTON' . $this->hhh] + $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')] = 'toolbar->render(); ?>'; break; case 3: // set buttons to buttom right of the view - $this->fileContentDynamic[$viewCodeName][$this->hhh - . 'SITE_BOTTOM_BUTTON' . $this->hhh] + $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')] = '
    toolbar->render(); ?>
    '; break; case 4: // set buttons to buttom left of the view - $this->fileContentDynamic[$viewCodeName][$this->hhh - . 'SITE_BOTTOM_BUTTON' . $this->hhh] + $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')] = 'toolbar->render(); ?>'; break; case 5: // set buttons to buttom left of the view - $this->placeholders[$this->bbb . 'SITE_TOOLBAR' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SITE_TOOLBAR')] = 'toolbar->render(); ?>'; break; } @@ -5629,13 +5539,12 @@ class Interpretation extends Fields || ($this->dynamicDashboardType === 'custom_admin_views' && $this->dynamicDashboard !== $viewCodeName)) { - $buttons[] = $tab . $this->_t(2) - . "//" . $this->setLine(__LINE__) . " add cpanel button"; - $buttons[] = $tab . $this->_t(2) + $buttons[] = $tab . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " add cpanel button"; + $buttons[] = $tab . Indent::_(2) . "JToolBarHelper::custom('" . $viewCodeName . "." . "dashboard', 'grid-2', '', 'COM_" - . $this->fileContentStatic[$this->hhh - . 'COMPONENT' . $this->hhh] + . $this->fileContentStatic[Placefix::_h('COMPONENT')] . "_DASH', false);"; } } @@ -5653,50 +5562,50 @@ class Interpretation extends Fields foreach ($view['settings']->custom_buttons as $custom_button) { // Load to lang - $keyLang = $this->langPrefix . '_' + $keyLang = CFactory::_('Config')->lang_prefix . '_' . StringHelper::safe( $custom_button['name'], 'U' ); $keyCode = StringHelper::safe( $custom_button['name'] ); - $this->setLangContent( - $this->lang, $keyLang, $custom_button['name'] + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $keyLang, $custom_button['name'] ); // load the button if (3 !== $type && ($custom_button['target'] != 2 - || $this->target === 'site')) + || CFactory::_('Config')->build_target === 'site')) { // add cpanel button TODO does not work well on site with permissions if ($custom_button['target'] == 2 - || $this->target === 'site') + || CFactory::_('Config')->build_target === 'site') { - $buttons[] = $this->_t(1) . $tab . $this->_t(1) + $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "if (\$this->user->authorise('" . $viewCodeName . "." . $keyCode . "', 'com_" - . Config::get('component_code_name') . "'))"; + . CFactory::_('Config')->component_code_name . "'))"; } else { - $buttons[] = $this->_t(1) . $tab . $this->_t(1) + $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "if (\$this->canDo->get('" . $viewCodeName . "." . $keyCode . "'))"; } - $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{"; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " add " + $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "{"; + $buttons[] = Indent::_(1) . $tab . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " add " . $custom_button['name'] . " button."; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) + $buttons[] = Indent::_(1) . $tab . Indent::_(2) . "JToolBarHelper::custom('" . $viewCodeName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . " custom-button-" . strtolower($custom_button['method']) . "', '', '" . $keyLang . "', false);"; - $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}"; + $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "}"; } // load the list button elseif (3 == $type && $custom_button['target'] != 1) @@ -5711,26 +5620,26 @@ class Interpretation extends Fields = array(); } $this->onlyFunctionButton[$viewsCodeName][] - = $this->_t( + = Indent::_( 1 ) . $tab . "if (\$this->user->authorise('" . $viewCodeName . "." . $keyCode . "', 'com_" - . Config::get('component_code_name') . "'))"; + . CFactory::_('Config')->component_code_name . "'))"; $this->onlyFunctionButton[$viewsCodeName][] - = $this->_t( + = Indent::_( 1 ) . $tab . "{"; $this->onlyFunctionButton[$viewsCodeName][] - = $this->_t( + = Indent::_( 1 - ) . $tab . $this->_t(1) . "//" . $this->setLine( - __LINE__ + ) . $tab . Indent::_(1) . "//" . Line::_( + __LINE__,__CLASS__ ) . " add " . $custom_button['name'] . " button."; $this->onlyFunctionButton[$viewsCodeName][] - = $this->_t( + = Indent::_( 1 - ) . $tab . $this->_t(1) + ) . $tab . Indent::_(1) . "JToolBarHelper::custom('" . $viewsCodeName . "." . $custom_button['method'] . "', '" @@ -5739,23 +5648,23 @@ class Interpretation extends Fields . "', '', '" . $keyLang . "', false);"; $this->onlyFunctionButton[$viewsCodeName][] - = $this->_t( + = Indent::_( 1 ) . $tab . "}"; } else { - $buttons[] = $this->_t(1) . $tab . $this->_t(1) + $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "if (\$this->user->authorise('" . $viewCodeName . "." . $keyCode . "', 'com_" - . Config::get('component_code_name') . "'))"; - $buttons[] = $this->_t(1) . $tab . $this->_t(1) + . CFactory::_('Config')->component_code_name . "'))"; + $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "{"; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) - . "//" . $this->setLine(__LINE__) . " add " + $buttons[] = Indent::_(1) . $tab . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " add " . $custom_button['name'] . " button."; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) + $buttons[] = Indent::_(1) . $tab . Indent::_(2) . "JToolBarHelper::custom('" . $viewsCodeName . "." . $custom_button['method'] . "', '" @@ -5764,7 +5673,7 @@ class Interpretation extends Fields . "', '', '" . $keyLang . "', '" . $validateSelection . "');"; - $buttons[] = $this->_t(1) . $tab . $this->_t(1) + $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "}"; } } @@ -5781,12 +5690,11 @@ class Interpretation extends Fields && $view['settings']->php_controller_list != '//') { // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewsCodeName][$this->hhh - . $TARGET - . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_CONTROLLER_LIST')] + = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $view['settings']->php_controller_list, - $this->placeholders + CFactory::_('Placeholder')->active ); } // load the model @@ -5797,12 +5705,11 @@ class Interpretation extends Fields && $view['settings']->php_model_list != '//') { // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewsCodeName][$this->hhh - . $TARGET - . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_METHOD_LIST')] + = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $view['settings']->php_model_list, - $this->placeholders + CFactory::_('Placeholder')->active ); } } @@ -5815,18 +5722,17 @@ class Interpretation extends Fields && $view['settings']->php_controller != '//') { // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewCodeName][$this->hhh - . $TARGET - . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_CONTROLLER')] + = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $view['settings']->php_controller, - $this->placeholders + CFactory::_('Placeholder')->active ); - if ('site' === $this->target) + if ('site' === CFactory::_('Config')->build_target) { // add the controller for this view // build the file - $target = array($this->target => $viewCodeName); + $target = array(CFactory::_('Config')->build_target => $viewCodeName); $this->buildDynamique($target, 'custom_form'); // GET_FORM_CUSTOM } @@ -5838,10 +5744,9 @@ class Interpretation extends Fields && $view['settings']->php_model != '//') { // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewCodeName][$this->hhh - . $TARGET - . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET + . '_CUSTOM_BUTTONS_METHOD')] + = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $view['settings']->php_model, $this->placeholders ); } @@ -5868,8 +5773,8 @@ class Interpretation extends Fields ) === false)) { // set the custom get form method JAVASCRIPT_FOR_BUTTONS - $this->fileContentDynamic[$viewCodeName][$this->hhh - . $TARGET . '_JAVASCRIPT_FOR_BUTTONS' . $this->hhh] + $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET + . '_JAVASCRIPT_FOR_BUTTONS')] = $this->setJavaScriptForButtons(); } // insure the form is added (only if no form exist) @@ -5878,7 +5783,7 @@ class Interpretation extends Fields $view['settings']->default, 'addCustomForm[$this->target][$viewCodeName] + $this->addCustomForm[CFactory::_('Config')->build_target][$viewCodeName] = true; } @@ -5892,10 +5797,10 @@ class Interpretation extends Fields { // add behavior.framework to insure Joomla function is on the page $script = array(); - $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Add the needed Javascript to insure that the buttons work."; - $script[] = $this->_t(2) . "JHtml::_('behavior.framework', true);"; - $script[] = $this->_t(2) + $script[] = Indent::_(2) . "JHtml::_('behavior.framework', true);"; + $script[] = Indent::_(2) . "\$this->document->addScriptDeclaration(\"Joomla.submitbutton = function(task){if (task == ''){ return false; } else { Joomla.submitform(task); return true; }}\");"; // return the script @@ -5924,7 +5829,7 @@ class Interpretation extends Fields { if (StringHelper::check($view['settings']->css)) { - return $this->setPlaceholders( + return CFactory::_('Placeholder')->update( $view['settings']->css, $this->placeholders ); } @@ -5944,20 +5849,20 @@ class Interpretation extends Fields $view['settings']->css_document )) { - $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Set the Custom CSS script to view" . PHP_EOL - . $this->_t(2) . '$this->document->addStyleDeclaration("'; - $cssDocument = PHP_EOL . $this->_t(3) . str_replace( + . Indent::_(2) . '$this->document->addStyleDeclaration("'; + $cssDocument = PHP_EOL . Indent::_(3) . str_replace( '"', '\"', implode( - PHP_EOL . $this->_t(3), + PHP_EOL . Indent::_(3), $view['settings']->css_document ) ); - return $script . $this->setPlaceholders( + return $script . CFactory::_('Placeholder')->update( $cssDocument, $this->placeholders - ) . PHP_EOL . $this->_t(2) . '");'; + ) . PHP_EOL . Indent::_(2) . '");'; } } @@ -5975,36 +5880,34 @@ class Interpretation extends Fields $created = $this->getCreatedDate($view); $modified = $this->getLastModifiedDate($view); // add file to view - $target = array($this->target => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $target = array(CFactory::_('Config')->build_target => $view['settings']->code); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'javascript_file', false, $config); // set path - if ('site' === $this->target) + if ('site' === CFactory::_('Config')->build_target) { - $path = '/components/com_' . Config::get('component_code_name') + $path = '/components/com_' . CFactory::_('Config')->component_code_name . '/assets/js/' . $view['settings']->code . '.js'; } else { $path = '/administrator/components/com_' - . Config::get('component_code_name') . '/assets/js/' + . CFactory::_('Config')->component_code_name . '/assets/js/' . $view['settings']->code . '.js'; } // add script to file - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . $TARGET . '_JAVASCRIPT_FILE' . $this->hhh] - = $this->setPlaceholders( + $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET + . '_JAVASCRIPT_FILE')] + = CFactory::_('Placeholder')->update( $view['settings']->javascript_file, $this->placeholders ); // add script to view - return PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ - ) . " Add View JavaScript File" . PHP_EOL . $this->_t(2) + return PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Add View JavaScript File" . PHP_EOL . Indent::_(2) . $this->setIncludeLibScript($path); } @@ -6022,20 +5925,20 @@ class Interpretation extends Fields $view['settings']->js_document )) { - $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Set the Custom JS script to view" . PHP_EOL - . $this->_t(2) . '$this->document->addScriptDeclaration("'; - $jsDocument = PHP_EOL . $this->_t(3) . str_replace( + . Indent::_(2) . '$this->document->addScriptDeclaration("'; + $jsDocument = PHP_EOL . Indent::_(3) . str_replace( '"', '\"', implode( - PHP_EOL . $this->_t(3), + PHP_EOL . Indent::_(3), $view['settings']->js_document ) ); - return $script . $this->setPlaceholders( + return $script . CFactory::_('Placeholder')->update( $jsDocument, $this->placeholders - ) . PHP_EOL . $this->_t(2) . '");'; + ) . PHP_EOL . Indent::_(2) . '");'; } } @@ -6044,8 +5947,8 @@ class Interpretation extends Fields public function setFootableScriptsLoader(&$view) { - if (isset($this->footableScripts[$this->target][$view['settings']->code]) - && $this->footableScripts[$this->target][$view['settings']->code]) + if (isset($this->footableScripts[CFactory::_('Config')->build_target][$view['settings']->code]) + && $this->footableScripts[CFactory::_('Config')->build_target][$view['settings']->code]) { return $this->setFootableScripts(false); } @@ -6103,73 +6006,73 @@ class Interpretation extends Fields public function setMetadataItem($item = 'item') { $meta = array(); - $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " load the meta description"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + $meta[] = Indent::_(2) . "if (isset(\$this->" . $item . "->metadesc) && \$this->" . $item . "->metadesc)"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->" + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setDescription(\$this->" . $item . "->metadesc);"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "elseif (\$this->params->get('menu-meta_description'))"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " load the key words if set"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + $meta[] = Indent::_(2) . "if (isset(\$this->" . $item . "->metakey) && \$this->" . $item . "->metakey)"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setMetadata('keywords', \$this->" . $item . "->metakey);"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "elseif (\$this->params->get('menu-meta_keywords'))"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check the robot params"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + $meta[] = Indent::_(2) . "if (isset(\$this->" . $item . "->robots) && \$this->" . $item . "->robots)"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setMetadata('robots', \$this->" . $item . "->robots);"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "elseif (\$this->params->get('robots'))"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "elseif (\$this->params->get('robots'))"; + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if autor is to be set"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + $meta[] = Indent::_(2) . "if (isset(\$this->" . $item . "->created_by) && \$this->params->get('MetaAuthor') == '1')"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setMetaData('author', \$this->" . $item . "->created_by);"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if metadata is available"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + $meta[] = Indent::_(2) . "if (isset(\$this->" . $item . "->metadata) && \$this->" . $item . "->metadata)"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$mdata = json_decode(\$this->" . $item + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$mdata = json_decode(\$this->" . $item . "->metadata,true);"; - $meta[] = $this->_t(3) . "foreach (\$mdata as \$k => \$v)"; - $meta[] = $this->_t(3) . "{"; - $meta[] = $this->_t(4) . "if (\$v)"; - $meta[] = $this->_t(4) . "{"; - $meta[] = $this->_t(5) . "\$this->document->setMetadata(\$k, \$v);"; - $meta[] = $this->_t(4) . "}"; - $meta[] = $this->_t(3) . "}"; - $meta[] = $this->_t(2) . "}"; + $meta[] = Indent::_(3) . "foreach (\$mdata as \$k => \$v)"; + $meta[] = Indent::_(3) . "{"; + $meta[] = Indent::_(4) . "if (\$v)"; + $meta[] = Indent::_(4) . "{"; + $meta[] = Indent::_(5) . "\$this->document->setMetadata(\$k, \$v);"; + $meta[] = Indent::_(4) . "}"; + $meta[] = Indent::_(3) . "}"; + $meta[] = Indent::_(2) . "}"; return implode(PHP_EOL, $meta); } @@ -6177,52 +6080,52 @@ class Interpretation extends Fields public function setMetadataList() { $meta = array(); - $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " load the meta description"; - $meta[] = $this->_t(2) + $meta[] = Indent::_(2) . "if (\$this->params->get('menu-meta_description'))"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " load the key words if set"; - $meta[] = $this->_t(2) + $meta[] = Indent::_(2) . "if (\$this->params->get('menu-meta_keywords'))"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; - $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $meta[] = Indent::_(2) . "}"; + $meta[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check the robot params"; - $meta[] = $this->_t(2) . "if (\$this->params->get('robots'))"; - $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) + $meta[] = Indent::_(2) . "if (\$this->params->get('robots'))"; + $meta[] = Indent::_(2) . "{"; + $meta[] = Indent::_(3) . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; - $meta[] = $this->_t(2) . "}"; + $meta[] = Indent::_(2) . "}"; return implode(PHP_EOL, $meta); } public function setGoogleChartLoader(&$view) { - if (isset($this->googleChart[$this->target][$view['settings']->code]) - && $this->googleChart[$this->target][$view['settings']->code]) + if (isset($this->googleChart[CFactory::_('Config')->build_target][$view['settings']->code]) + && $this->googleChart[CFactory::_('Config')->build_target][$view['settings']->code]) { $chart = array(); - $chart[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $chart[] = PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " add the google chart builder class."; - $chart[] = $this->_t(2) + $chart[] = Indent::_(2) . "require_once JPATH_COMPONENT_ADMINISTRATOR.'/helpers/chartbuilder.php';"; - $chart[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $chart[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " load the google chart js."; - $chart[] = $this->_t(2) + $chart[] = Indent::_(2) . "JHtml::_('script', 'media/com_" - . Config::get('component_code_name') . "/js/google.jsapi.js', ['version' => 'auto']);"; - $chart[] = $this->_t(2) + . CFactory::_('Config')->component_code_name . "/js/google.jsapi.js', ['version' => 'auto']);"; + $chart[] = Indent::_(2) . "\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/rgbcolor.js', ['version' => 'auto']);"; - $chart[] = $this->_t(2) + $chart[] = Indent::_(2) . "\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/canvg.js', ['version' => 'auto']);"; return implode(PHP_EOL, $chart); @@ -6249,34 +6152,34 @@ class Interpretation extends Fields // allways load these in if ($view_active) { - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " always make sure jquery is loaded."; - $setter .= PHP_EOL . $this->_t(2) . "JHtml::_('jquery.framework');"; - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $setter .= PHP_EOL . Indent::_(2) . "JHtml::_('jquery.framework');"; + $setter .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Load the header checker class."; - if ($this->target === 'site') + if (CFactory::_('Config')->build_target === 'site') { - $setter .= PHP_EOL . $this->_t(2) + $setter .= PHP_EOL . Indent::_(2) . "require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );"; } else { - $setter .= PHP_EOL . $this->_t(2) + $setter .= PHP_EOL . Indent::_(2) . "require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; } - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $setter .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Initialize the header checker."; - $setter .= PHP_EOL . $this->_t(2) . "\$HeaderCheck = new " - . Config::get('component_code_name') . "HeaderCheck;"; + $setter .= PHP_EOL . Indent::_(2) . "\$HeaderCheck = new " + . CFactory::_('Config')->component_code_name . "HeaderCheck;"; } // check if this view should get libraries - if (isset($this->libManager[$this->target][$code]) + if (isset($this->libManager[CFactory::_('Config')->build_target][$code]) && ArrayHelper::check( - $this->libManager[$this->target][$code] + $this->libManager[CFactory::_('Config')->build_target][$code] )) { - foreach ($this->libManager[$this->target][$code] as $id => $true) + foreach ($this->libManager[CFactory::_('Config')->build_target][$code] as $id => $true) { if (isset($this->libraries[$id]) && ObjectHelper::check( @@ -6287,7 +6190,7 @@ class Interpretation extends Fields $this->libraries[$id]->document )) { - $setter .= PHP_EOL . PHP_EOL . $this->setPlaceholders( + $setter .= PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( str_replace( '$document->', '$this->document->', $this->libraries[$id]->document @@ -6485,10 +6388,10 @@ class Interpretation extends Fields // if there was any code added to document then set globaly if ($buildDoc && ArrayHelper::check($scripts)) { - $this->libraries[$id]->document = $this->_t(2) . "//" - . $this->setLine(__LINE__) . " always load these files." - . PHP_EOL . $this->_t(2) . implode( - PHP_EOL . $this->_t(2), $scripts + $this->libraries[$id]->document = Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " always load these files." + . PHP_EOL . Indent::_(2) . implode( + PHP_EOL . Indent::_(2), $scripts ); // success @@ -6524,15 +6427,13 @@ class Interpretation extends Fields { case 'js': return '$this->document->addScript(' . $JURI . '"' . $path - . '", (' . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + . '", (' . $this->fileContentStatic[Placefix::_h('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[$this->hhh - . 'Component' . $this->hhh] + . $path . '", (' . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");'; break; case 'php': @@ -6554,7 +6455,7 @@ class Interpretation extends Fields && strpos($root, '/site/') === false) { return str_replace( - '/media/', '/media/com_' . Config::get('component_code_name') . '/', $root + '/media/', '/media/com_' . CFactory::_('Config')->component_code_name . '/', $root ); } elseif (strpos($root, '/media/') === false @@ -6563,7 +6464,7 @@ class Interpretation extends Fields { return str_replace( '/admin/', - '/administrator/components/com_' . Config::get('component_code_name') + '/administrator/components/com_' . CFactory::_('Config')->component_code_name . '/', $root ); } @@ -6572,7 +6473,7 @@ class Interpretation extends Fields && strpos($root, '/site/') !== false) { return str_replace( - '/site/', '/components/com_' . Config::get('component_code_name') . '/', + '/site/', '/components/com_' . CFactory::_('Config')->component_code_name . '/', $root ); } @@ -6587,61 +6488,61 @@ class Interpretation extends Fields // load the defaults needed if ($this->uikit > 0) { - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Load uikit options."; - $setter .= PHP_EOL . $this->_t(2) + $setter .= PHP_EOL . Indent::_(2) . "\$uikit = \$this->params->get('uikit_load');"; - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $setter .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Set script size."; - $setter .= PHP_EOL . $this->_t(2) + $setter .= PHP_EOL . Indent::_(2) . "\$size = \$this->params->get('uikit_min');"; $tabV = ""; // if both versions should be loaded then add some more logic if (2 == $this->uikit) { - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Load uikit version."; - $setter .= PHP_EOL . $this->_t(2) + $setter .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Load uikit version."; + $setter .= PHP_EOL . Indent::_(2) . "\$this->uikitVersion = \$this->params->get('uikit_version', 2);"; - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Use Uikit Version 2"; - $setter .= PHP_EOL . $this->_t(2) + $setter .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Use Uikit Version 2"; + $setter .= PHP_EOL . Indent::_(2) . "if (2 == \$this->uikitVersion)"; - $setter .= PHP_EOL . $this->_t(2) . "{"; - $tabV = $this->_t(1); + $setter .= PHP_EOL . Indent::_(2) . "{"; + $tabV = Indent::_(1); } } // load the defaults needed if (2 == $this->uikit || 1 == $this->uikit) { - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Set css style."; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "\$style = \$this->params->get('uikit_style');"; - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " The uikit css."; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . PHP_EOL . $tabV . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " The uikit css."; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "JHtml::_('stylesheet', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/css/uikit'.\$style.\$size.'.css', ['version' => 'auto']);"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(2) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " The uikit js."; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "JHtml::_('script', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/js/uikit'.\$size.'.js', ['version' => 'auto']);"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "}"; } // load the components need if ((2 == $this->uikit || 1 == $this->uikit) @@ -6650,19 +6551,19 @@ class Interpretation extends Fields $this->uikitComp[$view['settings']->code] )) { - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $setter .= PHP_EOL . PHP_EOL . $tabV . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Load the script to find all uikit components needed."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "if (\$uikit != 2)"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(2) . "if (\$uikit != 2)"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Set the default uikit components in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(3) . "\$uikitComp = array();"; foreach ($this->uikitComp[$view['settings']->code] as $class) { - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitComp[] = '" + $setter .= PHP_EOL . $tabV . Indent::_(3) . "\$uikitComp[] = '" . $class . "';"; } // check content for more needed components @@ -6671,92 +6572,88 @@ class Interpretation extends Fields $this->siteFieldData['uikit'][$view['settings']->code] )) { - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(3) . "//" - . $this->setLine(__LINE__) + $setter .= PHP_EOL . PHP_EOL . $tabV . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Get field uikit components needed in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(3) . "\$uikitFieldComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(3) . "if (isset(\$uikitFieldComp) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$uikitFieldComp))"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(4) + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitFieldComp))"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "if (isset(\$uikitComp) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$uikitComp))"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; - $setter .= PHP_EOL . $tabV . $this->_t(5) + $setter .= PHP_EOL . $tabV . Indent::_(5) . "\$uikitComp = array_unique(\$uikitComp);"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "else"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) + $setter .= PHP_EOL . $tabV . Indent::_(4) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "else"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "\$uikitComp = \$uikitFieldComp;"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "}"; } - $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Load the needed uikit components in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$uikitComp))"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( - __LINE__ + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " load just in case."; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(3) . "jimport('joomla.filesystem.file');"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " loading..."; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(3) . "foreach (\$uikitComp as \$class)"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(3) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "foreach (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_( + __LINE__,__CLASS__ ) . " check if the CSS file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) + $setter .= PHP_EOL . $tabV . Indent::_(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(5) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(6) . "//" . Line::_( + __LINE__,__CLASS__ ) . " load the css."; - $setter .= PHP_EOL . $tabV . $this->_t(6) + $setter .= PHP_EOL . $tabV . Indent::_(6) . "JHtml::_('stylesheet', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', ['version' => 'auto']);"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(5) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_( + __LINE__,__CLASS__ ) . " check if the JavaScript file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) + $setter .= PHP_EOL . $tabV . Indent::_(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(5) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(6) . "//" . Line::_( + __LINE__,__CLASS__ ) . " load the js."; - $setter .= PHP_EOL . $tabV . $this->_t(6) + $setter .= PHP_EOL . $tabV . Indent::_(6) . "JHtml::_('script', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/js/components/'.\$name.\$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "}"; } elseif ((2 == $this->uikit || 1 == $this->uikit) && isset($this->siteFieldData['uikit'][$view['settings']->code]) @@ -6764,105 +6661,103 @@ class Interpretation extends Fields $this->siteFieldData['uikit'][$view['settings']->code] )) { - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $setter .= PHP_EOL . PHP_EOL . $tabV . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Load the needed uikit components in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "\$uikitComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$uikitComp))"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( - __LINE__ + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " loading..."; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(3) . "foreach (\$uikitComp as \$class)"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(3) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "foreach (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_( + __LINE__,__CLASS__ ) . " check if the CSS file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) + $setter .= PHP_EOL . $tabV . Indent::_(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(5) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(6) . "//" . Line::_( + __LINE__,__CLASS__ ) . " load the css."; - $setter .= PHP_EOL . $tabV . $this->_t(6) + $setter .= PHP_EOL . $tabV . Indent::_(6) . "JHtml::_('stylesheet', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', ['version' => 'auto']);"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(5) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_( + __LINE__,__CLASS__ ) . " check if the JavaScript file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) + $setter .= PHP_EOL . $tabV . Indent::_(5) . "if (File::exists(JPATH_ROOT.'/media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(5) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(6) . "//" . Line::_( + __LINE__,__CLASS__ ) . " load the js."; - $setter .= PHP_EOL . $tabV . $this->_t(6) + $setter .= PHP_EOL . $tabV . Indent::_(6) . "JHtml::_('script', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v2/js/components/'.\$name.\$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(5) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(4) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "}"; } // now set the version 3 if (2 == $this->uikit || 3 == $this->uikit) { if (2 == $this->uikit) { - $setter .= PHP_EOL . $this->_t(2) . "}"; - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . Indent::_(2) . "}"; + $setter .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Use Uikit Version 3"; - $setter .= PHP_EOL . $this->_t(2) + $setter .= PHP_EOL . Indent::_(2) . "elseif (3 == \$this->uikitVersion)"; - $setter .= PHP_EOL . $this->_t(2) . "{"; + $setter .= PHP_EOL . Indent::_(2) . "{"; } // add version 3 fiels to page - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " The uikit css."; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "JHtml::_('stylesheet', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v3/css/uikit'.\$size.'.css', ['version' => 'auto']);"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $setter .= PHP_EOL . $tabV . Indent::_(2) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " The uikit js."; - $setter .= PHP_EOL . $tabV . $this->_t(2) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(2) . "{"; + $setter .= PHP_EOL . $tabV . Indent::_(3) . "JHtml::_('script', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v3/js/uikit'.\$size.'.js', ['version' => 'auto']);"; - $setter .= PHP_EOL . $tabV . $this->_t(3) + $setter .= PHP_EOL . $tabV . Indent::_(3) . "JHtml::_('script', 'media/com_" - . Config::get('component_code_name') + . CFactory::_('Config')->component_code_name . "/uikit-v3/js/uikit-icons'.\$size.'.js', ['version' => 'auto']);"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; + $setter .= PHP_EOL . $tabV . Indent::_(2) . "}"; if (2 == $this->uikit) { - $setter .= PHP_EOL . $this->_t(2) . "}"; + $setter .= PHP_EOL . Indent::_(2) . "}"; } } @@ -6873,7 +6768,7 @@ class Interpretation extends Fields { if ($view['settings']->add_php_jview == 1) { - return PHP_EOL . PHP_EOL . $this->setPlaceholders( + return PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $view['settings']->php_jview, $this->placeholders ); } @@ -6891,142 +6786,135 @@ class Interpretation extends Fields // does this view have a custom limitbox position $has_limitbox = (strpos( $view['settings']->default, - $this->bbb . 'LIMITBOX' . $this->ddd + Placefix::_('LIMITBOX') ) !== false); // does this view have a custom pages counter position $has_pagescounter = (strpos( $view['settings']->default, - $this->bbb . 'PAGESCOUNTER' . $this->ddd + Placefix::_('PAGESCOUNTER') ) !== false); // does this view have a custom pages links position $has_pageslinks = (strpos( $view['settings']->default, - $this->bbb . 'PAGESLINKS' . $this->ddd + Placefix::_('PAGESLINKS') ) !== false); // does this view have a custom pagination start position $has_pagination_start = (strpos( $view['settings']->default, - $this->bbb . 'PAGINATIONSTART' . $this->ddd + Placefix::_('PAGINATIONSTART') ) !== false); // does this view have a custom pagination end position $has_pagination_end = (strpos( $view['settings']->default, - $this->bbb . 'PAGINATIONEND' . $this->ddd + Placefix::_('PAGINATIONEND') ) !== false); // add pagination start - $this->placeholders[$this->bbb . 'PAGINATIONSTART' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONSTART')] = PHP_EOL . 'items) && isset($this->pagination) && isset($this->pagination->pagesTotal) && $this->pagination->pagesTotal > 1): ?>'; - $this->placeholders[$this->bbb . 'PAGINATIONSTART' . $this->ddd] - .= PHP_EOL . $this->_t(1) . ''; + CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONEND')] .= PHP_EOL . ''; // add limit box - $this->placeholders[$this->bbb . 'LIMITBOX' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('LIMITBOX')] = 'pagination->getLimitBox(); ?>'; // add pages counter - $this->placeholders[$this->bbb . 'PAGESCOUNTER' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGESCOUNTER')] = 'pagination->getPagesCounter(); ?>'; // add pages links - if ($this->target === 'custom_admin') + if (CFactory::_('Config')->build_target === 'custom_admin') { - $this->placeholders[$this->bbb . 'PAGESLINKS' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGESLINKS')] = 'pagination->getListFooter(); ?>'; } else { - $this->placeholders[$this->bbb . 'PAGESLINKS' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGESLINKS')] = 'pagination->getPagesLinks(); ?>'; } // build body $body = array(); // Load the default values to the body - $body[] = $this->setPlaceholders( + $body[] = CFactory::_('Placeholder')->update( $view['settings']->default, $this->placeholders ); // add pagination start if (!$has_pagination_start) { - $body[] = $this->placeholders[$this->bbb . 'PAGINATIONSTART' - . $this->ddd]; + $body[] = CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONSTART')]; } if (!$has_limitbox && !$has_pagescounter) { - $body[] = $this->_t(3) + $body[] = Indent::_(3) . '

    pagination->getPagesCounter(); ?> pagination->getLimitBox(); ?>

    '; } elseif (!$has_limitbox) { - $body[] = $this->_t(3) + $body[] = Indent::_(3) . '

    pagination->getLimitBox(); ?>

    '; } elseif (!$has_pagescounter) { - $body[] = $this->_t(3) + $body[] = Indent::_(3) . '

    pagination->getPagesCounter(); ?>

    '; } // add pagination end if (!$has_pagination_end) { - $body[] = $this->placeholders[$this->bbb . 'PAGINATIONEND' - . $this->ddd]; + $body[] = CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONEND')]; } // lets clear the placeholders just in case unset( - $this->placeholders[$this->bbb . 'LIMITBOX' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('LIMITBOX')] ); unset( - $this->placeholders[$this->bbb . 'PAGESCOUNTER' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGESCOUNTER')] ); unset( - $this->placeholders[$this->bbb . 'PAGESLINKS' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGESLINKS')] ); unset( - $this->placeholders[$this->bbb . 'PAGINATIONSTART' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONSTART')] ); unset( - $this->placeholders[$this->bbb . 'PAGINATIONEND' - . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('PAGINATIONEND')] ); // insure the form is added (only if no form exist) if (strpos($view['settings']->default, 'addCustomForm[$this->target][$view['settings']->code] + $this->addCustomForm[CFactory::_('Config')->build_target][$view['settings']->code] = true; } @@ -7036,16 +6924,16 @@ class Interpretation extends Fields else { // insure the form is added (only if no form exist) - if ('site' !== $this->target + if ('site' !== CFactory::_('Config')->build_target && strpos( $view['settings']->default, 'addCustomForm[$this->target][$view['settings']->code] + $this->addCustomForm[CFactory::_('Config')->build_target][$view['settings']->code] = true; } - return PHP_EOL . $this->setPlaceholders( + return PHP_EOL . CFactory::_('Placeholder')->update( $view['settings']->default, $this->placeholders ); } @@ -7056,18 +6944,18 @@ class Interpretation extends Fields public function setCustomViewForm(&$view, &$gettype, $type) { - if (isset($this->addCustomForm[$this->target]) - && isset($this->addCustomForm[$this->target][$view]) - && $this->addCustomForm[$this->target][$view]) + if (isset($this->addCustomForm[CFactory::_('Config')->build_target]) + && isset($this->addCustomForm[CFactory::_('Config')->build_target][$view]) + && $this->addCustomForm[CFactory::_('Config')->build_target][$view]) { switch ($type) { case 1: // top - if ('site' === $this->target) + if ('site' === CFactory::_('Config')->build_target) { return '
    ' . PHP_EOL; } @@ -7076,14 +6964,14 @@ class Interpretation extends Fields if ($gettype == 2) { return '' . PHP_EOL; } else { return '' . PHP_EOL; } @@ -7092,10 +6980,10 @@ class Interpretation extends Fields case 2: // bottom $input = ''; - if ('admin' === $this->target + if ('admin' === CFactory::_('Config')->build_target && isset($this->customAdminViewListId[$view])) { - $input = PHP_EOL . $this->_t(1) + $input = PHP_EOL . Indent::_(1) . ''; } @@ -7122,19 +7010,19 @@ class Interpretation extends Fields { $script = array(); $script[] = PHP_EOL . ""; return implode(PHP_EOL, $script); @@ -7157,7 +7045,7 @@ class Interpretation extends Fields PHP_EOL, $view['settings']->php_view ); - return $this->setPlaceholders($_tmp, $this->placeholders); + return CFactory::_('Placeholder')->update($_tmp, $this->placeholders); } } @@ -7166,42 +7054,39 @@ class Interpretation extends Fields public function setCustomViewTemplateBody(&$view) { - if (isset($this->templateData[$this->target][$view['settings']->code]) + if (isset($this->templateData[CFactory::_('Config')->build_target][$view['settings']->code]) && ArrayHelper::check( - $this->templateData[$this->target][$view['settings']->code] + $this->templateData[CFactory::_('Config')->build_target][$view['settings']->code] )) { $created = $this->getCreatedDate($view); $modified = $this->getLastModifiedDate($view); foreach ( - $this->templateData[$this->target][$view['settings']->code] as + $this->templateData[CFactory::_('Config')->build_target][$view['settings']->code] as $template => $data ) { // build the file - $target = array($this->target => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $modified, - $this->hhh . 'VERSION' - . $this->hhh => $view['settings']->version); + $target = array(CFactory::_('Config')->build_target => $view['settings']->code); + $config = array(Placefix::_h('CREATIONDATE') => $created, + Placefix::_h('BUILDDATE') => $modified, + Placefix::_h('VERSION') => $view['settings']->version); $this->buildDynamique($target, 'template', $template, $config); // set the file data $TARGET = StringHelper::safe( - $this->target, 'U' + CFactory::_('Config')->build_target, 'U' ); // SITE_TEMPLATE_BODY <<>> $this->fileContentDynamic[$view['settings']->code . '_' - . $template][$this->hhh . $TARGET . '_TEMPLATE_BODY' - . $this->hhh] - = PHP_EOL . $this->setPlaceholders( + . $template][Placefix::_h($TARGET . '_TEMPLATE_BODY' + )] + = PHP_EOL . CFactory::_('Placeholder')->update( $data['html'], $this->placeholders ); // SITE_TEMPLATE_CODE_BODY <<>> $this->fileContentDynamic[$view['settings']->code . '_' - . $template][$this->hhh . $TARGET . '_TEMPLATE_CODE_BODY' - . $this->hhh] + . $template][Placefix::_h($TARGET . '_TEMPLATE_CODE_BODY' + )] = $this->setCustomViewTemplateCode($data['php_view']); } } @@ -7216,7 +7101,7 @@ class Interpretation extends Fields { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); - return $this->setPlaceholders($php_view, $this->placeholders); + return CFactory::_('Placeholder')->update($php_view, $this->placeholders); } } @@ -7225,48 +7110,48 @@ class Interpretation extends Fields public function setCustomViewLayouts() { - if (isset($this->layoutData[$this->target]) + if (isset($this->layoutData[CFactory::_('Config')->build_target]) && ArrayHelper::check( - $this->layoutData[$this->target] + $this->layoutData[CFactory::_('Config')->build_target] )) { - foreach ($this->layoutData[$this->target] as $layout => $data) + foreach ($this->layoutData[CFactory::_('Config')->build_target] as $layout => $data) { // build the file - $target = array($this->target => $layout); + $target = array(CFactory::_('Config')->build_target => $layout); $this->buildDynamique($target, 'layout'); // set the file data $TARGET = StringHelper::safe( - $this->target, 'U' + CFactory::_('Config')->build_target, 'U' ); // SITE_LAYOUT_CODE <<>> $php_view = (array) explode(PHP_EOL, $data['php_view']); if (ArrayHelper::check($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); - $this->fileContentDynamic[$layout][$this->hhh . $TARGET - . '_LAYOUT_CODE' . $this->hhh] - = $this->setPlaceholders( + $this->fileContentDynamic[$layout][Placefix::_h($TARGET + . '_LAYOUT_CODE' )] + = CFactory::_('Placeholder')->update( $php_view, $this->placeholders ); } else { - $this->fileContentDynamic[$layout][$this->hhh . $TARGET - . '_LAYOUT_CODE' . $this->hhh] + $this->fileContentDynamic[$layout][Placefix::_h($TARGET + . '_LAYOUT_CODE' )] = ''; } // SITE_LAYOUT_BODY <<>> - $this->fileContentDynamic[$layout][$this->hhh . $TARGET - . '_LAYOUT_BODY' . $this->hhh] - = PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic[$layout][Placefix::_h($TARGET + . '_LAYOUT_BODY' )] + = PHP_EOL . CFactory::_('Placeholder')->update( $data['html'], $this->placeholders ); // SITE_LAYOUT_HEADER <<>> - $this->fileContentDynamic[$layout][$this->hhh . $TARGET - . '_LAYOUT_HEADER' . $this->hhh] + $this->fileContentDynamic[$layout][Placefix::_h($TARGET + . '_LAYOUT_HEADER' )] = (($header = $this->setFileHeader( - str_replace('_', '.', $this->target) . '.layout', + str_replace('_', '.', CFactory::_('Config')->build_target) . '.layout', $layout, false) ) !== false) ? PHP_EOL . PHP_EOL . $header : ''; } @@ -7346,26 +7231,24 @@ class Interpretation extends Fields { $script = ''; // get the component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; - $component = $this->fileContentStatic[$this->hhh . 'component' - . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $component = $this->fileContentStatic[Placefix::_h('component')]; // go from base64 to string if (isset($this->base64Builder[$view]) && ArrayHelper::check($this->base64Builder[$view])) { foreach ($this->base64Builder[$view] as $baseString) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "if (!empty(\$item->" . $baseString . "))"; // TODO && base64_encode(base64_decode(\$item->".$baseString.", true)) === \$item->".$baseString.")"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " base64 Decode " . $baseString . "."; - $script .= PHP_EOL . $this->_t(4) . "\$item->" . $baseString + $script .= PHP_EOL . Indent::_(4) . "\$item->" . $baseString . " = base64_decode(\$item->" . $baseString . ");"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; } } // decryption @@ -7378,37 +7261,37 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Get the " . $cryptionType + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType + $script .= PHP_EOL . Indent::_(3) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType + $script .= PHP_EOL . Indent::_(3) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; foreach ( $this->{$cryptionType . 'FieldModeling'}[$view] as $baseString ) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "if (!empty(\$item->" . $baseString . ") && \$" . $cryptionType . "key && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" - . $this->setLine(__LINE__) . " " . $cryptionType + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" + . Line::_(__Line__, __Class__) . " " . $cryptionType . " decrypt data " . $baseString . "."; - $script .= PHP_EOL . $this->_t(4) . "\$item->" + $script .= PHP_EOL . Indent::_(4) . "\$item->" . $baseString . " = rtrim(\$" . $cryptionType . "->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; } } else @@ -7423,8 +7306,8 @@ class Interpretation extends Fields . 'FieldModelInitiator'}[$view]['get'] as $block ) { - $script .= PHP_EOL . $this->_t(3) . implode( - PHP_EOL . $this->_t(3), $block + $script .= PHP_EOL . Indent::_(3) . implode( + PHP_EOL . Indent::_(3), $block ); } } @@ -7437,9 +7320,9 @@ class Interpretation extends Fields $_placeholder_for_field = array('[[[field]]]' => '$item->' . $baseString); - $script .= $this->setPlaceholders( - PHP_EOL . $this->_t(3) . implode( - PHP_EOL . $this->_t(3), $opener_['get'] + $script .= CFactory::_('Placeholder')->update( + PHP_EOL . Indent::_(3) . implode( + PHP_EOL . Indent::_(3), $opener_['get'] ), $_placeholder_for_field ); } @@ -7454,19 +7337,19 @@ class Interpretation extends Fields { foreach ($this->jsonItemBuilder[$view] as $jsonItem) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "if (!empty(\$item->" . $jsonItem . "))"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Convert the " . $jsonItem . " field to an array."; - $script .= PHP_EOL . $this->_t(4) . "\$" . $jsonItem + $script .= PHP_EOL . Indent::_(4) . "\$" . $jsonItem . " = new Registry;"; - $script .= PHP_EOL . $this->_t(4) . "\$" . $jsonItem + $script .= PHP_EOL . Indent::_(4) . "\$" . $jsonItem . "->loadString(\$item->" . $jsonItem . ");"; - $script .= PHP_EOL . $this->_t(4) . "\$item->" . $jsonItem + $script .= PHP_EOL . Indent::_(4) . "\$item->" . $jsonItem . " = \$" . $jsonItem . "->toArray();"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; } } // go from json to string @@ -7478,11 +7361,11 @@ class Interpretation extends Fields $makeArray = ''; foreach ($this->jsonStringBuilder[$view] as $jsonString) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "if (!empty(\$item->" . $jsonString . "))"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " JSON Decode " . $jsonString . "."; if (isset($this->jsonItemBuilderArray[$view]) && ArrayHelper::check( @@ -7498,26 +7381,26 @@ class Interpretation extends Fields { $makeArray = ',true'; } - $script .= PHP_EOL . $this->_t(4) . "\$item->" . $jsonString + $script .= PHP_EOL . Indent::_(4) . "\$item->" . $jsonString . " = json_decode(\$item->" . $jsonString . $makeArray . ");"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; } } // add the tag get options if (isset($this->tagsBuilder[$view])) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "if (!empty(\$item->id))"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get Tag IDs."; - $script .= PHP_EOL . $this->_t(4) . "\$item->tags" + $script .= PHP_EOL . Indent::_(4) . "\$item->tags" . " = new JHelperTags;"; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$item->tags->getTagIds(\$item->id, 'com_$component.$view');"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; } // add custom php to getitem method $script .= $this->getCustomScriptBuilder( @@ -7537,15 +7420,15 @@ class Interpretation extends Fields { foreach ($this->checkboxBuilder[$view] as $checkbox) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Set the empty " . $checkbox + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Set the empty " . $checkbox . " item to data"; - $script .= PHP_EOL . $this->_t(2) . "if (!isset(\$data['" + $script .= PHP_EOL . Indent::_(2) . "if (!isset(\$data['" . $checkbox . "']))"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "\$data['" . $checkbox + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "\$data['" . $checkbox . "'] = '';"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; } } @@ -7556,9 +7439,8 @@ class Interpretation extends Fields { $script = ''; // get component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; - $component = Config::get('component_code_name'); + $Component = $this->fileContentStatic[Placefix::_h('Component')]; + $component = CFactory::_('Config')->component_code_name; // check if there was script added before modeling of data $script .= $this->getCustomScriptBuilder( 'php_before_save', $view, PHP_EOL . PHP_EOL @@ -7571,36 +7453,36 @@ class Interpretation extends Fields { foreach ($this->jsonItemBuilder[$view] as $jsonItem) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Set the " . $jsonItem + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Set the " . $jsonItem . " items to data."; - $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" + $script .= PHP_EOL . Indent::_(2) . "if (isset(\$data['" . $jsonItem . "']) && is_array(\$data['" . $jsonItem . "']))"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $jsonItem + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "\$" . $jsonItem . " = new JRegistry;"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $jsonItem + $script .= PHP_EOL . Indent::_(3) . "\$" . $jsonItem . "->loadArray(\$data['" . $jsonItem . "']);"; - $script .= PHP_EOL . $this->_t(3) . "\$data['" . $jsonItem + $script .= PHP_EOL . Indent::_(3) . "\$data['" . $jsonItem . "'] = (string) \$" . $jsonItem . ";"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; if (isset($this->permissionFields[$view]) && isset($this->permissionFields[$view][$jsonItem]) && ArrayHelper::check( $this->permissionFields[$view][$jsonItem] )) { - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Also check permission since the value may be removed due to permissions"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Then we do not want to clear it out, but simple ignore the empty " . $jsonItem; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "elseif (!isset(\$data['" . $jsonItem . "'])"; // only add permission that are available foreach ( @@ -7608,7 +7490,7 @@ class Interpretation extends Fields $permission_option => $fieldType ) { - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "&& JFactory::getUser()->authorise('" . $view . "." . $permission_option . "." . $jsonItem . "', 'com_" . $component . "')"; @@ -7617,16 +7499,16 @@ class Interpretation extends Fields } else { - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "elseif (!isset(\$data['" . $jsonItem . "']))"; } - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Set the empty " . $jsonItem . " to data"; - $script .= PHP_EOL . $this->_t(3) . "\$data['" . $jsonItem + $script .= PHP_EOL . Indent::_(3) . "\$data['" . $jsonItem . "'] = '';"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; } } // turn string into json string @@ -7637,16 +7519,16 @@ class Interpretation extends Fields { foreach ($this->jsonStringBuilder[$view] as $jsonString) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Set the " . $jsonString + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Set the " . $jsonString . " string to JSON string."; - $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" + $script .= PHP_EOL . Indent::_(2) . "if (isset(\$data['" . $jsonString . "']))"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "\$data['" . $jsonString + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "\$data['" . $jsonString . "'] = (string) json_encode(\$data['" . $jsonString . "']);"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; } } // turn string into base 64 string @@ -7655,15 +7537,15 @@ class Interpretation extends Fields { foreach ($this->base64Builder[$view] as $baseString) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Set the " . $baseString + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Set the " . $baseString . " string to base64 string."; - $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" + $script .= PHP_EOL . Indent::_(2) . "if (isset(\$data['" . $baseString . "']))"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "\$data['" . $baseString + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "\$data['" . $baseString . "'] = base64_encode(\$data['" . $baseString . "']);"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; } } // turn string into encrypted string @@ -7676,33 +7558,33 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Get the " . $cryptionType + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Get the " . $cryptionType . " encryption key."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType + $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get the encryption object"; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType + $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; foreach ( $this->{$cryptionType . 'FieldModeling'}[$view] as $baseString ) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Encrypt data " + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Encrypt data " . $baseString . "."; - $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" + $script .= PHP_EOL . Indent::_(2) . "if (isset(\$data['" . $baseString . "']) && \$" . $cryptionType . "key)"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "\$data['" + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "\$data['" . $baseString . "'] = \$" . $cryptionType . "->encryptString(\$data['" . $baseString . "']);"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; } } else @@ -7721,8 +7603,8 @@ class Interpretation extends Fields . 'FieldModelInitiator'}[$view]['save'] as $block ) { - $script .= PHP_EOL . $this->_t(2) . implode( - PHP_EOL . $this->_t(2), $block + $script .= PHP_EOL . Indent::_(2) . implode( + PHP_EOL . Indent::_(2), $block ); } } @@ -7735,9 +7617,9 @@ class Interpretation extends Fields $_placeholder_for_field = array('[[[field]]]' => "\$data['" . $baseString . "']"); - $script .= $this->setPlaceholders( - PHP_EOL . $this->_t(2) . implode( - PHP_EOL . $this->_t(2), $locker_['save'] + $script .= CFactory::_('Placeholder')->update( + PHP_EOL . Indent::_(2) . implode( + PHP_EOL . Indent::_(2), $locker_['save'] ), $_placeholder_for_field ); } @@ -7757,14 +7639,14 @@ class Interpretation extends Fields // reset $oserver = ""; // set component name - $component = Config::get('component_code_name'); + $component = CFactory::_('Config')->component_code_name; // add the tags observer if (isset($this->tagsBuilder[$view]) && StringHelper::check($this->tagsBuilder[$view])) { - $oserver .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Adding Tag Options"; - $oserver .= PHP_EOL . $this->_t(2) + $oserver .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Adding Tag Options"; + $oserver .= PHP_EOL . Indent::_(2) . "JTableObserverTags::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; } @@ -7774,9 +7656,9 @@ class Interpretation extends Fields $this->historyBuilder[$view] )) { - $oserver .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Adding History Options"; - $oserver .= PHP_EOL . $this->_t(2) + $oserver .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Adding History Options"; + $oserver .= PHP_EOL . Indent::_(2) . "JTableObserverContenthistory::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; } @@ -7806,7 +7688,7 @@ class Interpretation extends Fields )) { // set component name - $component = Config::get('component_code_name'); + $component = CFactory::_('Config')->component_code_name; // reset $dbStuff = array(); // start loading the content type data @@ -7849,74 +7731,74 @@ class Interpretation extends Fields $taabb = ''; if ($action === 'update') { - $taabb = $this->_t(1); + $taabb = Indent::_(1); } - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Get The Database object"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Get The Database object"; + $script .= PHP_EOL . Indent::_(3) . "\$db = JFactory::getDbo();"; foreach ($dbStuff as $name => $tables) { if (ArrayHelper::check($tables)) { $code = StringHelper::safe($name); - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Create the " . $name + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Create the " . $name . " content type object."; - $script .= PHP_EOL . $this->_t(3) . "\$" . $code + $script .= PHP_EOL . Indent::_(3) . "\$" . $code . " = new stdClass();"; foreach ($tables as $table => $data) { - $script .= PHP_EOL . $this->_t(3) . "\$" . $code + $script .= PHP_EOL . Indent::_(3) . "\$" . $code . "->" . $table . " = '" . $data . "';"; } if ($action === 'update') { // we first load script to check if data exist - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Check if " + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Check if " . $name . " type is already in content_type DB."; - $script .= PHP_EOL . $this->_t(3) . "\$" . $code + $script .= PHP_EOL . Indent::_(3) . "\$" . $code . "_id = null;"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->select(\$db->quoteName(array('type_id')));"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->from(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->where(\$db->quoteName('type_alias') . ' LIKE '. \$db->quote($" . $code . "->type_alias));"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$db->execute();"; } - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Set the object into the content types table."; if ($action === 'update') { - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "if (\$db->getNumRows())"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "\$" . $code + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "\$" . $code . "->type_id = \$db->loadResult();"; - $script .= PHP_EOL . $this->_t(4) . "\$" . $code + $script .= PHP_EOL . Indent::_(4) . "\$" . $code . "_Updated = \$db->updateObject('#__content_types', \$" . $code . ", 'type_id');"; - $script .= PHP_EOL . $this->_t(3) . "}"; - $script .= PHP_EOL . $this->_t(3) . "else"; - $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . Indent::_(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "else"; + $script .= PHP_EOL . Indent::_(3) . "{"; } - $script .= PHP_EOL . $this->_t(3) . $taabb . "\$" + $script .= PHP_EOL . Indent::_(3) . $taabb . "\$" . $code . "_Inserted = \$db->insertObject('#__content_types', \$" . $code . ");"; if ($action === 'update') { - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; } } } @@ -7933,7 +7815,7 @@ class Interpretation extends Fields $script = $this->setComponentToContentTypes('install'); // set the component name - $component = Config::get('component_code_name'); + $component = CFactory::_('Config')->component_code_name; // add the assets table update for permissions rules if (isset($this->assetsRules) @@ -7943,39 +7825,39 @@ class Interpretation extends Fields { if (StringHelper::check($script)) { - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Install the global extenstion assets permission."; } else { - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Install the global extension assets permission."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$db = JFactory::getDbo();"; } - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Field to update."; - $script .= PHP_EOL . $this->_t(3) . "\$fields = array("; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(3) . "\$fields = array("; + $script .= PHP_EOL . Indent::_(4) . "\$db->quoteName('rules') . ' = ' . \$db->quote('{" . implode( ',', $this->assetsRules ) . "}'),"; - $script .= PHP_EOL . $this->_t(3) . ");"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(3) . ");"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Condition."; - $script .= PHP_EOL . $this->_t(3) . "\$conditions = array("; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(3) . "\$conditions = array("; + $script .= PHP_EOL . Indent::_(4) . "\$db->quoteName('name') . ' = ' . \$db->quote('com_" . $component . "')"; - $script .= PHP_EOL . $this->_t(3) . ");"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . ");"; + $script .= PHP_EOL . Indent::_(3) . "\$query->update(\$db->quoteName('#__assets'))->set(\$fields)->where(\$conditions);"; - $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "\$allDone = \$db->execute();" + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(3) . "\$allDone = \$db->execute();" . PHP_EOL; } // add the global params for the component global settings @@ -7984,38 +7866,38 @@ class Interpretation extends Fields { if (StringHelper::check($script)) { - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Install the global extension params."; } else { - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Install the global extension params."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$db = JFactory::getDbo();"; } - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Field to update."; - $script .= PHP_EOL . $this->_t(3) . "\$fields = array("; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(3) . "\$fields = array("; + $script .= PHP_EOL . Indent::_(4) . "\$db->quoteName('params') . ' = ' . \$db->quote('{" . implode(',', $this->extensionsParams) . "}'),"; - $script .= PHP_EOL . $this->_t(3) . ");"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(3) . ");"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Condition."; - $script .= PHP_EOL . $this->_t(3) . "\$conditions = array("; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(3) . "\$conditions = array("; + $script .= PHP_EOL . Indent::_(4) . "\$db->quoteName('element') . ' = ' . \$db->quote('com_" . $component . "')"; - $script .= PHP_EOL . $this->_t(3) . ");"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . ");"; + $script .= PHP_EOL . Indent::_(3) . "\$query->update(\$db->quoteName('#__extensions'))->set(\$fields)->where(\$conditions);"; - $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "\$allDone = \$db->execute();" + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(3) . "\$allDone = \$db->execute();" . PHP_EOL; } // add the custom script @@ -8027,21 +7909,19 @@ class Interpretation extends Fields // add the component install notice if (StringHelper::check($script)) { - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . 'echo \''; - $script .= PHP_EOL . $this->_t(4) . ''; + $script .= PHP_EOL . Indent::_(4) . ''; - $script .= PHP_EOL . $this->_t(4) . '\';'; + $script .= PHP_EOL . Indent::_(4) . '\';'; return $script; } - return PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + return PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " noting to install."; } @@ -8058,19 +7938,16 @@ class Interpretation extends Fields $this->componentData->admin_views )) { - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . 'echo \''; - $script .= PHP_EOL . $this->_t(4) . ''; + $script .= PHP_EOL . Indent::_(4) . ''; - $script .= PHP_EOL . $this->_t(4) . ''; - $script .= PHP_EOL . $this->_t(4) . "

    Upgrade to Version " - . $this->fileContentStatic[$this->hhh . 'ACTUALVERSION' - . $this->hhh] + $script .= PHP_EOL . Indent::_(4) . ''; + $script .= PHP_EOL . Indent::_(4) . "

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

    ';"; } @@ -8079,7 +7956,7 @@ class Interpretation extends Fields return $script; } - return PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + return PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " noting to update."; } @@ -8092,16 +7969,16 @@ class Interpretation extends Fields $this->uninstallScriptBuilder )) { - $component = Config::get('component_code_name'); + $component = CFactory::_('Config')->component_code_name; // start loading the data to delet - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get Application object"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$app = JFactory::getApplication();"; - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get The Database object"; - $script .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDbo();"; + $script .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDbo();"; foreach ( $this->uninstallScriptBuilder as $viewsCodeName => $typeAlias @@ -8115,435 +7992,435 @@ class Interpretation extends Fields && isset($this->uninstallScriptFields[$viewsCodeName])) { // First check if data is till in table - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Select ids from fields"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->select(\$db->quoteName('id'));"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->from(\$db->quoteName('#__fields'));"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Where " . $viewsCodeName . " context is found"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->where( \$db->quoteName('context') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute query to see if context is found"; - $script .= PHP_EOL . $this->_t(2) . "\$db->execute();"; - $script .= PHP_EOL . $this->_t(2) . "\$" . $view + $script .= PHP_EOL . Indent::_(2) . "\$db->execute();"; + $script .= PHP_EOL . Indent::_(2) . "\$" . $view . "_found = \$db->getNumRows();"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now check if there were any rows"; - $script .= PHP_EOL . $this->_t(2) . "if (\$" . $view + $script .= PHP_EOL . Indent::_(2) . "if (\$" . $view . "_found)"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Since there are load the needed " . $view . " field ids"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_field_ids = \$db->loadColumn();"; // Now remove the actual type entry - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $viewsCodeName . " from the field table"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_condition = array( \$db->quoteName('context') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->delete(\$db->quoteName('#__fields'));"; - $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" + $script .= PHP_EOL . Indent::_(3) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " items"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view + $script .= PHP_EOL . Indent::_(3) . "if (\$" . $view . "_done)"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " If successfully remove " . $viewsCodeName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$app->enqueueMessage(JText:" . ":_('The fields with type (" . $typeAlias . ") context was removed from the #__fields table'));"; - $script .= PHP_EOL . $this->_t(3) . "}"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Also Remove " . $viewsCodeName . " field values"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_condition = array( \$db->quoteName('field_id') . ' IN ('. implode(',', \$" . $view . "_field_ids) .')');"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->delete(\$db->quoteName('#__fields_values'));"; - $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" + $script .= PHP_EOL . Indent::_(3) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " field values"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view + $script .= PHP_EOL . Indent::_(3) . "if (\$" . $view . "_done)"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " If successfully remove " . $viewsCodeName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$app->enqueueMessage(JText:" . ":_('The fields values for " . $viewsCodeName . " was removed from the #__fields_values table'));"; - $script .= PHP_EOL . $this->_t(3) . "}"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; // First check if data is till in table - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Select ids from field groups"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->select(\$db->quoteName('id'));"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->from(\$db->quoteName('#__fields_groups'));"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Where " . $viewsCodeName . " context is found"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->where( \$db->quoteName('context') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute query to see if context is found"; - $script .= PHP_EOL . $this->_t(2) . "\$db->execute();"; - $script .= PHP_EOL . $this->_t(2) . "\$" . $view + $script .= PHP_EOL . Indent::_(2) . "\$db->execute();"; + $script .= PHP_EOL . Indent::_(2) . "\$" . $view . "_found = \$db->getNumRows();"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now check if there were any rows"; - $script .= PHP_EOL . $this->_t(2) . "if (\$" . $view + $script .= PHP_EOL . Indent::_(2) . "if (\$" . $view . "_found)"; - $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . Indent::_(2) . "{"; // Now remove the actual type entry - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $viewsCodeName . " from the field groups table"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_condition = array( \$db->quoteName('context') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->delete(\$db->quoteName('#__fields_groups'));"; - $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" + $script .= PHP_EOL . Indent::_(3) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " items"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view + $script .= PHP_EOL . Indent::_(3) . "if (\$" . $view . "_done)"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " If successfully remove " . $viewsCodeName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$app->enqueueMessage(JText:" . ":_('The field groups with type (" . $typeAlias . ") context was removed from the #__fields_groups table'));"; - $script .= PHP_EOL . $this->_t(3) . "}"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; } // First check if data is till in table - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; + $script .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Select id from content type table"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->select(\$db->quoteName('type_id'));"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->from(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Where " . $viewsCodeName . " alias is found"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->where( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute query to see if alias is found"; - $script .= PHP_EOL . $this->_t(2) . "\$db->execute();"; - $script .= PHP_EOL . $this->_t(2) . "\$" . $view + $script .= PHP_EOL . Indent::_(2) . "\$db->execute();"; + $script .= PHP_EOL . Indent::_(2) . "\$" . $view . "_found = \$db->getNumRows();"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now check if there were any rows"; - $script .= PHP_EOL . $this->_t(2) . "if (\$" . $view + $script .= PHP_EOL . Indent::_(2) . "if (\$" . $view . "_found)"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Since there are load the needed " . $view . " type ids"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_ids = \$db->loadColumn();"; // Now remove the actual type entry - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $viewsCodeName . " from the content type table"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->delete(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " items"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done)"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "if (\$" . $view . "_done)"; + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " If successfully remove " . $viewsCodeName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__content_type table'));"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; // Now remove the related items from contentitem tag map table - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Remove " . $viewsCodeName + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Remove " . $viewsCodeName . " items from the contentitem tag map table"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->delete(\$db->quoteName('#__contentitem_tag_map'));"; - $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " items"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done)"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "if (\$" . $view . "_done)"; + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " If successfully remove " . $viewsCodeName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__contentitem_tag_map table'));"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; // Now remove the related items from ucm content table - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Remove " . $viewsCodeName + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Remove " . $viewsCodeName . " items from the ucm content table"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_condition = array( \$db->quoteName('core_type_alias') . ' = ' . \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(3) . "\$query->delete(\$db->quoteName('#__ucm_content'));"; - $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " items"; - $script .= PHP_EOL . $this->_t(3) . "\$" . $view + $script .= PHP_EOL . Indent::_(3) . "\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done)"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(3) . "if (\$" . $view . "_done)"; + $script .= PHP_EOL . Indent::_(3) . "{"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " If successfully removed " . $viewsCodeName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__ucm_content table'));"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; // setup the foreach loop of ids - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Make sure that all the " + $script .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Make sure that all the " . $viewsCodeName . " items are cleared from DB"; - $script .= PHP_EOL . $this->_t(3) . "foreach (\$" . $view + $script .= PHP_EOL . Indent::_(3) . "foreach (\$" . $view . "_ids as \$" . $view . "_id)"; - $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . Indent::_(3) . "{"; // Now remove the related items from ucm base table - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $viewsCodeName . " items from the ucm base table"; - $script .= PHP_EOL . $this->_t(4) . "\$" . $view + $script .= PHP_EOL . Indent::_(4) . "\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$query->delete(\$db->quoteName('#__ucm_base'));"; - $script .= PHP_EOL . $this->_t(4) . "\$query->where(\$" . $view + $script .= PHP_EOL . Indent::_(4) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(4) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " items"; - $script .= PHP_EOL . $this->_t(4) . "\$db->execute();"; + $script .= PHP_EOL . Indent::_(4) . "\$db->execute();"; // Now remove the related items from ucm history table - $script .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" - . $this->setLine(__LINE__) . " Remove " . $viewsCodeName + $script .= PHP_EOL . PHP_EOL . Indent::_(4) . "//" + . Line::_(__Line__, __Class__) . " Remove " . $viewsCodeName . " items from the ucm history table"; - $script .= PHP_EOL . $this->_t(4) . "\$" . $view + $script .= PHP_EOL . Indent::_(4) . "\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(4) + $script .= PHP_EOL . Indent::_(4) . "\$query->delete(\$db->quoteName('#__ucm_history'));"; - $script .= PHP_EOL . $this->_t(4) . "\$query->where(\$" . $view + $script .= PHP_EOL . Indent::_(4) . "\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . Indent::_(4) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Execute the query to remove " . $viewsCodeName . " items"; - $script .= PHP_EOL . $this->_t(4) . "\$db->execute();"; + $script .= PHP_EOL . Indent::_(4) . "\$db->execute();"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . Indent::_(3) . "}"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; } - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " If All related items was removed queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(2) . "\$app->enqueueMessage(JText:" + $script .= PHP_EOL . Indent::_(2) . "\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__ucm_base table'));"; - $script .= PHP_EOL . $this->_t(2) . "\$app->enqueueMessage(JText:" + $script .= PHP_EOL . Indent::_(2) . "\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__ucm_history table'));"; // finaly remove the assets from the assets table - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Remove " . $component . " assets from the assets table"; - $script .= PHP_EOL . $this->_t(2) . "\$" . $component + $script .= PHP_EOL . Indent::_(2) . "\$" . $component . "_condition = array( \$db->quoteName('name') . ' LIKE ' . \$db->quote('com_" . $component . "%') );"; - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Create a new query object."; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "\$query->delete(\$db->quoteName('#__assets'));"; - $script .= PHP_EOL . $this->_t(2) . "\$query->where(\$" . $component + $script .= PHP_EOL . Indent::_(2) . "\$query->where(\$" . $component . "_condition);"; - $script .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; - $script .= PHP_EOL . $this->_t(2) . "\$" . $view + $script .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . Indent::_(2) . "\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . $this->_t(2) . "if (\$" . $view . "_done)"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(2) . "if (\$" . $view . "_done)"; + $script .= PHP_EOL . Indent::_(2) . "{"; + $script .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " If successfully removed " . $component . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . $this->_t(3) . "\$app->enqueueMessage(JText:" + $script .= PHP_EOL . Indent::_(3) . "\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__assets table'));"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . Indent::_(2) . "}"; // done $script .= PHP_EOL; } @@ -8575,7 +8452,7 @@ class Interpretation extends Fields // column size is varchar(5120) // check if we should add the intelligent fix treatment for the assets table - if (Config::get('add_assets_table_fix') == 2) + if (CFactory::_('Config')->add_assets_table_fix == 2) { // get the type we will convert to $data_type = ($this->accessWorseCase > 64000) ? "MEDIUMTEXT" @@ -8584,18 +8461,18 @@ class Interpretation extends Fields $codeIF = "\$rule_length <= " . $this->accessWorseCase; // fix column size $script = array(); - $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Fix the assets table rules column size"; - $script[] = $this->_t(5) + $script[] = Indent::_(5) . '$fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` ' . $data_type . ' NOT NULL COMMENT \'JSON encoded access control. Enlarged to ' . $data_type . ' by JCB\';";'; - $script[] = $this->_t(5) . "\$db->setQuery(\$fix_rules_size);"; - $script[] = $this->_t(5) . "\$db->execute();"; + $script[] = Indent::_(5) . "\$db->setQuery(\$fix_rules_size);"; + $script[] = Indent::_(5) . "\$db->execute();"; $codeA = implode(PHP_EOL, $script); // fixed message - $messageA = $this->_t(5) + $messageA = Indent::_(5) . "\$app->enqueueMessage(JText::_('The #__assets table rules column was resized to the " . $data_type . " datatype for the components possible large permission rules.'));"; @@ -8622,26 +8499,26 @@ class Interpretation extends Fields protected function getAssetsTableIntelligentUninstall() { // check if we should add the intelligent uninstall treatment for the assets table - if (Config::get('add_assets_table_fix') == 2) + if (CFactory::_('Config')->add_assets_table_fix == 2) { // the if statement about $rule_length $codeIF = "\$rule_length < 5120"; // reverse column size $script = array(); - $script[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Revert the assets table rules column back to the default"; - $script[] = $this->_t(4) + $script[] = Indent::_(4) . '$revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT \'JSON encoded access control.\';";'; - $script[] = $this->_t(4) . "\$db->setQuery(\$revert_rule);"; - $script[] = $this->_t(4) . "\$db->execute();"; + $script[] = Indent::_(4) . "\$db->setQuery(\$revert_rule);"; + $script[] = Indent::_(4) . "\$db->execute();"; $codeA = implode(PHP_EOL, $script); // reverted message - $messageA = $this->_t(4) + $messageA = Indent::_(4) . "\$app->enqueueMessage(JText::_('Reverted the #__assets table rules column back to its default size of varchar(5120)'));"; // do nothing $codeB = ""; // not reverted message - $messageB = $this->_t(4) + $messageB = Indent::_(4) . "\$app->enqueueMessage(JText::_('Could not revert the #__assets table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.'));"; // done @@ -8671,40 +8548,40 @@ class Interpretation extends Fields { // reset script $script = array(); - $script[] = $this->_t($tab) . $this->_t(1) . "//" . $this->setLine( - __LINE__ + $script[] = Indent::_($tab) . Indent::_(1) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get the biggest rule column in the assets table at this point."; - $script[] = $this->_t($tab) . $this->_t(1) + $script[] = Indent::_($tab) . Indent::_(1) . '$get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1";'; - $script[] = $this->_t($tab) . $this->_t(1) + $script[] = Indent::_($tab) . Indent::_(1) . "\$db->setQuery(\$get_rule_length);"; - $script[] = $this->_t($tab) . $this->_t(1) . "if (\$db->execute())"; - $script[] = $this->_t($tab) . $this->_t(1) . "{"; - $script[] = $this->_t($tab) . $this->_t(2) + $script[] = Indent::_($tab) . Indent::_(1) . "if (\$db->execute())"; + $script[] = Indent::_($tab) . Indent::_(1) . "{"; + $script[] = Indent::_($tab) . Indent::_(2) . "\$rule_length = \$db->loadResult();"; // https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L22 // Checked 1st December 2020 (let us know if this changes) - $script[] = $this->_t($tab) . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $script[] = Indent::_($tab) . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Check the size of the rules column"; - $script[] = $this->_t($tab) . $this->_t(2) . "if (" . $codeIF . ")"; - $script[] = $this->_t($tab) . $this->_t(2) . "{"; + $script[] = Indent::_($tab) . Indent::_(2) . "if (" . $codeIF . ")"; + $script[] = Indent::_($tab) . Indent::_(2) . "{"; $script[] = $codeA; $script[] = $messageA; - $script[] = $this->_t($tab) . $this->_t(2) . "}"; + $script[] = Indent::_($tab) . Indent::_(2) . "}"; // only ad this if there is a B part if (StringHelper::check($codeB) || StringHelper::check($messageB)) { - $script[] = $this->_t($tab) . $this->_t(2) . "else"; - $script[] = $this->_t($tab) . $this->_t(2) . "{"; + $script[] = Indent::_($tab) . Indent::_(2) . "else"; + $script[] = Indent::_($tab) . Indent::_(2) . "{"; $script[] = $codeB; $script[] = $messageB; - $script[] = $this->_t($tab) . $this->_t(2) . "}"; + $script[] = Indent::_($tab) . Indent::_(2) . "}"; } - $script[] = $this->_t($tab) . $this->_t(1) . "}"; + $script[] = Indent::_($tab) . Indent::_(1) . "}"; // done return PHP_EOL . implode(PHP_EOL, $script); @@ -8716,9 +8593,9 @@ class Interpretation extends Fields { // reset script $script = array(); - $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " We check if we have dynamic folders to copy"; - $script[] = $this->_t(2) + $script[] = Indent::_(2) . "\$this->setDynamicF0ld3rs(\$app, \$parent);"; // done @@ -8734,54 +8611,54 @@ class Interpretation extends Fields { // reset script $script = array(); - $script[] = $this->_t(1) . "/**"; - $script[] = $this->_t(1) + $script[] = Indent::_(1) . "/**"; + $script[] = Indent::_(1) . " * Method to set/copy dynamic folders into place (use with caution)"; - $script[] = $this->_t(1) . " *"; - $script[] = $this->_t(1) . " * @return void"; - $script[] = $this->_t(1) . " */"; - $script[] = $this->_t(1) + $script[] = Indent::_(1) . " *"; + $script[] = Indent::_(1) . " * @return void"; + $script[] = Indent::_(1) . " */"; + $script[] = Indent::_(1) . "protected function setDynamicF0ld3rs(\$app, \$parent)"; - $script[] = $this->_t(1) . "{"; - $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(1) . "{"; + $script[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get the instalation path"; - $script[] = $this->_t(2) . "\$installer = \$parent->getParent();"; - $script[] = $this->_t(2) + $script[] = Indent::_(2) . "\$installer = \$parent->getParent();"; + $script[] = Indent::_(2) . "\$installPath = \$installer->getPath('source');"; - $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get all the folders"; - $script[] = $this->_t(2) + $script[] = Indent::_(2) . "\$folders = Folder::folders(\$installPath);"; - $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if we have folders we may want to copy"; - $script[] = $this->_t(2) + $script[] = Indent::_(2) . "\$doNotCopy = array('media','admin','site'); // Joomla already deals with these"; - $script[] = $this->_t(2) . "if (count((array) \$folders) > 1)"; - $script[] = $this->_t(2) . "{"; - $script[] = $this->_t(3) . "foreach (\$folders as \$folder)"; - $script[] = $this->_t(3) . "{"; - $script[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(2) . "if (count((array) \$folders) > 1)"; + $script[] = Indent::_(2) . "{"; + $script[] = Indent::_(3) . "foreach (\$folders as \$folder)"; + $script[] = Indent::_(3) . "{"; + $script[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Only copy if not a standard folders"; - $script[] = $this->_t(4) . "if (!in_array(\$folder, \$doNotCopy))"; - $script[] = $this->_t(4) . "{"; - $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(4) . "if (!in_array(\$folder, \$doNotCopy))"; + $script[] = Indent::_(4) . "{"; + $script[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " set the source path"; - $script[] = $this->_t(5) . "\$src = \$installPath.'/'.\$folder;"; - $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(5) . "\$src = \$installPath.'/'.\$folder;"; + $script[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " set the destination path"; - $script[] = $this->_t(5) . "\$dest = JPATH_ROOT.'/'.\$folder;"; - $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $script[] = Indent::_(5) . "\$dest = JPATH_ROOT.'/'.\$folder;"; + $script[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " now try to copy the folder"; - $script[] = $this->_t(5) + $script[] = Indent::_(5) . "if (!Folder::copy(\$src, \$dest, '', true))"; - $script[] = $this->_t(5) . "{"; - $script[] = $this->_t(6) + $script[] = Indent::_(5) . "{"; + $script[] = Indent::_(6) . "\$app->enqueueMessage('Could not copy '.\$folder.' folder into place, please make sure destination is writable!', 'error');"; - $script[] = $this->_t(5) . "}"; - $script[] = $this->_t(4) . "}"; - $script[] = $this->_t(3) . "}"; - $script[] = $this->_t(2) . "}"; - $script[] = $this->_t(1) . "}"; + $script[] = Indent::_(5) . "}"; + $script[] = Indent::_(4) . "}"; + $script[] = Indent::_(3) . "}"; + $script[] = Indent::_(2) . "}"; + $script[] = Indent::_(1) . "}"; // done return PHP_EOL . PHP_EOL . implode(PHP_EOL, $script); @@ -8974,86 +8851,86 @@ class Interpretation extends Fields $nameSingleCode, 'F' ); $routeHelper = array(); - $routeHelper[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $routeHelper[] = $this->_t(1) . " * @param int The route of the " + $routeHelper[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $routeHelper[] = Indent::_(1) . " * @param int The route of the " . $View; - $routeHelper[] = $this->_t(1) . " */"; + $routeHelper[] = Indent::_(1) . " */"; if ('category' === $nameSingleCode || 'categories' === $nameSingleCode) { - $routeHelper[] = $this->_t(1) . "public static function get" + $routeHelper[] = Indent::_(1) . "public static function get" . $View . "Route(\$id = 0)"; } else { - $routeHelper[] = $this->_t(1) . "public static function get" + $routeHelper[] = Indent::_(1) . "public static function get" . $View . "Route(\$id = 0, \$catid = 0)"; } - $routeHelper[] = $this->_t(1) . "{"; - $routeHelper[] = $this->_t(2) . "if (\$id > 0)"; - $routeHelper[] = $this->_t(2) . "{"; - $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $routeHelper[] = Indent::_(1) . "{"; + $routeHelper[] = Indent::_(2) . "if (\$id > 0)"; + $routeHelper[] = Indent::_(2) . "{"; + $routeHelper[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Initialize the needel array."; - $routeHelper[] = $this->_t(3) . "\$needles = array("; - $routeHelper[] = $this->_t(4) . "'" . $nameSingleCode + $routeHelper[] = Indent::_(3) . "\$needles = array("; + $routeHelper[] = Indent::_(4) . "'" . $nameSingleCode . "' => array((int) \$id)"; - $routeHelper[] = $this->_t(3) . ");"; - $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $routeHelper[] = Indent::_(3) . ");"; + $routeHelper[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Create the link"; - $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" - . Config::get('component_code_name') . "&view=" . $nameSingleCode + $routeHelper[] = Indent::_(3) . "\$link = 'index.php?option=com_" + . CFactory::_('Config')->component_code_name . "&view=" . $nameSingleCode . "&id='. \$id;"; - $routeHelper[] = $this->_t(2) . "}"; - $routeHelper[] = $this->_t(2) . "else"; - $routeHelper[] = $this->_t(2) . "{"; - $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $routeHelper[] = Indent::_(2) . "}"; + $routeHelper[] = Indent::_(2) . "else"; + $routeHelper[] = Indent::_(2) . "{"; + $routeHelper[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Initialize the needel array."; - $routeHelper[] = $this->_t(3) . "\$needles = array("; - $routeHelper[] = $this->_t(4) . "'" . $nameSingleCode + $routeHelper[] = Indent::_(3) . "\$needles = array("; + $routeHelper[] = Indent::_(4) . "'" . $nameSingleCode . "' => array()"; - $routeHelper[] = $this->_t(3) . ");"; - $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $routeHelper[] = Indent::_(3) . ");"; + $routeHelper[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Create the link but don't add the id."; - $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" - . Config::get('component_code_name') . "&view=" . $nameSingleCode + $routeHelper[] = Indent::_(3) . "\$link = 'index.php?option=com_" + . CFactory::_('Config')->component_code_name . "&view=" . $nameSingleCode . "';"; - $routeHelper[] = $this->_t(2) . "}"; + $routeHelper[] = Indent::_(2) . "}"; if ('category' != $nameSingleCode && 'categories' != $nameSingleCode) { - $routeHelper[] = $this->_t(2) . "if (\$catid > 1)"; - $routeHelper[] = $this->_t(2) . "{"; - $routeHelper[] = $this->_t(3) + $routeHelper[] = Indent::_(2) . "if (\$catid > 1)"; + $routeHelper[] = Indent::_(2) . "{"; + $routeHelper[] = Indent::_(3) . "\$categories = JCategories::getInstance('" - . Config::get('component_code_name') . "." . $nameListCode . "');"; - $routeHelper[] = $this->_t(3) + . CFactory::_('Config')->component_code_name . "." . $nameListCode . "');"; + $routeHelper[] = Indent::_(3) . "\$category = \$categories->get(\$catid);"; - $routeHelper[] = $this->_t(3) . "if (\$category)"; - $routeHelper[] = $this->_t(3) . "{"; - $routeHelper[] = $this->_t(4) + $routeHelper[] = Indent::_(3) . "if (\$category)"; + $routeHelper[] = Indent::_(3) . "{"; + $routeHelper[] = Indent::_(4) . "\$needles['category'] = array_reverse(\$category->getPath());"; - $routeHelper[] = $this->_t(4) + $routeHelper[] = Indent::_(4) . "\$needles['categories'] = \$needles['category'];"; - $routeHelper[] = $this->_t(4) . "\$link .= '&catid='.\$catid;"; - $routeHelper[] = $this->_t(3) . "}"; - $routeHelper[] = $this->_t(2) . "}"; + $routeHelper[] = Indent::_(4) . "\$link .= '&catid='.\$catid;"; + $routeHelper[] = Indent::_(3) . "}"; + $routeHelper[] = Indent::_(2) . "}"; } if (isset($this->hasMenuGlobal[$nameSingleCode])) { - $routeHelper[] = PHP_EOL . $this->_t(2) + $routeHelper[] = PHP_EOL . Indent::_(2) . "if (\$item = self::_findItem(\$needles, '" . $nameSingleCode . "'))"; } else { - $routeHelper[] = PHP_EOL . $this->_t(2) + $routeHelper[] = PHP_EOL . Indent::_(2) . "if (\$item = self::_findItem(\$needles))"; } - $routeHelper[] = $this->_t(2) . "{"; - $routeHelper[] = $this->_t(3) . "\$link .= '&Itemid='.\$item;"; - $routeHelper[] = $this->_t(2) . "}"; - $routeHelper[] = PHP_EOL . $this->_t(2) . "return \$link;"; - $routeHelper[] = $this->_t(1) . "}"; + $routeHelper[] = Indent::_(2) . "{"; + $routeHelper[] = Indent::_(3) . "\$link .= '&Itemid='.\$item;"; + $routeHelper[] = Indent::_(2) . "}"; + $routeHelper[] = PHP_EOL . Indent::_(2) . "return \$link;"; + $routeHelper[] = Indent::_(1) . "}"; return implode(PHP_EOL, $routeHelper); } @@ -9082,13 +8959,13 @@ class Interpretation extends Fields )) { // load the custom script for the switch based on dynamic get - $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view + $routerSwitch[] = PHP_EOL . Indent::_(3) . "case '" . $view . "':"; - $routerSwitch[] = $this->setPlaceholders( + $routerSwitch[] = CFactory::_('Placeholder')->update( $viewArray['settings']->main_get->php_router_parse, $this->placeholders ); - $routerSwitch[] = $this->_t(4) . "break;"; + $routerSwitch[] = Indent::_(4) . "break;"; return implode(PHP_EOL, $routerSwitch); } @@ -9121,7 +8998,7 @@ class Interpretation extends Fields if (isset($get['selection']['table'])) { $viewTable = str_replace( - '#__' . Config::get('component_code_name') . '_', '', + '#__' . CFactory::_('Config')->component_code_name . '_', '', $get['selection']['table'] ); } @@ -9134,56 +9011,56 @@ class Interpretation extends Fields // add if tags is added, also for all front item views if ($aliasView) { - $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view . "':"; - $routerSwitch[] = $this->_t(4) . "\$vars['view'] = '" . $view + $routerSwitch[] = PHP_EOL . Indent::_(3) . "case '" . $view . "':"; + $routerSwitch[] = Indent::_(4) . "\$vars['view'] = '" . $view . "';"; - $routerSwitch[] = $this->_t(4) + $routerSwitch[] = Indent::_(4) . "if (is_numeric(\$segments[\$count-1]))"; - $routerSwitch[] = $this->_t(4) . "{"; - $routerSwitch[] = $this->_t(5) + $routerSwitch[] = Indent::_(4) . "{"; + $routerSwitch[] = Indent::_(5) . "\$vars['id'] = (int) \$segments[\$count-1];"; - $routerSwitch[] = $this->_t(4) . "}"; - $routerSwitch[] = $this->_t(4) . "elseif (\$segments[\$count-1])"; - $routerSwitch[] = $this->_t(4) . "{"; + $routerSwitch[] = Indent::_(4) . "}"; + $routerSwitch[] = Indent::_(4) . "elseif (\$segments[\$count-1])"; + $routerSwitch[] = Indent::_(4) . "{"; // we need to get from the table of this views main get the alias so we need the table name if ($viewTable) { - $routerSwitch[] = $this->_t(5) . "\$id = \$this->getVar('" + $routerSwitch[] = Indent::_(5) . "\$id = \$this->getVar('" . $viewTable . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; } else { - $routerSwitch[] = $this->_t(5) . "\$id = \$this->getVar('" + $routerSwitch[] = Indent::_(5) . "\$id = \$this->getVar('" . $view . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; } - $routerSwitch[] = $this->_t(5) . "if(\$id)"; - $routerSwitch[] = $this->_t(5) . "{"; - $routerSwitch[] = $this->_t(6) . "\$vars['id'] = \$id;"; - $routerSwitch[] = $this->_t(5) . "}"; - $routerSwitch[] = $this->_t(4) . "}"; - $routerSwitch[] = $this->_t(4) . "break;"; + $routerSwitch[] = Indent::_(5) . "if(\$id)"; + $routerSwitch[] = Indent::_(5) . "{"; + $routerSwitch[] = Indent::_(6) . "\$vars['id'] = \$id;"; + $routerSwitch[] = Indent::_(5) . "}"; + $routerSwitch[] = Indent::_(4) . "}"; + $routerSwitch[] = Indent::_(4) . "break;"; } elseif ($idView) { - $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view . "':"; - $routerSwitch[] = $this->_t(4) . "\$vars['view'] = '" . $view + $routerSwitch[] = PHP_EOL . Indent::_(3) . "case '" . $view . "':"; + $routerSwitch[] = Indent::_(4) . "\$vars['view'] = '" . $view . "';"; - $routerSwitch[] = $this->_t(4) + $routerSwitch[] = Indent::_(4) . "if (is_numeric(\$segments[\$count-1]))"; - $routerSwitch[] = $this->_t(4) . "{"; - $routerSwitch[] = $this->_t(5) + $routerSwitch[] = Indent::_(4) . "{"; + $routerSwitch[] = Indent::_(5) . "\$vars['id'] = (int) \$segments[\$count-1];"; - $routerSwitch[] = $this->_t(4) . "}"; - $routerSwitch[] = $this->_t(4) . "break;"; + $routerSwitch[] = Indent::_(4) . "}"; + $routerSwitch[] = Indent::_(4) . "break;"; } else { - $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view . "':"; - $routerSwitch[] = $this->_t(4) . "\$vars['view'] = '" . $view + $routerSwitch[] = PHP_EOL . Indent::_(3) . "case '" . $view . "':"; + $routerSwitch[] = Indent::_(4) . "\$vars['view'] = '" . $view . "';"; - $routerSwitch[] = $this->_t(4) . "break;"; + $routerSwitch[] = Indent::_(4) . "break;"; } return implode(PHP_EOL, $routerSwitch); @@ -9192,12 +9069,10 @@ class Interpretation extends Fields public function routerBuildViews(&$view) { if (isset( - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] ) && StringHelper::check( - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] )) { return " || \$view === '" . $view . "'"; @@ -9215,8 +9090,7 @@ class Interpretation extends Fields $batchmove = array(); $VIEW = StringHelper::safe($nameSingleCode, 'U'); // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$nameSingleCode])) @@ -9234,37 +9108,37 @@ class Interpretation extends Fields 'php_batchmove', $nameSingleCode, PHP_EOL . PHP_EOL, null, true ); - $batchmove[] = PHP_EOL . $this->_t(1) . "/**"; - $batchmove[] = $this->_t(1) . " * Batch move items to a new category"; - $batchmove[] = $this->_t(1) . " *"; - $batchmove[] = $this->_t(1) + $batchmove[] = PHP_EOL . Indent::_(1) . "/**"; + $batchmove[] = Indent::_(1) . " * Batch move items to a new category"; + $batchmove[] = Indent::_(1) . " *"; + $batchmove[] = Indent::_(1) . " * @param integer \$value The new category ID."; - $batchmove[] = $this->_t(1) + $batchmove[] = Indent::_(1) . " * @param array \$pks An array of row IDs."; - $batchmove[] = $this->_t(1) + $batchmove[] = Indent::_(1) . " * @param array \$contexts An array of item contexts."; - $batchmove[] = $this->_t(1) . " *"; - $batchmove[] = $this->_t(1) + $batchmove[] = Indent::_(1) . " *"; + $batchmove[] = Indent::_(1) . " * @return boolean True if successful, false otherwise and internal error is set."; - $batchmove[] = $this->_t(1) . " *"; - $batchmove[] = $this->_t(1) . " * @since 12.2"; - $batchmove[] = $this->_t(1) . " */"; - $batchmove[] = $this->_t(1) + $batchmove[] = Indent::_(1) . " *"; + $batchmove[] = Indent::_(1) . " * @since 12.2"; + $batchmove[] = Indent::_(1) . " */"; + $batchmove[] = Indent::_(1) . "protected function batchMove(\$values, \$pks, \$contexts)"; - $batchmove[] = $this->_t(1) . "{"; - $batchmove[] = $this->_t(2) . "if (empty(\$this->batchSet))"; - $batchmove[] = $this->_t(2) . "{"; - $batchmove[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchmove[] = Indent::_(1) . "{"; + $batchmove[] = Indent::_(2) . "if (empty(\$this->batchSet))"; + $batchmove[] = Indent::_(2) . "{"; + $batchmove[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set some needed variables."; - $batchmove[] = $this->_t(3) + $batchmove[] = Indent::_(3) . "\$this->user = JFactory::getUser();"; - $batchmove[] = $this->_t(3) + $batchmove[] = Indent::_(3) . "\$this->table = \$this->getTable();"; - $batchmove[] = $this->_t(3) + $batchmove[] = Indent::_(3) . "\$this->tableClassName = get_class(\$this->table);"; - $batchmove[] = $this->_t(3) . "\$this->canDo = " . $Helper + $batchmove[] = Indent::_(3) . "\$this->canDo = " . $Helper . "::getActions('" . $nameSingleCode . "');"; - $batchmove[] = $this->_t(2) . "}"; + $batchmove[] = Indent::_(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) @@ -9276,22 +9150,22 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit']] )) { - $batchmove[] = PHP_EOL . $this->_t(2) . "if (!\$this->canDo->get('" + $batchmove[] = PHP_EOL . Indent::_(2) . "if (!\$this->canDo->get('" . $core['core.edit'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; } else { - $batchmove[] = PHP_EOL . $this->_t(2) + $batchmove[] = PHP_EOL . Indent::_(2) . "if (!\$this->canDo->get('core.edit') && !\$this->canDo->get('core.batch'))"; } - $batchmove[] = $this->_t(2) . "{"; - $batchmove[] = $this->_t(3) . "\$this->setError(JText:" + $batchmove[] = Indent::_(2) . "{"; + $batchmove[] = Indent::_(3) . "\$this->setError(JText:" . ":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; - $batchmove[] = $this->_t(3) . "return false;"; - $batchmove[] = $this->_t(2) . "}" . $customScript; + $batchmove[] = Indent::_(3) . "return false;"; + $batchmove[] = Indent::_(2) . "}" . $customScript; - $batchmove[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchmove[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " make sure published only updates if user has the permission."; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) @@ -9303,50 +9177,50 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.state']] )) { - $batchmove[] = $this->_t(2) + $batchmove[] = Indent::_(2) . "if (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; } else { - $batchmove[] = $this->_t(2) + $batchmove[] = Indent::_(2) . "if (isset(\$values['published']) && !\$this->canDo->get('core.edit.state'))"; } - $batchmove[] = $this->_t(2) . "{"; - $batchmove[] = $this->_t(3) . "unset(\$values['published']);"; - $batchmove[] = $this->_t(2) . "}"; + $batchmove[] = Indent::_(2) . "{"; + $batchmove[] = Indent::_(3) . "unset(\$values['published']);"; + $batchmove[] = Indent::_(2) . "}"; - $batchmove[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchmove[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " remove move_copy from array"; - $batchmove[] = $this->_t(2) . "unset(\$values['move_copy']);"; + $batchmove[] = Indent::_(2) . "unset(\$values['move_copy']);"; if ($category) { - $batchmove[] = PHP_EOL . $this->_t(2) + $batchmove[] = PHP_EOL . Indent::_(2) . "if (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; - $batchmove[] = $this->_t(2) . "{"; - $batchmove[] = $this->_t(3) . "return false;"; - $batchmove[] = $this->_t(2) . "}"; - $batchmove[] = $this->_t(2) + $batchmove[] = Indent::_(2) . "{"; + $batchmove[] = Indent::_(3) . "return false;"; + $batchmove[] = Indent::_(2) . "}"; + $batchmove[] = Indent::_(2) . "elseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; - $batchmove[] = $this->_t(2) . "{"; - $batchmove[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchmove[] = Indent::_(2) . "{"; + $batchmove[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " move the category value to correct field name"; - $batchmove[] = $this->_t(3) . "\$values['" . $category + $batchmove[] = Indent::_(3) . "\$values['" . $category . "'] = \$values['category'];"; - $batchmove[] = $this->_t(3) . "unset(\$values['category']);"; - $batchmove[] = $this->_t(2) . "}"; - $batchmove[] = $this->_t(2) + $batchmove[] = Indent::_(3) . "unset(\$values['category']);"; + $batchmove[] = Indent::_(2) . "}"; + $batchmove[] = Indent::_(2) . "elseif (isset(\$values['category']))"; - $batchmove[] = $this->_t(2) . "{"; - $batchmove[] = $this->_t(3) . "unset(\$values['category']);"; - $batchmove[] = $this->_t(2) . "}" . PHP_EOL; + $batchmove[] = Indent::_(2) . "{"; + $batchmove[] = Indent::_(3) . "unset(\$values['category']);"; + $batchmove[] = Indent::_(2) . "}" . PHP_EOL; } - $batchmove[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchmove[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Parent exists so we proceed"; - $batchmove[] = $this->_t(2) . "foreach (\$pks as \$pk)"; - $batchmove[] = $this->_t(2) . "{"; + $batchmove[] = Indent::_(2) . "foreach (\$pks as \$pk)"; + $batchmove[] = Indent::_(2) . "{"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ArrayHelper::check( @@ -9356,99 +9230,99 @@ class Interpretation extends Fields $nameSingleCode, $this->permissionBuilder[$core['core.edit']] )) { - $batchmove[] = $this->_t(3) . "if (!\$this->user->authorise('" + $batchmove[] = Indent::_(3) . "if (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; } else { - $batchmove[] = $this->_t(3) + $batchmove[] = Indent::_(3) . "if (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; } - $batchmove[] = $this->_t(3) . "{"; - $batchmove[] = $this->_t(4) . "\$this->setError(JText:" + $batchmove[] = Indent::_(3) . "{"; + $batchmove[] = Indent::_(4) . "\$this->setError(JText:" . ":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; - $batchmove[] = $this->_t(4) . "return false;"; - $batchmove[] = $this->_t(3) . "}"; + $batchmove[] = Indent::_(4) . "return false;"; + $batchmove[] = Indent::_(3) . "}"; - $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchmove[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Check that the row actually exists"; - $batchmove[] = $this->_t(3) . "if (!\$this->table->load(\$pk))"; - $batchmove[] = $this->_t(3) . "{"; - $batchmove[] = $this->_t(4) + $batchmove[] = Indent::_(3) . "if (!\$this->table->load(\$pk))"; + $batchmove[] = Indent::_(3) . "{"; + $batchmove[] = Indent::_(4) . "if (\$error = \$this->table->getError())"; - $batchmove[] = $this->_t(4) . "{"; - $batchmove[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $batchmove[] = Indent::_(4) . "{"; + $batchmove[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Fatal error"; - $batchmove[] = $this->_t(5) . "\$this->setError(\$error);"; + $batchmove[] = Indent::_(5) . "\$this->setError(\$error);"; - $batchmove[] = $this->_t(5) . "return false;"; - $batchmove[] = $this->_t(4) . "}"; - $batchmove[] = $this->_t(4) . "else"; - $batchmove[] = $this->_t(4) . "{"; - $batchmove[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $batchmove[] = Indent::_(5) . "return false;"; + $batchmove[] = Indent::_(4) . "}"; + $batchmove[] = Indent::_(4) . "else"; + $batchmove[] = Indent::_(4) . "{"; + $batchmove[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Not fatal error"; - $batchmove[] = $this->_t(5) . "\$this->setError(JText:" + $batchmove[] = Indent::_(5) . "\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; - $batchmove[] = $this->_t(5) . "continue;"; - $batchmove[] = $this->_t(4) . "}"; - $batchmove[] = $this->_t(3) . "}"; + $batchmove[] = Indent::_(5) . "continue;"; + $batchmove[] = Indent::_(4) . "}"; + $batchmove[] = Indent::_(3) . "}"; - $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchmove[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " insert all set values."; - $batchmove[] = $this->_t(3) . "if (" . $Helper + $batchmove[] = Indent::_(3) . "if (" . $Helper . "::checkArray(\$values))"; - $batchmove[] = $this->_t(3) . "{"; - $batchmove[] = $this->_t(4) . "foreach (\$values as \$key => \$value)"; - $batchmove[] = $this->_t(4) . "{"; - $batchmove[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $batchmove[] = Indent::_(3) . "{"; + $batchmove[] = Indent::_(4) . "foreach (\$values as \$key => \$value)"; + $batchmove[] = Indent::_(4) . "{"; + $batchmove[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Do special action for access."; - $batchmove[] = $this->_t(5) + $batchmove[] = Indent::_(5) . "if ('access' === \$key && strlen(\$value) > 0)"; - $batchmove[] = $this->_t(5) . "{"; - $batchmove[] = $this->_t(6) . "\$this->table->\$key = \$value;"; - $batchmove[] = $this->_t(5) . "}"; - $batchmove[] = $this->_t(5) + $batchmove[] = Indent::_(5) . "{"; + $batchmove[] = Indent::_(6) . "\$this->table->\$key = \$value;"; + $batchmove[] = Indent::_(5) . "}"; + $batchmove[] = Indent::_(5) . "elseif (strlen(\$value) > 0 && isset(\$this->table->\$key))"; - $batchmove[] = $this->_t(5) . "{"; - $batchmove[] = $this->_t(6) . "\$this->table->\$key = \$value;"; - $batchmove[] = $this->_t(5) . "}"; - $batchmove[] = $this->_t(4) . "}"; - $batchmove[] = $this->_t(3) . "}" . PHP_EOL; + $batchmove[] = Indent::_(5) . "{"; + $batchmove[] = Indent::_(6) . "\$this->table->\$key = \$value;"; + $batchmove[] = Indent::_(5) . "}"; + $batchmove[] = Indent::_(4) . "}"; + $batchmove[] = Indent::_(3) . "}" . PHP_EOL; - $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchmove[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Check the row."; - $batchmove[] = $this->_t(3) . "if (!\$this->table->check())"; - $batchmove[] = $this->_t(3) . "{"; - $batchmove[] = $this->_t(4) + $batchmove[] = Indent::_(3) . "if (!\$this->table->check())"; + $batchmove[] = Indent::_(3) . "{"; + $batchmove[] = Indent::_(4) . "\$this->setError(\$this->table->getError());"; - $batchmove[] = PHP_EOL . $this->_t(4) . "return false;"; - $batchmove[] = $this->_t(3) . "}"; + $batchmove[] = PHP_EOL . Indent::_(4) . "return false;"; + $batchmove[] = Indent::_(3) . "}"; - $batchmove[] = PHP_EOL . $this->_t(3) . "if (!empty(\$this->type))"; - $batchmove[] = $this->_t(3) . "{"; - $batchmove[] = $this->_t(4) + $batchmove[] = PHP_EOL . Indent::_(3) . "if (!empty(\$this->type))"; + $batchmove[] = Indent::_(3) . "{"; + $batchmove[] = Indent::_(4) . "\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; - $batchmove[] = $this->_t(3) . "}"; + $batchmove[] = Indent::_(3) . "}"; - $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchmove[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Store the row."; - $batchmove[] = $this->_t(3) . "if (!\$this->table->store())"; - $batchmove[] = $this->_t(3) . "{"; - $batchmove[] = $this->_t(4) + $batchmove[] = Indent::_(3) . "if (!\$this->table->store())"; + $batchmove[] = Indent::_(3) . "{"; + $batchmove[] = Indent::_(4) . "\$this->setError(\$this->table->getError());"; - $batchmove[] = PHP_EOL . $this->_t(4) . "return false;"; - $batchmove[] = $this->_t(3) . "}"; - $batchmove[] = $this->_t(2) . "}"; + $batchmove[] = PHP_EOL . Indent::_(4) . "return false;"; + $batchmove[] = Indent::_(3) . "}"; + $batchmove[] = Indent::_(2) . "}"; - $batchmove[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchmove[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Clean the cache"; - $batchmove[] = $this->_t(2) . "\$this->cleanCache();"; + $batchmove[] = Indent::_(2) . "\$this->cleanCache();"; - $batchmove[] = PHP_EOL . $this->_t(2) . "return true;"; - $batchmove[] = $this->_t(1) . "}"; + $batchmove[] = PHP_EOL . Indent::_(2) . "return true;"; + $batchmove[] = Indent::_(1) . "}"; return PHP_EOL . implode(PHP_EOL, $batchmove); } @@ -9463,8 +9337,7 @@ class Interpretation extends Fields $batchcopy = array(); $VIEW = StringHelper::safe($nameSingleCode, 'U'); // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$nameSingleCode])) @@ -9512,39 +9385,39 @@ class Interpretation extends Fields 'php_batchcopy', $nameSingleCode, PHP_EOL . PHP_EOL, null, true ); - $batchcopy[] = PHP_EOL . $this->_t(1) . "/**"; - $batchcopy[] = $this->_t(1) + $batchcopy[] = PHP_EOL . Indent::_(1) . "/**"; + $batchcopy[] = Indent::_(1) . " * Batch copy items to a new category or current."; - $batchcopy[] = $this->_t(1) . " *"; - $batchcopy[] = $this->_t(1) + $batchcopy[] = Indent::_(1) . " *"; + $batchcopy[] = Indent::_(1) . " * @param integer \$values The new values."; - $batchcopy[] = $this->_t(1) + $batchcopy[] = Indent::_(1) . " * @param array \$pks An array of row IDs."; - $batchcopy[] = $this->_t(1) + $batchcopy[] = Indent::_(1) . " * @param array \$contexts An array of item contexts."; - $batchcopy[] = $this->_t(1) . " *"; - $batchcopy[] = $this->_t(1) + $batchcopy[] = Indent::_(1) . " *"; + $batchcopy[] = Indent::_(1) . " * @return mixed An array of new IDs on success, boolean false on failure."; - $batchcopy[] = $this->_t(1) . " *"; - $batchcopy[] = $this->_t(1) . " * @since 12.2"; - $batchcopy[] = $this->_t(1) . " */"; - $batchcopy[] = $this->_t(1) + $batchcopy[] = Indent::_(1) . " *"; + $batchcopy[] = Indent::_(1) . " * @since 12.2"; + $batchcopy[] = Indent::_(1) . " */"; + $batchcopy[] = Indent::_(1) . "protected function batchCopy(\$values, \$pks, \$contexts)"; - $batchcopy[] = $this->_t(1) . "{"; + $batchcopy[] = Indent::_(1) . "{"; - $batchcopy[] = $this->_t(2) . "if (empty(\$this->batchSet))"; - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(2) . "if (empty(\$this->batchSet))"; + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set some needed variables."; - $batchcopy[] = $this->_t(3) + $batchcopy[] = Indent::_(3) . "\$this->user = JFactory::getUser();"; - $batchcopy[] = $this->_t(3) + $batchcopy[] = Indent::_(3) . "\$this->table = \$this->getTable();"; - $batchcopy[] = $this->_t(3) + $batchcopy[] = Indent::_(3) . "\$this->tableClassName = get_class(\$this->table);"; - $batchcopy[] = $this->_t(3) . "\$this->canDo = " . $Helper + $batchcopy[] = Indent::_(3) . "\$this->canDo = " . $Helper . "::getActions('" . $nameSingleCode . "');"; - $batchcopy[] = $this->_t(2) . "}"; + $batchcopy[] = Indent::_(2) . "}"; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ArrayHelper::check( @@ -9555,33 +9428,33 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.create']] )) { - $batchcopy[] = PHP_EOL . $this->_t(2) . "if (!\$this->canDo->get('" + $batchcopy[] = PHP_EOL . Indent::_(2) . "if (!\$this->canDo->get('" . $core['core.create'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; } else { - $batchcopy[] = PHP_EOL . $this->_t(2) + $batchcopy[] = PHP_EOL . Indent::_(2) . "if (!\$this->canDo->get('core.create') || !\$this->canDo->get('core.batch'))"; } - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(3) . "return false;"; - $batchcopy[] = $this->_t(2) . "}" . $customScript; + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(3) . "return false;"; + $batchcopy[] = Indent::_(2) . "}" . $customScript; - $batchcopy[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get list of unique fields"; - $batchcopy[] = $this->_t(2) + $batchcopy[] = Indent::_(2) . "\$uniqueFields = \$this->getUniqueFields();"; - $batchcopy[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " remove move_copy from array"; - $batchcopy[] = $this->_t(2) . "unset(\$values['move_copy']);"; + $batchcopy[] = Indent::_(2) . "unset(\$values['move_copy']);"; - $batchcopy[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " make sure published is set"; - $batchcopy[] = $this->_t(2) . "if (!isset(\$values['published']))"; - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(3) . "\$values['published'] = 0;"; - $batchcopy[] = $this->_t(2) . "}"; + $batchcopy[] = Indent::_(2) . "if (!isset(\$values['published']))"; + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(3) . "\$values['published'] = 0;"; + $batchcopy[] = Indent::_(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ArrayHelper::check( @@ -9592,55 +9465,55 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.state']] )) { - $batchcopy[] = $this->_t(2) + $batchcopy[] = Indent::_(2) . "elseif (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; } else { - $batchcopy[] = $this->_t(2) + $batchcopy[] = Indent::_(2) . "elseif (isset(\$values['published']) && !\$this->canDo->get('core.edit.state'))"; } - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(4) . "\$values['published'] = 0;"; - $batchcopy[] = $this->_t(2) . "}"; + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(4) . "\$values['published'] = 0;"; + $batchcopy[] = Indent::_(2) . "}"; if ($category) { - $batchcopy[] = PHP_EOL . $this->_t(2) + $batchcopy[] = PHP_EOL . Indent::_(2) . "if (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(3) . "return false;"; - $batchcopy[] = $this->_t(2) . "}"; - $batchcopy[] = $this->_t(2) + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(3) . "return false;"; + $batchcopy[] = Indent::_(2) . "}"; + $batchcopy[] = Indent::_(2) . "elseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " move the category value to correct field name"; - $batchcopy[] = $this->_t(3) . "\$values['" . $category + $batchcopy[] = Indent::_(3) . "\$values['" . $category . "'] = \$values['category'];"; - $batchcopy[] = $this->_t(3) . "unset(\$values['category']);"; - $batchcopy[] = $this->_t(2) . "}"; - $batchcopy[] = $this->_t(2) + $batchcopy[] = Indent::_(3) . "unset(\$values['category']);"; + $batchcopy[] = Indent::_(2) . "}"; + $batchcopy[] = Indent::_(2) . "elseif (isset(\$values['category']))"; - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(3) . "unset(\$values['category']);"; - $batchcopy[] = $this->_t(2) . "}"; + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(3) . "unset(\$values['category']);"; + $batchcopy[] = Indent::_(2) . "}"; } - $batchcopy[] = PHP_EOL . $this->_t(2) . "\$newIds = array();"; + $batchcopy[] = PHP_EOL . Indent::_(2) . "\$newIds = array();"; - $batchcopy[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Parent exists so let's proceed"; - $batchcopy[] = $this->_t(2) . "while (!empty(\$pks))"; - $batchcopy[] = $this->_t(2) . "{"; - $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(2) . "while (!empty(\$pks))"; + $batchcopy[] = Indent::_(2) . "{"; + $batchcopy[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Pop the first ID off the stack"; - $batchcopy[] = $this->_t(3) . "\$pk = array_shift(\$pks);"; + $batchcopy[] = Indent::_(3) . "\$pk = array_shift(\$pks);"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "\$this->table->reset();"; + $batchcopy[] = PHP_EOL . Indent::_(3) . "\$this->table->reset();"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " only allow copy if user may edit this item."; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) @@ -9651,88 +9524,88 @@ class Interpretation extends Fields $nameSingleCode, $this->permissionBuilder[$core['core.edit']] )) { - $batchcopy[] = $this->_t(3) . "if (!\$this->user->authorise('" + $batchcopy[] = Indent::_(3) . "if (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; } else { - $batchcopy[] = $this->_t(3) + $batchcopy[] = Indent::_(3) . "if (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; } - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Not fatal error"; - $batchcopy[] = $this->_t(4) . "\$this->setError(JText:" + $batchcopy[] = Indent::_(4) . "\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; - $batchcopy[] = $this->_t(4) . "continue;"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = Indent::_(4) . "continue;"; + $batchcopy[] = Indent::_(3) . "}"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Check that the row actually exists"; - $batchcopy[] = $this->_t(3) . "if (!\$this->table->load(\$pk))"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) + $batchcopy[] = Indent::_(3) . "if (!\$this->table->load(\$pk))"; + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "if (\$error = \$this->table->getError())"; - $batchcopy[] = $this->_t(4) . "{"; - $batchcopy[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(4) . "{"; + $batchcopy[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Fatal error"; - $batchcopy[] = $this->_t(5) . "\$this->setError(\$error);"; + $batchcopy[] = Indent::_(5) . "\$this->setError(\$error);"; - $batchcopy[] = $this->_t(5) . "return false;"; - $batchcopy[] = $this->_t(4) . "}"; - $batchcopy[] = $this->_t(4) . "else"; - $batchcopy[] = $this->_t(4) . "{"; - $batchcopy[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(5) . "return false;"; + $batchcopy[] = Indent::_(4) . "}"; + $batchcopy[] = Indent::_(4) . "else"; + $batchcopy[] = Indent::_(4) . "{"; + $batchcopy[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Not fatal error"; - $batchcopy[] = $this->_t(5) . "\$this->setError(JText:" + $batchcopy[] = Indent::_(5) . "\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; - $batchcopy[] = $this->_t(5) . "continue;"; - $batchcopy[] = $this->_t(4) . "}"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = Indent::_(5) . "continue;"; + $batchcopy[] = Indent::_(4) . "}"; + $batchcopy[] = Indent::_(3) . "}"; if ($category && $alias === 'alias' && ($title && count($titles) == 1 && in_array('title', $titles))) { - $batchcopy[] = PHP_EOL . $this->_t(3) . "if (isset(\$values['" + $batchcopy[] = PHP_EOL . Indent::_(3) . "if (isset(\$values['" . $category . "']))"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "static::generateTitle((int) \$values['" . $category . "'], \$this->table);"; - $batchcopy[] = $this->_t(3) . "}"; - $batchcopy[] = $this->_t(3) . "else"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) + $batchcopy[] = Indent::_(3) . "}"; + $batchcopy[] = Indent::_(3) . "else"; + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "static::generateTitle((int) \$this->table->" . $category . ", \$this->table);"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = Indent::_(3) . "}"; } elseif ($category && $alias && ($title && count($titles) == 1)) { - $batchcopy[] = PHP_EOL . $this->_t(3) . "if (isset(\$values['" + $batchcopy[] = PHP_EOL . Indent::_(3) . "if (isset(\$values['" . $category . "']))"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) . "list(\$this->table->" . implode( + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "list(\$this->table->" . implode( '', $titles ) . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$values['" . $category . "'], \$this->table->" . $alias . ", \$this->table->" . implode('', $titles) . ");"; - $batchcopy[] = $this->_t(3) . "}"; - $batchcopy[] = $this->_t(3) . "else"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) . "list(\$this->table->" . implode( + $batchcopy[] = Indent::_(3) . "}"; + $batchcopy[] = Indent::_(3) . "else"; + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "list(\$this->table->" . implode( '', $titles ) . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$this->table->" . $category . ", \$this->table->" . $alias . ", \$this->table->" . implode( '', $titles ) . ");"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = Indent::_(3) . "}"; } elseif (!$category && $alias && ($title && count($titles) == 1)) { - $batchcopy[] = $this->_t(3) . "list(\$this->table->" . implode( + $batchcopy[] = Indent::_(3) . "list(\$this->table->" . implode( '', $titles ) . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias @@ -9740,7 +9613,7 @@ class Interpretation extends Fields } elseif (!$category && $alias && $title) { - $batchcopy[] = $this->_t(3) . "list(" . implode(', ', $titleData) + $batchcopy[] = Indent::_(3) . "list(" . implode(', ', $titleData) . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", array(" . implode(', ', $titleData) . "));"; @@ -9752,99 +9625,99 @@ class Interpretation extends Fields 'jobnumber', $titles ))) // TODO [jobnumber] just for one project (not ideal) { - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Only for strings"; - $batchcopy[] = $this->_t(3) . "if (" . $Helper + $batchcopy[] = Indent::_(3) . "if (" . $Helper . "::checkString(\$this->table->" . implode('', $titles) . ") && !is_numeric(\$this->table->" . implode('', $titles) . "))"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) . "\$this->table->" . implode( + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "\$this->table->" . implode( '', $titles ) . " = \$this->generateUnique('" . implode('', $titles) . "',\$this->table->" . implode('', $titles) . ");"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = Indent::_(3) . "}"; } - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " insert all set values"; - $batchcopy[] = $this->_t(3) . "if (" . $Helper + $batchcopy[] = Indent::_(3) . "if (" . $Helper . "::checkArray(\$values))"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) . "foreach (\$values as \$key => \$value)"; - $batchcopy[] = $this->_t(4) . "{"; - $batchcopy[] = $this->_t(5) + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "foreach (\$values as \$key => \$value)"; + $batchcopy[] = Indent::_(4) . "{"; + $batchcopy[] = Indent::_(5) . "if (strlen(\$value) > 0 && isset(\$this->table->\$key))"; - $batchcopy[] = $this->_t(5) . "{"; - $batchcopy[] = $this->_t(6) . "\$this->table->\$key = \$value;"; - $batchcopy[] = $this->_t(5) . "}"; - $batchcopy[] = $this->_t(4) . "}"; - $batchcopy[] = $this->_t(3) . "}" . PHP_EOL; + $batchcopy[] = Indent::_(5) . "{"; + $batchcopy[] = Indent::_(6) . "\$this->table->\$key = \$value;"; + $batchcopy[] = Indent::_(5) . "}"; + $batchcopy[] = Indent::_(4) . "}"; + $batchcopy[] = Indent::_(3) . "}" . PHP_EOL; - $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " update all unique fields"; - $batchcopy[] = $this->_t(3) . "if (" . $Helper + $batchcopy[] = Indent::_(3) . "if (" . $Helper . "::checkArray(\$uniqueFields))"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "foreach (\$uniqueFields as \$uniqueField)"; - $batchcopy[] = $this->_t(4) . "{"; - $batchcopy[] = $this->_t(5) + $batchcopy[] = Indent::_(4) . "{"; + $batchcopy[] = Indent::_(5) . "\$this->table->\$uniqueField = \$this->generateUnique(\$uniqueField,\$this->table->\$uniqueField);"; - $batchcopy[] = $this->_t(4) . "}"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = Indent::_(4) . "}"; + $batchcopy[] = Indent::_(3) . "}"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Reset the ID because we are making a copy"; - $batchcopy[] = $this->_t(3) . "\$this->table->id = 0;"; + $batchcopy[] = Indent::_(3) . "\$this->table->id = 0;"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " TODO: Deal with ordering?"; - $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " \$this->table->ordering = 1;"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Check the row."; - $batchcopy[] = $this->_t(3) . "if (!\$this->table->check())"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) + $batchcopy[] = Indent::_(3) . "if (!\$this->table->check())"; + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "\$this->setError(\$this->table->getError());"; - $batchcopy[] = PHP_EOL . $this->_t(4) . "return false;"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = PHP_EOL . Indent::_(4) . "return false;"; + $batchcopy[] = Indent::_(3) . "}"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "if (!empty(\$this->type))"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) + $batchcopy[] = PHP_EOL . Indent::_(3) . "if (!empty(\$this->type))"; + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = Indent::_(3) . "}"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Store the row."; - $batchcopy[] = $this->_t(3) . "if (!\$this->table->store())"; - $batchcopy[] = $this->_t(3) . "{"; - $batchcopy[] = $this->_t(4) + $batchcopy[] = Indent::_(3) . "if (!\$this->table->store())"; + $batchcopy[] = Indent::_(3) . "{"; + $batchcopy[] = Indent::_(4) . "\$this->setError(\$this->table->getError());"; - $batchcopy[] = PHP_EOL . $this->_t(4) . "return false;"; - $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = PHP_EOL . Indent::_(4) . "return false;"; + $batchcopy[] = Indent::_(3) . "}"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get the new item ID"; - $batchcopy[] = $this->_t(3) . "\$newId = \$this->table->get('id');"; + $batchcopy[] = Indent::_(3) . "\$newId = \$this->table->get('id');"; - $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Add the new ID to the array"; - $batchcopy[] = $this->_t(3) . "\$newIds[\$pk] = \$newId;"; - $batchcopy[] = $this->_t(2) . "}"; + $batchcopy[] = Indent::_(3) . "\$newIds[\$pk] = \$newId;"; + $batchcopy[] = Indent::_(2) . "}"; - $batchcopy[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $batchcopy[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Clean the cache"; - $batchcopy[] = $this->_t(2) . "\$this->cleanCache();"; + $batchcopy[] = Indent::_(2) . "\$this->cleanCache();"; - $batchcopy[] = PHP_EOL . $this->_t(2) . "return \$newIds;"; - $batchcopy[] = $this->_t(1) . "}"; + $batchcopy[] = PHP_EOL . Indent::_(2) . "return \$newIds;"; + $batchcopy[] = Indent::_(1) . "}"; return PHP_EOL . implode(PHP_EOL, $batchcopy); } @@ -9884,16 +9757,16 @@ class Interpretation extends Fields $titles = array($this->titleBuilder[$nameSingleCode]); } // start building the fix - $fixUnique[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $fixUnique[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Alter the " . implode(', ', $titles) . " for save as copy"; - $fixUnique[] = $this->_t(2) + $fixUnique[] = Indent::_(2) . "if (\$input->get('task') === 'save2copy')"; - $fixUnique[] = $this->_t(2) . "{"; - $fixUnique[] = $this->_t(3) + $fixUnique[] = Indent::_(2) . "{"; + $fixUnique[] = Indent::_(3) . "\$origTable = clone \$this->getTable();"; - $fixUnique[] = $this->_t(3) + $fixUnique[] = Indent::_(3) . "\$origTable->load(\$input->getInt('id'));"; // reset the buckets $ifStatment = array(); @@ -9907,16 +9780,16 @@ class Interpretation extends Fields . $title; $titleVars[] = "\$" . $title; $titleData[] = "\$data['" . $title . "']"; - $titleUpdate[] = $this->_t(4) . "\$data['" . $title . "'] = \$" + $titleUpdate[] = Indent::_(4) . "\$data['" . $title . "'] = \$" . $title . ";"; } - $fixUnique[] = PHP_EOL . $this->_t(3) . "if (" . implode( + $fixUnique[] = PHP_EOL . Indent::_(3) . "if (" . implode( ' || ', $ifStatment ) . ")"; - $fixUnique[] = $this->_t(3) . "{"; + $fixUnique[] = Indent::_(3) . "{"; if ($setCategory && count((array) $titles) == 1) { - $fixUnique[] = $this->_t(4) . "list(" . implode('', $titleVars) + $fixUnique[] = Indent::_(4) . "list(" . implode('', $titleVars) . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], " . implode( '', $titleData @@ -9924,7 +9797,7 @@ class Interpretation extends Fields } elseif (count((array) $titles) == 1) { - $fixUnique[] = $this->_t(4) . "list(" . implode( + $fixUnique[] = Indent::_(4) . "list(" . implode( ', ', $titleVars ) . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" @@ -9932,131 +9805,129 @@ class Interpretation extends Fields } else { - $fixUnique[] = $this->_t(4) . "list(" . implode( + $fixUnique[] = Indent::_(4) . "list(" . implode( ', ', $titleVars ) . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], array(" . implode(', ', $titleData) . "));"; } $fixUnique[] = implode("\n", $titleUpdate); - $fixUnique[] = $this->_t(4) . "\$data['" . $alias . "'] = \$" + $fixUnique[] = Indent::_(4) . "\$data['" . $alias . "'] = \$" . $alias . ";"; - $fixUnique[] = $this->_t(3) . "}"; - $fixUnique[] = $this->_t(3) . "else"; - $fixUnique[] = $this->_t(3) . "{"; - $fixUnique[] = $this->_t(4) . "if (\$data['" . $alias + $fixUnique[] = Indent::_(3) . "}"; + $fixUnique[] = Indent::_(3) . "else"; + $fixUnique[] = Indent::_(3) . "{"; + $fixUnique[] = Indent::_(4) . "if (\$data['" . $alias . "'] == \$origTable->" . $alias . ")"; - $fixUnique[] = $this->_t(4) . "{"; - $fixUnique[] = $this->_t(5) . "\$data['" . $alias . "'] = '';"; - $fixUnique[] = $this->_t(4) . "}"; - $fixUnique[] = $this->_t(3) . "}"; - $fixUnique[] = PHP_EOL . $this->_t(3) . "\$data['published'] = 0;"; - $fixUnique[] = $this->_t(2) . "}"; - $fixUnique[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $fixUnique[] = Indent::_(4) . "{"; + $fixUnique[] = Indent::_(5) . "\$data['" . $alias . "'] = '';"; + $fixUnique[] = Indent::_(4) . "}"; + $fixUnique[] = Indent::_(3) . "}"; + $fixUnique[] = PHP_EOL . Indent::_(3) . "\$data['published'] = 0;"; + $fixUnique[] = Indent::_(2) . "}"; + $fixUnique[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Automatic handling of " . $alias . " for empty fields"; - $fixUnique[] = $this->_t(2) + $fixUnique[] = Indent::_(2) . "if (in_array(\$input->get('task'), array('apply', 'save', 'save2new')) && (int) \$input->get('id') == 0)"; - $fixUnique[] = $this->_t(2) . "{"; - $fixUnique[] = $this->_t(3) . "if (\$data['" . $alias + $fixUnique[] = Indent::_(2) . "{"; + $fixUnique[] = Indent::_(3) . "if (\$data['" . $alias . "'] == null || empty(\$data['" . $alias . "']))"; - $fixUnique[] = $this->_t(3) . "{"; - $fixUnique[] = $this->_t(4) + $fixUnique[] = Indent::_(3) . "{"; + $fixUnique[] = Indent::_(4) . "if (JFactory::getConfig()->get('unicodeslugs') == 1)"; - $fixUnique[] = $this->_t(4) . "{"; - $fixUnique[] = $this->_t(5) . "\$data['" . $alias + $fixUnique[] = Indent::_(4) . "{"; + $fixUnique[] = Indent::_(5) . "\$data['" . $alias . "'] = JFilterOutput::stringURLUnicodeSlug(" . implode( ' . " " . ', $titleData ) . ");"; - $fixUnique[] = $this->_t(4) . "}"; - $fixUnique[] = $this->_t(4) . "else"; - $fixUnique[] = $this->_t(4) . "{"; - $fixUnique[] = $this->_t(5) . "\$data['" . $alias + $fixUnique[] = Indent::_(4) . "}"; + $fixUnique[] = Indent::_(4) . "else"; + $fixUnique[] = Indent::_(4) . "{"; + $fixUnique[] = Indent::_(5) . "\$data['" . $alias . "'] = JFilterOutput::stringURLSafe(" . implode( ' . " " . ', $titleData ) . ");"; - $fixUnique[] = $this->_t(4) . "}"; - $fixUnique[] = PHP_EOL . $this->_t(4) + $fixUnique[] = Indent::_(4) . "}"; + $fixUnique[] = PHP_EOL . Indent::_(4) . "\$table = JTable::getInstance('" . $nameSingleCode . "', '" - . Config::get('component_code_name') . "Table');"; + . CFactory::_('Config')->component_code_name . "Table');"; if ($setCategory && count($titles) == 1) { - $fixUnique[] = PHP_EOL . $this->_t(4) + $fixUnique[] = PHP_EOL . Indent::_(4) . "if (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'], '" . $category . "' => \$data['" . $category . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; - $fixUnique[] = $this->_t(4) . "{"; - $fixUnique[] = $this->_t(5) . "\$msg = JText:" . ":_('COM_" - . $this->fileContentStatic[$this->hhh . 'COMPONENT' - . $this->hhh] . "_" . $VIEW . "_SAVE_WARNING');"; - $fixUnique[] = $this->_t(4) . "}"; - $fixUnique[] = PHP_EOL . $this->_t(4) . "list(" . implode( + $fixUnique[] = Indent::_(4) . "{"; + $fixUnique[] = Indent::_(5) . "\$msg = JText:" . ":_('COM_" + . $this->fileContentStatic[Placefix::_h('COMPONENT')] . "_" . $VIEW . "_SAVE_WARNING');"; + $fixUnique[] = Indent::_(4) . "}"; + $fixUnique[] = PHP_EOL . Indent::_(4) . "list(" . implode( '', $titleVars ) . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], " . implode('', $titleData) . ");"; - $fixUnique[] = $this->_t(4) . "\$data['" . $alias . "'] = \$" + $fixUnique[] = Indent::_(4) . "\$data['" . $alias . "'] = \$" . $alias . ";"; } else { - $fixUnique[] = PHP_EOL . $this->_t(4) + $fixUnique[] = PHP_EOL . Indent::_(4) . "if (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; - $fixUnique[] = $this->_t(4) . "{"; - $fixUnique[] = $this->_t(5) . "\$msg = JText:" . ":_('COM_" - . $this->fileContentStatic[$this->hhh . 'COMPONENT' - . $this->hhh] . "_" . $VIEW . "_SAVE_WARNING');"; - $fixUnique[] = $this->_t(4) . "}"; - $fixUnique[] = PHP_EOL . $this->_t(4) . "\$data['" . $alias + $fixUnique[] = Indent::_(4) . "{"; + $fixUnique[] = Indent::_(5) . "\$msg = JText:" . ":_('COM_" + . $this->fileContentStatic[Placefix::_h('COMPONENT')] . "_" . $VIEW . "_SAVE_WARNING');"; + $fixUnique[] = Indent::_(4) . "}"; + $fixUnique[] = PHP_EOL . Indent::_(4) . "\$data['" . $alias . "'] = \$this->_generateNewTitle(\$data['" . $alias . "']);"; } - $fixUnique[] = PHP_EOL . $this->_t(4) . "if (isset(\$msg))"; - $fixUnique[] = $this->_t(4) . "{"; - $fixUnique[] = $this->_t(5) + $fixUnique[] = PHP_EOL . Indent::_(4) . "if (isset(\$msg))"; + $fixUnique[] = Indent::_(4) . "{"; + $fixUnique[] = Indent::_(5) . "JFactory::getApplication()->enqueueMessage(\$msg, 'warning');"; - $fixUnique[] = $this->_t(4) . "}"; - $fixUnique[] = $this->_t(3) . "}"; - $fixUnique[] = $this->_t(2) . "}"; + $fixUnique[] = Indent::_(4) . "}"; + $fixUnique[] = Indent::_(3) . "}"; + $fixUnique[] = Indent::_(2) . "}"; -// $fixUnique[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Update alias if still empty at this point"; -// $fixUnique[] = $this->_t(2) . "if (\$data['" . $alias . "'] == null || empty(\$data['" . $alias . "']))"; -// $fixUnique[] = $this->_t(2) . "{"; -// $fixUnique[] = $this->_t(3) . "if (JFactory::getConfig()->get('unicodeslugs') == 1)"; -// $fixUnique[] = $this->_t(3) . "{"; -// $fixUnique[] = $this->_t(4) . "\$data['" . $alias . "'] = JFilterOutput::stringURLUnicodeSlug(" . implode(' . " " . ', $titleData) . ");"; -// $fixUnique[] = $this->_t(3) . "}"; -// $fixUnique[] = $this->_t(3) . "else"; -// $fixUnique[] = $this->_t(3) . "{"; -// $fixUnique[] = $this->_t(4) . "\$data['" . $alias . "'] = JFilterOutput::stringURLSafe(" . implode(' . " " . ', $titleData) . ");"; -// $fixUnique[] = $this->_t(3) . "}"; -// $fixUnique[] = $this->_t(2) . "}"; +// $fixUnique[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Update alias if still empty at this point"; +// $fixUnique[] = Indent::_(2) . "if (\$data['" . $alias . "'] == null || empty(\$data['" . $alias . "']))"; +// $fixUnique[] = Indent::_(2) . "{"; +// $fixUnique[] = Indent::_(3) . "if (JFactory::getConfig()->get('unicodeslugs') == 1)"; +// $fixUnique[] = Indent::_(3) . "{"; +// $fixUnique[] = Indent::_(4) . "\$data['" . $alias . "'] = JFilterOutput::stringURLUnicodeSlug(" . implode(' . " " . ', $titleData) . ");"; +// $fixUnique[] = Indent::_(3) . "}"; +// $fixUnique[] = Indent::_(3) . "else"; +// $fixUnique[] = Indent::_(3) . "{"; +// $fixUnique[] = Indent::_(4) . "\$data['" . $alias . "'] = JFilterOutput::stringURLSafe(" . implode(' . " " . ', $titleData) . ");"; +// $fixUnique[] = Indent::_(3) . "}"; +// $fixUnique[] = Indent::_(2) . "}"; } // handel other unique fields - $fixUnique[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $fixUnique[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Alter the unique field for save as copy"; - $fixUnique[] = $this->_t(2) + $fixUnique[] = Indent::_(2) . "if (\$input->get('task') === 'save2copy')"; - $fixUnique[] = $this->_t(2) . "{"; - $fixUnique[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $fixUnique[] = Indent::_(2) . "{"; + $fixUnique[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Automatic handling of other unique fields"; - $fixUnique[] = $this->_t(3) + $fixUnique[] = Indent::_(3) . "\$uniqueFields = \$this->getUniqueFields();"; - $fixUnique[] = $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] + $fixUnique[] = Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uniqueFields))"; - $fixUnique[] = $this->_t(3) . "{"; - $fixUnique[] = $this->_t(4) + $fixUnique[] = Indent::_(3) . "{"; + $fixUnique[] = Indent::_(4) . "foreach (\$uniqueFields as \$uniqueField)"; - $fixUnique[] = $this->_t(4) . "{"; - $fixUnique[] = $this->_t(5) + $fixUnique[] = Indent::_(4) . "{"; + $fixUnique[] = Indent::_(5) . "\$data[\$uniqueField] = \$this->generateUnique(\$uniqueField,\$data[\$uniqueField]);"; - $fixUnique[] = $this->_t(4) . "}"; - $fixUnique[] = $this->_t(3) . "}"; - $fixUnique[] = $this->_t(2) . "}"; + $fixUnique[] = Indent::_(4) . "}"; + $fixUnique[] = Indent::_(3) . "}"; + $fixUnique[] = Indent::_(2) . "}"; return PHP_EOL . implode(PHP_EOL, $fixUnique); } @@ -10069,104 +9940,103 @@ class Interpretation extends Fields || isset($this->customAliasBuilder[$nameSingleCode]))) { // get component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; // rest the new function $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $newFunction[] = $this->_t(1) + $newFunction[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $newFunction[] = Indent::_(1) . " * Method to change the title/s & alias."; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " * @param string \$alias The alias."; - $newFunction[] = $this->_t(1) + $newFunction[] = Indent::_(1) . " * @param string/array \$title The title."; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " * @return array/string Contains the modified title/s and/or alias."; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) . " */"; - $newFunction[] = $this->_t(1) + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " */"; + $newFunction[] = Indent::_(1) . "protected function _generateNewTitle(\$alias, \$title = null)"; - $newFunction[] = $this->_t(1) . "{"; - $newFunction[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $newFunction[] = Indent::_(1) . "{"; + $newFunction[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Alter the title/s & alias"; - $newFunction[] = $this->_t(2) . "\$table = \$this->getTable();"; - $newFunction[] = PHP_EOL . $this->_t(2) + $newFunction[] = Indent::_(2) . "\$table = \$this->getTable();"; + $newFunction[] = PHP_EOL . Indent::_(2) . "while (\$table->load(array('alias' => \$alias)))"; - $newFunction[] = $this->_t(2) . "{"; - $newFunction[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $newFunction[] = Indent::_(2) . "{"; + $newFunction[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Check if this is an array of titles"; - $newFunction[] = $this->_t(3) . "if (" . $Component + $newFunction[] = Indent::_(3) . "if (" . $Component . "Helper::checkArray(\$title))"; - $newFunction[] = $this->_t(3) . "{"; - $newFunction[] = $this->_t(4) + $newFunction[] = Indent::_(3) . "{"; + $newFunction[] = Indent::_(4) . "foreach(\$title as \$nr => &\$_title)"; - $newFunction[] = $this->_t(4) . "{"; - $newFunction[] = $this->_t(5) + $newFunction[] = Indent::_(4) . "{"; + $newFunction[] = Indent::_(5) . "\$_title = StringHelper::increment(\$_title);"; - $newFunction[] = $this->_t(4) . "}"; - $newFunction[] = $this->_t(3) . "}"; - $newFunction[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $newFunction[] = Indent::_(4) . "}"; + $newFunction[] = Indent::_(3) . "}"; + $newFunction[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Make sure we have a title"; - $newFunction[] = $this->_t(3) . "elseif (\$title)"; - $newFunction[] = $this->_t(3) . "{"; - $newFunction[] = $this->_t(4) + $newFunction[] = Indent::_(3) . "elseif (\$title)"; + $newFunction[] = Indent::_(3) . "{"; + $newFunction[] = Indent::_(4) . "\$title = StringHelper::increment(\$title);"; - $newFunction[] = $this->_t(3) . "}"; - $newFunction[] = $this->_t(3) + $newFunction[] = Indent::_(3) . "}"; + $newFunction[] = Indent::_(3) . "\$alias = StringHelper::increment(\$alias, 'dash');"; - $newFunction[] = $this->_t(2) . "}"; - $newFunction[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $newFunction[] = Indent::_(2) . "}"; + $newFunction[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if this is an array of titles"; - $newFunction[] = $this->_t(2) . "if (" . $Component + $newFunction[] = Indent::_(2) . "if (" . $Component . "Helper::checkArray(\$title))"; - $newFunction[] = $this->_t(2) . "{"; - $newFunction[] = $this->_t(3) . "\$title[] = \$alias;"; - $newFunction[] = $this->_t(3) . "return \$title;"; - $newFunction[] = $this->_t(2) . "}"; - $newFunction[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $newFunction[] = Indent::_(2) . "{"; + $newFunction[] = Indent::_(3) . "\$title[] = \$alias;"; + $newFunction[] = Indent::_(3) . "return \$title;"; + $newFunction[] = Indent::_(2) . "}"; + $newFunction[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Make sure we have a title"; - $newFunction[] = $this->_t(2) . "elseif (\$title)"; - $newFunction[] = $this->_t(2) . "{"; - $newFunction[] = $this->_t(3) . "return array(\$title, \$alias);"; - $newFunction[] = $this->_t(2) . "}"; - $newFunction[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $newFunction[] = Indent::_(2) . "elseif (\$title)"; + $newFunction[] = Indent::_(2) . "{"; + $newFunction[] = Indent::_(3) . "return array(\$title, \$alias);"; + $newFunction[] = Indent::_(2) . "}"; + $newFunction[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " We only had an alias"; - $newFunction[] = $this->_t(2) . "return \$alias;"; - $newFunction[] = $this->_t(1) . "}"; + $newFunction[] = Indent::_(2) . "return \$alias;"; + $newFunction[] = Indent::_(1) . "}"; return implode(PHP_EOL, $newFunction); } elseif (array_key_exists($nameSingleCode, $this->titleBuilder)) { $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $newFunction[] = $this->_t(1) . " * Method to change the title"; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) + $newFunction[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $newFunction[] = Indent::_(1) . " * Method to change the title"; + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " * @param string \$title The title."; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " * @return array Contains the modified title and alias."; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) . " */"; - $newFunction[] = $this->_t(1) + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " */"; + $newFunction[] = Indent::_(1) . "protected function _generateNewTitle(\$title)"; - $newFunction[] = $this->_t(1) . "{"; - $newFunction[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $newFunction[] = Indent::_(1) . "{"; + $newFunction[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Alter the title"; - $newFunction[] = $this->_t(2) . "\$table = \$this->getTable();"; - $newFunction[] = PHP_EOL . $this->_t(2) + $newFunction[] = Indent::_(2) . "\$table = \$this->getTable();"; + $newFunction[] = PHP_EOL . Indent::_(2) . "while (\$table->load(array('title' => \$title)))"; - $newFunction[] = $this->_t(2) . "{"; - $newFunction[] = $this->_t(3) + $newFunction[] = Indent::_(2) . "{"; + $newFunction[] = Indent::_(3) . "\$title = StringHelper::increment(\$title);"; - $newFunction[] = $this->_t(2) . "}"; - $newFunction[] = PHP_EOL . $this->_t(2) . "return \$title;"; - $newFunction[] = $this->_t(1) . "}"; + $newFunction[] = Indent::_(2) . "}"; + $newFunction[] = PHP_EOL . Indent::_(2) . "return \$title;"; + $newFunction[] = Indent::_(1) . "}"; return implode(PHP_EOL, $newFunction); } @@ -10207,47 +10077,47 @@ class Interpretation extends Fields } // rest the new function $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $newFunction[] = $this->_t(1) + $newFunction[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $newFunction[] = Indent::_(1) . " * Generate a valid alias from title / date."; - $newFunction[] = $this->_t(1) + $newFunction[] = Indent::_(1) . " * Remains public to be able to check for duplicated alias before saving"; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) . " * @return string"; - $newFunction[] = $this->_t(1) . " */"; - $newFunction[] = $this->_t(1) . "public function generateAlias()"; - $newFunction[] = $this->_t(1) . "{"; - $newFunction[] = $this->_t(2) . "if (empty(\$this->alias))"; - $newFunction[] = $this->_t(2) . "{"; - $newFunction[] = $this->_t(3) . "\$this->alias = " . implode( + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " * @return string"; + $newFunction[] = Indent::_(1) . " */"; + $newFunction[] = Indent::_(1) . "public function generateAlias()"; + $newFunction[] = Indent::_(1) . "{"; + $newFunction[] = Indent::_(2) . "if (empty(\$this->alias))"; + $newFunction[] = Indent::_(2) . "{"; + $newFunction[] = Indent::_(3) . "\$this->alias = " . implode( ".' '.", $titleData ) . ';'; - $newFunction[] = $this->_t(2) . "}"; - $newFunction[] = PHP_EOL . $this->_t(2) + $newFunction[] = Indent::_(2) . "}"; + $newFunction[] = PHP_EOL . Indent::_(2) . "\$this->alias = JApplicationHelper::stringURLSafe(\$this->alias);"; - $newFunction[] = PHP_EOL . $this->_t(2) + $newFunction[] = PHP_EOL . Indent::_(2) . "if (trim(str_replace('-', '', \$this->alias)) == '')"; - $newFunction[] = $this->_t(2) . "{"; - $newFunction[] = $this->_t(3) + $newFunction[] = Indent::_(2) . "{"; + $newFunction[] = Indent::_(3) . "\$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');"; - $newFunction[] = $this->_t(2) . "}"; - $newFunction[] = PHP_EOL . $this->_t(2) . "return \$this->alias;"; - $newFunction[] = $this->_t(1) . "}"; + $newFunction[] = Indent::_(2) . "}"; + $newFunction[] = PHP_EOL . Indent::_(2) . "return \$this->alias;"; + $newFunction[] = Indent::_(1) . "}"; return implode(PHP_EOL, $newFunction); } // rest the new function $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $newFunction[] = $this->_t(1) + $newFunction[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $newFunction[] = Indent::_(1) . " * This view does not actually have an alias"; - $newFunction[] = $this->_t(1) . " *"; - $newFunction[] = $this->_t(1) . " * @return bool"; - $newFunction[] = $this->_t(1) . " */"; - $newFunction[] = $this->_t(1) . "public function generateAlias()"; - $newFunction[] = $this->_t(1) . "{"; - $newFunction[] = $this->_t(2) . "return false;"; - $newFunction[] = $this->_t(1) . "}"; + $newFunction[] = Indent::_(1) . " *"; + $newFunction[] = Indent::_(1) . " * @return bool"; + $newFunction[] = Indent::_(1) . " */"; + $newFunction[] = Indent::_(1) . "public function generateAlias()"; + $newFunction[] = Indent::_(1) . "{"; + $newFunction[] = Indent::_(2) . "return false;"; + $newFunction[] = Indent::_(1) . "}"; return implode(PHP_EOL, $newFunction); } @@ -10288,10 +10158,10 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['id'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`id` INT(11) NOT NULL AUTO_INCREMENT,"; } - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',"; ksort($fields); $last_name = 'asset_id'; @@ -10347,7 +10217,7 @@ class Interpretation extends Fields $lenght = '(' . $data['lenght'] . ')'; } // set the field to db - $db_ .= PHP_EOL . $this->_t(1) . "`" . $field . "` " + $db_ .= PHP_EOL . Indent::_(1) . "`" . $field . "` " . $data['type'] . $lenght . " " . $default . ","; // check if this a new field that should be added via SQL update if (isset($this->addSQL['field']) @@ -10416,60 +10286,60 @@ class Interpretation extends Fields // check if default field was overwritten if (!isset($this->fieldsNames[$view]['params'])) { - $db_ .= PHP_EOL . $this->_t(1) . "`params` text NULL,"; + $db_ .= PHP_EOL . Indent::_(1) . "`params` text NULL,"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['published'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`published` TINYINT(3) NOT NULL DEFAULT 1,"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['created_by'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`created_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['modified_by'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['created'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['modified'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['checked_out'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`checked_out` int(11) unsigned NOT NULL DEFAULT 0,"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['checked_out_time'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['version'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`version` INT(10) unsigned NOT NULL DEFAULT 1,"; } // check if default field was overwritten if (!isset($this->fieldsNames[$view]['hits'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`hits` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if view has access @@ -10479,13 +10349,13 @@ class Interpretation extends Fields ) && !isset($this->fieldsNames[$view]['access'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`access` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['ordering'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`ordering` INT(11) NOT NULL DEFAULT 0,"; } // check if metadata is added to this view @@ -10497,24 +10367,24 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['metakey'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`metakey` TEXT NOT NULL,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['metadesc'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`metadesc` TEXT NOT NULL,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['metadata'])) { - $db_ .= PHP_EOL . $this->_t(1) + $db_ .= PHP_EOL . Indent::_(1) . "`metadata` TEXT NOT NULL,"; } } // TODO (we may want this to be dynamicly set) - $db_ .= PHP_EOL . $this->_t(1) . "PRIMARY KEY (`id`)"; + $db_ .= PHP_EOL . Indent::_(1) . "PRIMARY KEY (`id`)"; // check if a key was set for any of the default fields then we should not set it again $check_keys_set = array(); if (isset($this->dbUniqueKeys[$view]) @@ -10524,7 +10394,7 @@ class Interpretation extends Fields { foreach ($this->dbUniqueKeys[$view] as $nr => $key) { - $db_ .= "," . PHP_EOL . $this->_t(1) + $db_ .= "," . PHP_EOL . Indent::_(1) . "UNIQUE KEY `idx_" . $key . "` (`" . $key . "`)"; $check_keys_set[$key] = $key; } @@ -10534,7 +10404,7 @@ class Interpretation extends Fields { foreach ($this->dbKeys[$view] as $nr => $key) { - $db_ .= "," . PHP_EOL . $this->_t(1) + $db_ .= "," . PHP_EOL . Indent::_(1) . "KEY `idx_" . $key . "` (`" . $key . "`)"; $check_keys_set[$key] = $key; } @@ -10546,31 +10416,31 @@ class Interpretation extends Fields $this->accessBuilder[$view] )) { - $db_ .= "," . PHP_EOL . $this->_t(1) + $db_ .= "," . PHP_EOL . Indent::_(1) . "KEY `idx_access` (`access`)"; } // check if default field was over written if (!isset($check_keys_set['checked_out'])) { - $db_ .= "," . PHP_EOL . $this->_t(1) + $db_ .= "," . PHP_EOL . Indent::_(1) . "KEY `idx_checkout` (`checked_out`)"; } // check if default field was over written if (!isset($check_keys_set['created_by'])) { - $db_ .= "," . PHP_EOL . $this->_t(1) + $db_ .= "," . PHP_EOL . Indent::_(1) . "KEY `idx_createdby` (`created_by`)"; } // check if default field was over written if (!isset($check_keys_set['modified_by'])) { - $db_ .= "," . PHP_EOL . $this->_t(1) + $db_ .= "," . PHP_EOL . Indent::_(1) . "KEY `idx_modifiedby` (`modified_by`)"; } // check if default field was over written if (!isset($check_keys_set['published'])) { - $db_ .= "," . PHP_EOL . $this->_t(1) + $db_ .= "," . PHP_EOL . Indent::_(1) . "KEY `idx_state` (`published`)"; } // easy bucket @@ -10667,11 +10537,9 @@ class Interpretation extends Fields $this->customScriptBuilder['sql'] as $for => $customSql ) { - $placeholders = array($this->bbb . 'component' - . $this->ddd => $component, - $this->bbb . 'view' - . $this->ddd => $for); - $db .= $this->setPlaceholders( + $placeholders = array(Placefix::_('component') => $component, + Placefix::_('view') => $for); + $db .= CFactory::_('Placeholder')->update( $customSql, $placeholders ) . PHP_EOL . PHP_EOL; } @@ -10702,7 +10570,7 @@ class Interpretation extends Fields // also check if the developer will allow this // the access actions length must be checked before this // only add this option if set to SQL fix - if (Config::get('add_assets_table_fix') == 1) + if (CFactory::_('Config')->add_assets_table_fix == 1) { // 400 actions worse case is larger the 65535 characters if ($this->accessSize > 400) @@ -10710,8 +10578,8 @@ class Interpretation extends Fields $db .= PHP_EOL; $db .= PHP_EOL . '--'; $db .= PHP_EOL - . '--' . $this->setLine( - __LINE__ + . '--' . Line::_( + __LINE__,__CLASS__ ) . ' Always insure this column rules is large enough for all the access control values.'; $db .= PHP_EOL . '--'; @@ -10719,13 +10587,13 @@ class Interpretation extends Fields . "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; } // smaller then 400 makes TEXT large enough - elseif (Config::get('add_assets_table_fix') == 1) + elseif (CFactory::_('Config')->add_assets_table_fix == 1) { $db .= PHP_EOL; $db .= PHP_EOL . '--'; $db .= PHP_EOL - . '--' . $this->setLine( - __LINE__ + . '--' . Line::_( + __LINE__,__CLASS__ ) . ' Always insure this column rules is large enough for all the access control values.'; $db .= PHP_EOL . '--'; @@ -10738,13 +10606,13 @@ class Interpretation extends Fields // also check if the developer will allow this // the config length must be checked before this // only add this option if set to SQL fix - if (Config::get('add_assets_table_fix') && $this->addAssetsTableNameFix) + if (CFactory::_('Config')->add_assets_table_fix && $this->addAssetsTableNameFix) { $db .= PHP_EOL; $db .= PHP_EOL . '--'; $db .= PHP_EOL - . '--' . $this->setLine( - __LINE__ + . '--' . Line::_( + __LINE__,__CLASS__ ) . ' Always insure this column name is large enough for long component and view names.'; $db .= PHP_EOL . '--'; @@ -10777,7 +10645,7 @@ class Interpretation extends Fields $this->customScriptBuilder['sql_uninstall'] )) { - $db .= $this->setPlaceholders( + $db .= CFactory::_('Placeholder')->update( $this->customScriptBuilder['sql_uninstall'], $this->placeholders ) . PHP_EOL; @@ -10787,15 +10655,15 @@ class Interpretation extends Fields // check if this component used larger rules // now revert them back on uninstall // only add this option if set to SQL fix - if (Config::get('add_assets_table_fix') == 1) + if (CFactory::_('Config')->add_assets_table_fix == 1) { // https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L22 // Checked 1st December 2020 (let us know if this changes) $db .= PHP_EOL; $db .= PHP_EOL . '--'; $db .= PHP_EOL - . '--' . $this->setLine( - __LINE__ + . '--' . Line::_( + __LINE__,__CLASS__ ) . ' Always insure this column rules is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020)'; $db .= PHP_EOL . '--'; @@ -10806,15 +10674,15 @@ class Interpretation extends Fields // check if this component used larger names // now revert them back on uninstall // only add this option if set to SQL fix - if (Config::get('add_assets_table_fix') == 1 && $this->addAssetsTableNameFix) + if (CFactory::_('Config')->add_assets_table_fix == 1 && $this->addAssetsTableNameFix) { // https://github.com/joomla/joomla-cms/blob/3.10.0-alpha3/installation/sql/mysql/joomla.sql#L20 // Checked 1st December 2020 (let us know if this changes) $db .= PHP_EOL; $db .= PHP_EOL . '--'; $db .= PHP_EOL - . '--' . $this->setLine( - __LINE__ + . '--' . Line::_( + __LINE__,__CLASS__ ) . ' Always insure this column name is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020).'; $db .= PHP_EOL . '--'; @@ -10829,101 +10697,106 @@ class Interpretation extends Fields { // add final list of needed lang strings $componentName = JFilterOutput::cleanText($this->componentData->name); + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('admin'); // Trigger Event: jcb_ce_onBeforeBuildAdminLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildAdminLang', - array(&$this->componentContext, &$this->langContent['admin'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; + CFactory::_('Language')->setTarget('admin', $langContent); // start loding the defaults - $this->setLangContent('adminsys', $this->langPrefix, $componentName); - $this->setLangContent( - 'adminsys', $this->langPrefix . '_CONFIGURATION', + CFactory::_('Language')->set('adminsys', CFactory::_('Config')->lang_prefix, $componentName); + CFactory::_('Language')->set( + 'adminsys', CFactory::_('Config')->lang_prefix . '_CONFIGURATION', $componentName . ' Configuration' ); - $this->setLangContent('admin', $this->langPrefix, $componentName); - $this->setLangContent('admin', $this->langPrefix . '_BACK', 'Back'); - $this->setLangContent( - 'admin', $this->langPrefix . '_DASH', 'Dashboard' + CFactory::_('Language')->set('admin', CFactory::_('Config')->lang_prefix, $componentName); + CFactory::_('Language')->set('admin', CFactory::_('Config')->lang_prefix . '_BACK', 'Back'); + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_DASH', 'Dashboard' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_VERSION', 'Version' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_VERSION', 'Version' ); - $this->setLangContent('admin', $this->langPrefix . '_DATE', 'Date'); - $this->setLangContent('admin', $this->langPrefix . '_AUTHOR', 'Author'); - $this->setLangContent( - 'admin', $this->langPrefix . '_WEBSITE', 'Website' + CFactory::_('Language')->set('admin', CFactory::_('Config')->lang_prefix . '_DATE', 'Date'); + CFactory::_('Language')->set('admin', CFactory::_('Config')->lang_prefix . '_AUTHOR', 'Author'); + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_WEBSITE', 'Website' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_LICENSE', 'License' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_LICENSE', 'License' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_CONTRIBUTORS', 'Contributors' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_CONTRIBUTORS', 'Contributors' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_CONTRIBUTOR', 'Contributor' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_CONTRIBUTOR', 'Contributor' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_DASHBOARD', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_DASHBOARD', $componentName . ' Dashboard' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_SAVE_SUCCESS', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_SAVE_SUCCESS', "Great! Item successfully saved." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_SAVE_WARNING', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_SAVE_WARNING', "The value already existed so please select another." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_HELP_MANAGER', "Help" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_HELP_MANAGER', "Help" ); - $this->setLangContent('admin', $this->langPrefix . '_NEW', "New"); - $this->setLangContent( - 'admin', $this->langPrefix . '_CLOSE_NEW', "Close & New" + CFactory::_('Language')->set('admin', CFactory::_('Config')->lang_prefix . '_NEW', "New"); + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_CLOSE_NEW', "Close & New" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_CREATE_NEW_S', "Create New %s" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_CREATE_NEW_S', "Create New %s" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_EDIT_S', "Edit %s" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_EDIT_S', "Edit %s" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_KEEP_ORIGINAL_STATE', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_KEEP_ORIGINAL_STATE', "- Keep Original State -" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_KEEP_ORIGINAL_ACCESS', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_KEEP_ORIGINAL_ACCESS', "- Keep Original Access -" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_KEEP_ORIGINAL_CATEGORY', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_KEEP_ORIGINAL_CATEGORY', "- Keep Original Category -" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_PUBLISHED', 'Published' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_PUBLISHED', 'Published' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_INACTIVE', 'Inactive' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_INACTIVE', 'Inactive' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_ARCHIVED', 'Archived' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_ARCHIVED', 'Archived' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_TRASHED', 'Trashed' + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_TRASHED', 'Trashed' ); - $this->setLangContent( - 'admin', $this->langPrefix . '_NO_ACCESS_GRANTED', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_NO_ACCESS_GRANTED', "No Access Granted!" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_NOT_FOUND_OR_ACCESS_DENIED', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_NOT_FOUND_OR_ACCESS_DENIED', "Not found or access denied!" ); if ($this->componentData->add_license && $this->componentData->license_type == 3) { - $this->setLangContent( + CFactory::_('Language')->set( 'admin', 'NIE_REG_NIE', "

    License not set for " . $componentName . ".

    Notify your administrator!
    The license can be obtained from langPrefix . '_EXPORT_FAILED', "Export Failed" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_EXPORT_FAILED', "Export Failed" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_FAILED', "Import Failed" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_FAILED', "Import Failed" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_TITLE', "Data Importer" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_TITLE', "Data Importer" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_NO_IMPORT_TYPE_FOUND', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_NO_IMPORT_TYPE_FOUND', "Import type not found." ); - $this->setLangContent( + CFactory::_('Language')->set( 'admin', - $this->langPrefix . '_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE', + CFactory::_('Config')->lang_prefix . '_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE', "Package to import not found." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_ERROR', "Import error." + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_ERROR', "Import error." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_SUCCESS', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_SUCCESS', "Great! Import successful." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_MSG_WARNIMPORTFILE', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_WARNIMPORTFILE', "Warning, import file error." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_MSG_NO_FILE_SELECTED', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_NO_FILE_SELECTED', "No import file selected." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_MSG_PLEASE_SELECT_A_FILE', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_PLEASE_SELECT_A_FILE', "Please select a file to import." ); - $this->setLangContent( + CFactory::_('Language')->set( 'admin', - $this->langPrefix . '_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', + CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', "Please link all columns." ); - $this->setLangContent( + CFactory::_('Language')->set( 'admin', - $this->langPrefix . '_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', + CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', "Please enter the file directory." ); - $this->setLangContent( + CFactory::_('Language')->set( 'admin', - $this->langPrefix . '_IMPORT_MSG_WARNIMPORTUPLOADERROR', + CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_WARNIMPORTUPLOADERROR', "Warning, import upload error." ); - $this->setLangContent( - 'admin', $this->langPrefix + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY', "Please enter the file directory." ); - $this->setLangContent( - 'admin', $this->langPrefix + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE', "Path does not have a valid file." ); - $this->setLangContent( - 'admin', $this->langPrefix + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE', "Does not have a valid file type." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_MSG_ENTER_A_URL', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_ENTER_A_URL', "Please enter a url." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_MSG_INVALID_URL', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_MSG_INVALID_URL', "Invalid url." ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_CONTINUE', "Continue" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_CONTINUE', "Continue" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_FROM_UPLOAD', "Upload" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_FROM_UPLOAD', "Upload" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_SELECT_FILE', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_SELECT_FILE', "Select File" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_UPLOAD_BOTTON', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_UPLOAD_BOTTON', "Upload File" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_FROM_DIRECTORY', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_FROM_DIRECTORY', "Directory" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_SELECT_FILE_DIRECTORY', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_SELECT_FILE_DIRECTORY', "Set the path to file" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_GET_BOTTON', "Get File" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_GET_BOTTON', "Get File" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_FROM_URL', "URL" + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_FROM_URL', "URL" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_SELECT_FILE_URL', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_SELECT_FILE_URL', "Enter file URL" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_UPDATE_DATA', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_UPDATE_DATA', "Import Data" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_FORMATS_ACCEPTED', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_FORMATS_ACCEPTED', "formats accepted" ); - $this->setLangContent( + CFactory::_('Language')->set( 'admin', - $this->langPrefix . '_IMPORT_LINK_FILE_TO_TABLE_COLUMNS', + CFactory::_('Config')->lang_prefix . '_IMPORT_LINK_FILE_TO_TABLE_COLUMNS', "Link File to Table Columns" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_TABLE_COLUMNS', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_TABLE_COLUMNS', "Table Columns" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_FILE_COLUMNS', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_FILE_COLUMNS', "File Columns" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_PLEASE_SELECT_COLUMN', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_PLEASE_SELECT_COLUMN', "-- Please Select Column --" ); - $this->setLangContent( - 'admin', $this->langPrefix . '_IMPORT_IGNORE_COLUMN', + CFactory::_('Language')->set( + 'admin', CFactory::_('Config')->lang_prefix . '_IMPORT_IGNORE_COLUMN', "-- Ignore This Column --" ); } // check if the both array is set - if (isset($this->langContent['both']) - && ArrayHelper::check($this->langContent['both'])) + if (CFactory::_('Language')->exist('both')) { - foreach ($this->langContent['both'] as $keylang => $langval) + foreach (CFactory::_('Language')->getTarget('both') as $keylang => $langval) { - $this->setLangContent('admin', $keylang, $langval); + CFactory::_('Language')->set('admin', $keylang, $langval); } } // check if the both admin array is set - if (isset($this->langContent['bothadmin']) - && ArrayHelper::check( - $this->langContent['bothadmin'] - )) + if (CFactory::_('Language')->exist('bothadmin')) { - foreach ($this->langContent['bothadmin'] as $keylang => $langval) + foreach (CFactory::_('Language')->getTarget('bothadmin') as $keylang => $langval) { - $this->setLangContent('admin', $keylang, $langval); + CFactory::_('Language')->set('admin', $keylang, $langval); } } - if (isset($this->langContent['admin']) - && ArrayHelper::check($this->langContent['admin'])) + if (CFactory::_('Language')->exist('admin')) { + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('admin'); // Trigger Event: jcb_ce_onAfterBuildAdminLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildAdminLang', - array(&$this->componentContext, &$this->langContent['admin'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; // sort the strings - ksort($this->langContent['admin']); + ksort($langContent); // load to global languages - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] - = $this->langContent['admin']; + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['admin'] + = $langContent; // remove tmp array - unset($this->langContent['admin']); + CFactory::_('Language')->setTarget('admin', null); return true; } @@ -11118,90 +10990,94 @@ class Interpretation extends Fields { // add final list of needed lang strings $componentName = JFilterOutput::cleanText($this->componentData->name); + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('site'); // Trigger Event: jcb_ce_onBeforeBuildSiteLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildSiteLang', - array(&$this->componentContext, &$this->langContent['site'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; + CFactory::_('Language')->setTarget('site', $langContent); // add final list of needed lang strings - $this->setLangContent('site', $this->langPrefix, $componentName); + CFactory::_('Language')->set('site', CFactory::_('Config')->lang_prefix, $componentName); // some more defaults - $this->setLangContent('site', 'JTOOLBAR_APPLY', "Save"); - $this->setLangContent('site', 'JTOOLBAR_SAVE_AS_COPY', "Save as Copy"); - $this->setLangContent('site', 'JTOOLBAR_SAVE', "Save & Close"); - $this->setLangContent('site', 'JTOOLBAR_SAVE_AND_NEW', "Save & New"); - $this->setLangContent('site', 'JTOOLBAR_CANCEL', "Cancel"); - $this->setLangContent('site', 'JTOOLBAR_CLOSE', "Close"); - $this->setLangContent('site', 'JTOOLBAR_HELP', "Help"); - $this->setLangContent('site', 'JGLOBAL_FIELD_ID_LABEL', "ID"); - $this->setLangContent( + CFactory::_('Language')->set('site', 'JTOOLBAR_APPLY', "Save"); + CFactory::_('Language')->set('site', 'JTOOLBAR_SAVE_AS_COPY', "Save as Copy"); + CFactory::_('Language')->set('site', 'JTOOLBAR_SAVE', "Save & Close"); + CFactory::_('Language')->set('site', 'JTOOLBAR_SAVE_AND_NEW', "Save & New"); + CFactory::_('Language')->set('site', 'JTOOLBAR_CANCEL', "Cancel"); + CFactory::_('Language')->set('site', 'JTOOLBAR_CLOSE', "Close"); + CFactory::_('Language')->set('site', 'JTOOLBAR_HELP', "Help"); + CFactory::_('Language')->set('site', 'JGLOBAL_FIELD_ID_LABEL', "ID"); + CFactory::_('Language')->set( 'site', 'JGLOBAL_FIELD_ID_DESC', "Record number in the database." ); - $this->setLangContent( + CFactory::_('Language')->set( 'site', 'JGLOBAL_FIELD_MODIFIED_LABEL', "Modified Date" ); - $this->setLangContent( + CFactory::_('Language')->set( 'site', 'COM_CONTENT_FIELD_MODIFIED_DESC', "The last date this item was modified." ); - $this->setLangContent( + CFactory::_('Language')->set( 'site', 'JGLOBAL_FIELD_MODIFIED_BY_LABEL', "Modified By" ); - $this->setLangContent( + CFactory::_('Language')->set( 'site', 'JGLOBAL_FIELD_MODIFIED_BY_DESC', "The user who did the last modification." ); - $this->setLangContent('site', $this->langPrefix . '_NEW', "New"); - $this->setLangContent( - 'site', $this->langPrefix . '_CREATE_NEW_S', "Create New %s" + CFactory::_('Language')->set('site', CFactory::_('Config')->lang_prefix . '_NEW', "New"); + CFactory::_('Language')->set( + 'site', CFactory::_('Config')->lang_prefix . '_CREATE_NEW_S', "Create New %s" ); - $this->setLangContent('site', $this->langPrefix . '_EDIT_S', "Edit %s"); - $this->setLangContent( - 'site', $this->langPrefix . '_NO_ACCESS_GRANTED', + CFactory::_('Language')->set('site', CFactory::_('Config')->lang_prefix . '_EDIT_S', "Edit %s"); + CFactory::_('Language')->set( + 'site', CFactory::_('Config')->lang_prefix . '_NO_ACCESS_GRANTED', "No Access Granted!" ); - $this->setLangContent( - 'site', $this->langPrefix . '_NOT_FOUND_OR_ACCESS_DENIED', + CFactory::_('Language')->set( + 'site', CFactory::_('Config')->lang_prefix . '_NOT_FOUND_OR_ACCESS_DENIED', "Not found or access denied!" ); // check if the both array is set - if (isset($this->langContent['both']) - && ArrayHelper::check($this->langContent['both'])) + if (CFactory::_('Language')->exist('both')) { - foreach ($this->langContent['both'] as $keylang => $langval) + foreach (CFactory::_('Language')->getTarget('both') as $keylang => $langval) { - $this->setLangContent('site', $keylang, $langval); + CFactory::_('Language')->set('site', $keylang, $langval); } } // check if the both site array is set - if (isset($this->langContent['bothsite']) - && ArrayHelper::check( - $this->langContent['bothsite'] - )) + if (CFactory::_('Language')->exist('bothsite')) { - foreach ($this->langContent['bothsite'] as $keylang => $langval) + foreach (CFactory::_('Language')->getTarget('bothsite') as $keylang => $langval) { - $this->setLangContent('site', $keylang, $langval); + CFactory::_('Language')->set('site', $keylang, $langval); } } - if (isset($this->langContent['site']) - && ArrayHelper::check($this->langContent['site'])) + if (CFactory::_('Language')->exist('site')) { + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('site'); // Trigger Event: jcb_ce_onAfterBuildSiteLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildSiteLang', - array(&$this->componentContext, &$this->langContent['site'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; // sort the strings - ksort($this->langContent['site']); + ksort($langContent); // load to global languages - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] - = $this->langContent['site']; + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['site'] + = $langContent; // remove tmp array - unset($this->langContent['site']); + CFactory::_('Language')->setTarget('site', null); return true; } @@ -11213,52 +11089,55 @@ class Interpretation extends Fields { // add final list of needed lang strings $componentName = JFilterOutput::cleanText($this->componentData->name); + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('sitesys'); // Trigger Event: jcb_ce_onBeforeBuildSiteSysLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildSiteSysLang', - array(&$this->componentContext, &$this->langContent['sitesys'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; + CFactory::_('Language')->setTarget('sitesys', $langContent); // add final list of needed lang strings - $this->setLangContent('sitesys', $this->langPrefix, $componentName); - $this->setLangContent( - 'sitesys', $this->langPrefix . '_NO_ACCESS_GRANTED', + CFactory::_('Language')->set('sitesys', CFactory::_('Config')->lang_prefix, $componentName); + CFactory::_('Language')->set( + 'sitesys', CFactory::_('Config')->lang_prefix . '_NO_ACCESS_GRANTED', "No Access Granted!" ); - $this->setLangContent( - 'sitesys', $this->langPrefix . '_NOT_FOUND_OR_ACCESS_DENIED', + CFactory::_('Language')->set( + 'sitesys', CFactory::_('Config')->lang_prefix . '_NOT_FOUND_OR_ACCESS_DENIED', "Not found or access denied!" ); // check if the both site array is set - if (isset($this->langContent['bothsite']) - && ArrayHelper::check( - $this->langContent['bothsite'] - )) + if (CFactory::_('Language')->exist('bothsite')) { - foreach ($this->langContent['bothsite'] as $keylang => $langval) + foreach (CFactory::_('Language')->getTarget('bothsite') as $keylang => $langval) { - $this->setLangContent('sitesys', $keylang, $langval); + CFactory::_('Language')->set('sitesys', $keylang, $langval); } } - if (isset($this->langContent['sitesys']) - && ArrayHelper::check( - $this->langContent['sitesys'] - )) + if (CFactory::_('Language')->exist('sitesys')) { + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('sitesys'); // Trigger Event: jcb_ce_onAfterBuildSiteSysLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildSiteSysLang', - array(&$this->componentContext, &$this->langContent['sitesys'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; // sort strings - ksort($this->langContent['sitesys']); + ksort($langContent); // load to global languages - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] - = $this->langContent['sitesys']; + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['sitesys'] + = $langContent; // remove tmp array - unset($this->langContent['sitesys']); + CFactory::_('Language')->setTarget('sitesys', null); return true; } @@ -11270,41 +11149,44 @@ class Interpretation extends Fields { // add final list of needed lang strings $componentName = JFilterOutput::cleanText($this->componentData->name); + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('adminsys'); // Trigger Event: jcb_ce_onBeforeBuildAdminSysLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildAdminSysLang', - array(&$this->componentContext, &$this->langContent['adminsys'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; + CFactory::_('Language')->setTarget('adminsys', $langContent); // check if the both admin array is set - if (isset($this->langContent['bothadmin']) - && ArrayHelper::check( - $this->langContent['bothadmin'] - )) + if (CFactory::_('Language')->exist('bothadmin')) { - foreach ($this->langContent['bothadmin'] as $keylang => $langval) + foreach (CFactory::_('Language')->getTarget('bothadmin') as $keylang => $langval) { - $this->setLangContent('adminsys', $keylang, $langval); + CFactory::_('Language')->set('adminsys', $keylang, $langval); } } - if (isset($this->langContent['adminsys']) - && ArrayHelper::check( - $this->langContent['adminsys'] - )) + if (CFactory::_('Language')->exist('adminsys')) { + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget('adminsys'); // Trigger Event: jcb_ce_onAfterBuildAdminSysLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildAdminSysLang', - array(&$this->componentContext, &$this->langContent['adminsys'], + array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_prefix = $this->langPrefix; // sort strings - ksort($this->langContent['adminsys']); + ksort($langContent); // load to global languages - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] - = $this->langContent['adminsys']; + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['adminsys'] + = $langContent; // remove tmp array - unset($this->langContent['adminsys']); + CFactory::_('Language')->setTarget('adminsys', null); return true; } @@ -11399,8 +11281,7 @@ class Interpretation extends Fields )) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; // setup correct core target $coreLoad = false; $core = null; @@ -11413,21 +11294,21 @@ class Interpretation extends Fields $firstTimeBeingAdded = true; // add the default $body = "items as \$i => \$item): ?>"; - $body .= PHP_EOL . $this->_t(1) . "_t(2) + $body .= PHP_EOL . Indent::_(1) . "user->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$this->user->id || \$item->checked_out == 0;"; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "\$userChkOut = JFactory::getUser(\$item->checked_out);"; - $body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper + $body .= PHP_EOL . Indent::_(2) . "\$canDo = " . $Helper . "::getActions('" . $nameSingleCode . "',\$item,'" . $nameListCode . "');"; - $body .= PHP_EOL . $this->_t(1) . "?>"; - $body .= PHP_EOL . $this->_t(1) + $body .= PHP_EOL . Indent::_(1) . "?>"; + $body .= PHP_EOL . Indent::_(1) . ''; // only load if not over written if (!isset($this->fieldsNames[$nameSingleCode]['ordering'])) { - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . ''; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) @@ -11440,41 +11321,41 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.state']] )) { - $body .= PHP_EOL . $this->_t(2) . "get('" + $body .= PHP_EOL . Indent::_(2) . "get('" . $core['core.edit.state'] . "')): ?>"; } else { - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "get('core.edit.state')): ?>"; } - $body .= PHP_EOL . $this->_t(3) . "_t(4) . "\$iconClass = '';"; - $body .= PHP_EOL . $this->_t(4) . "if (!\$this->saveOrder)"; - $body .= PHP_EOL . $this->_t(4) . "{"; - $body .= PHP_EOL . $this->_t(5) + $body .= PHP_EOL . Indent::_(3) . "saveOrder)"; + $body .= PHP_EOL . Indent::_(4) . "{"; + $body .= PHP_EOL . Indent::_(5) . "\$iconClass = ' inactive tip-top" . '" hasTooltip" title="' . "' . JHtml::tooltipText('JORDERINGDISABLED');"; - $body .= PHP_EOL . $this->_t(4) . "}"; - $body .= PHP_EOL . $this->_t(3) . "?>"; - $body .= PHP_EOL . $this->_t(3) + $body .= PHP_EOL . Indent::_(4) . "}"; + $body .= PHP_EOL . Indent::_(3) . "?>"; + $body .= PHP_EOL . Indent::_(3) . ''; - $body .= PHP_EOL . $this->_t(4) . ''; - $body .= PHP_EOL . $this->_t(3) . ""; - $body .= PHP_EOL . $this->_t(3) + $body .= PHP_EOL . Indent::_(4) . ''; + $body .= PHP_EOL . Indent::_(3) . ""; + $body .= PHP_EOL . Indent::_(3) . "saveOrder) : ?>"; - $body .= PHP_EOL . $this->_t(4) + $body .= PHP_EOL . Indent::_(4) . '_t(4) + $body .= PHP_EOL . Indent::_(4) . 'value="ordering; ?>" class="width-20 text-area-order " />'; - $body .= PHP_EOL . $this->_t(3) . ""; - $body .= PHP_EOL . $this->_t(2) . ""; - $body .= PHP_EOL . $this->_t(3) . "⋮"; - $body .= PHP_EOL . $this->_t(2) . ""; - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(3) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; + $body .= PHP_EOL . Indent::_(3) . "⋮"; + $body .= PHP_EOL . Indent::_(2) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; } - $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . Indent::_(2) . ''; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) @@ -11486,30 +11367,30 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit']] )) { - $body .= PHP_EOL . $this->_t(2) . "get('" + $body .= PHP_EOL . Indent::_(2) . "get('" . $core['core.edit'] . "')): ?>"; } else { - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "get('core.edit')): ?>"; } - $body .= PHP_EOL . $this->_t(4) + $body .= PHP_EOL . Indent::_(4) . "checked_out) : ?>"; - $body .= PHP_EOL . $this->_t(5) . ""; - $body .= PHP_EOL . $this->_t(6) + $body .= PHP_EOL . Indent::_(5) . ""; + $body .= PHP_EOL . Indent::_(6) . "id); ?>"; - $body .= PHP_EOL . $this->_t(5) . ""; - $body .= PHP_EOL . $this->_t(6) . "□"; - $body .= PHP_EOL . $this->_t(5) . ""; - $body .= PHP_EOL . $this->_t(4) . ""; - $body .= PHP_EOL . $this->_t(5) + $body .= PHP_EOL . Indent::_(5) . ""; + $body .= PHP_EOL . Indent::_(6) . "□"; + $body .= PHP_EOL . Indent::_(5) . ""; + $body .= PHP_EOL . Indent::_(4) . ""; + $body .= PHP_EOL . Indent::_(5) . "id); ?>"; - $body .= PHP_EOL . $this->_t(4) . ""; - $body .= PHP_EOL . $this->_t(2) . ""; - $body .= PHP_EOL . $this->_t(3) . "□"; - $body .= PHP_EOL . $this->_t(2) . ""; - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(4) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; + $body .= PHP_EOL . Indent::_(3) . "□"; + $body .= PHP_EOL . Indent::_(2) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; // check if this view has fields that should not be escaped $doNotEscape = false; if (isset($this->doNotEscape[$nameListCode])) @@ -11541,19 +11422,19 @@ class Interpretation extends Fields $firstTimeBeingAdded = false; } // add row to body - $body .= PHP_EOL . $this->_t(2) . "getListFieldClass( $item['code'], $nameListCode, $itemClass ) . "\">"; $body .= $itemRow; $body .= $customAdminViewButtons; - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; } } // add the defaults if (!isset($this->fieldsNames[$nameSingleCode]['published'])) { - $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . Indent::_(2) . ''; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) @@ -11565,49 +11446,49 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.state']] )) { - $body .= PHP_EOL . $this->_t(2) . "get('" + $body .= PHP_EOL . Indent::_(2) . "get('" . $core['core.edit.state'] . "')) : ?>"; } else { - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "get('core.edit.state')) : ?>"; } - $body .= PHP_EOL . $this->_t(4) + $body .= PHP_EOL . Indent::_(4) . "checked_out) : ?>"; - $body .= PHP_EOL . $this->_t(5) + $body .= PHP_EOL . Indent::_(5) . ""; - $body .= PHP_EOL . $this->_t(6) + $body .= PHP_EOL . Indent::_(6) . "published, \$i, '" . $nameListCode . ".', true, 'cb'); ?>"; - $body .= PHP_EOL . $this->_t(5) . ""; - $body .= PHP_EOL . $this->_t(6) + $body .= PHP_EOL . Indent::_(5) . ""; + $body .= PHP_EOL . Indent::_(6) . "published, \$i, '" . $nameListCode . ".', false, 'cb'); ?>"; - $body .= PHP_EOL . $this->_t(5) . ""; - $body .= PHP_EOL . $this->_t(4) . ""; - $body .= PHP_EOL . $this->_t(5) + $body .= PHP_EOL . Indent::_(5) . ""; + $body .= PHP_EOL . Indent::_(4) . ""; + $body .= PHP_EOL . Indent::_(5) . "published, \$i, '" . $nameListCode . ".', true, 'cb'); ?>"; - $body .= PHP_EOL . $this->_t(4) . ""; - $body .= PHP_EOL . $this->_t(2) . ""; - $body .= PHP_EOL . $this->_t(3) + $body .= PHP_EOL . Indent::_(4) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; + $body .= PHP_EOL . Indent::_(3) . "published, \$i, '" . $nameListCode . ".', false, 'cb'); ?>"; - $body .= PHP_EOL . $this->_t(2) . ""; - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; } if (!isset($this->fieldsNames[$nameSingleCode]['id'])) { - $body .= PHP_EOL . $this->_t(2) . 'getListFieldClass( $item['code'], $nameListCode, 'nowrap center hidden-phone' ) . '">'; - $body .= PHP_EOL . $this->_t(3) . "id; ?>"; - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(3) . "id; ?>"; + $body .= PHP_EOL . Indent::_(2) . ""; } - $body .= PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . Indent::_(1) . ""; $body .= PHP_EOL . ""; // return the build @@ -11707,13 +11588,13 @@ class Interpretation extends Fields if ($useCustomCode) { // custom code - return PHP_EOL . $this->_t(3) . "

    "; } elseif (isset($this->fieldRelations[$nameListCode][(int) $item['id']]['set']) && StringHelper::check( @@ -11721,15 +11602,15 @@ class Interpretation extends Fields )) { // concatenate - return PHP_EOL . $this->_t(3) . "
    " . implode( + return PHP_EOL . Indent::_(3) . "
    " . implode( $this->fieldRelations[$nameListCode][(int) $item['id']][2]['set'], $field - ) . PHP_EOL . $this->_t(3) . "
    "; + ) . PHP_EOL . Indent::_(3) . "
    "; } // default - return PHP_EOL . $this->_t(3) . "
    " . implode('', $field) - . PHP_EOL . $this->_t(3) . "
    "; + return PHP_EOL . Indent::_(3) . "
    " . implode('', $field) + . PHP_EOL . Indent::_(3) . "
    "; } return $this->getListItem( @@ -11805,7 +11686,7 @@ class Interpretation extends Fields } // return the default (no link) - return PHP_EOL . $this->_t(3) . ""; + return PHP_EOL . Indent::_(3) . ""; } /** @@ -11831,31 +11712,31 @@ class Interpretation extends Fields $tab = ''; if ($class) { - $link .= PHP_EOL . $this->_t(3) . '
    '; - $tab = $this->_t(1); + $link .= PHP_EOL . Indent::_(3) . '
    '; + $tab = Indent::_(1); } // the link logic - $link .= PHP_EOL . $tab . $this->_t(3) . ""; - $link .= PHP_EOL . $tab . $this->_t(4) . ''; if ($checkoutTriger) { - $link .= PHP_EOL . $tab . $this->_t(4) + $link .= PHP_EOL . $tab . Indent::_(4) . "checked_out): ?>"; - $link .= PHP_EOL . $tab . $this->_t(5) + $link .= PHP_EOL . $tab . Indent::_(5) . "name, \$item->checked_out_time, '" . $nameListCode . ".', \$canCheckin); ?>"; - $link .= PHP_EOL . $tab . $this->_t(4) . ""; + $link .= PHP_EOL . $tab . Indent::_(4) . ""; } - $link .= PHP_EOL . $tab . $this->_t(3) . ""; - $link .= PHP_EOL . $tab . $this->_t(4) . ""; + $link .= PHP_EOL . $tab . Indent::_(4) . ""; - $link .= PHP_EOL . $tab . $this->_t(3) . ""; + $link .= PHP_EOL . $tab . Indent::_(3) . ""; // add class if ($class) { - $link .= PHP_EOL . $this->_t(3) . "
    "; + $link .= PHP_EOL . Indent::_(3) . "
    "; } // return the link logic @@ -11881,37 +11762,35 @@ class Interpretation extends Fields )) { // start building the links - $customAdminViewButton .= PHP_EOL . $this->_t(3) + $customAdminViewButton .= PHP_EOL . Indent::_(3) . '
    '; foreach ( $this->customAdminViewListLink[$nameListCode] as $customLinkView ) { - $customAdminViewButton .= PHP_EOL . $this->_t(3) + $customAdminViewButton .= PHP_EOL . Indent::_(3) . "get('" . $customLinkView['link'] . ".access')): ?>"; - $customAdminViewButton .= PHP_EOL . $this->_t(4) + $customAdminViewButton .= PHP_EOL . Indent::_(4) . 'fileContentStatic[$this->hhh . 'COMPONENT' - . $this->hhh] . '_' . $customLinkView['NAME'] . "'" + . $this->fileContentStatic[Placefix::_h('COMPONENT')] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; - $customAdminViewButton .= PHP_EOL . $this->_t(3) + $customAdminViewButton .= PHP_EOL . Indent::_(3) . ""; - $customAdminViewButton .= PHP_EOL . $this->_t(4) + $customAdminViewButton .= PHP_EOL . Indent::_(4) . 'fileContentStatic[$this->hhh - . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] + . ':_(' . "'COM_" . $this->fileContentStatic[Placefix::_h('COMPONENT')] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; - $customAdminViewButton .= PHP_EOL . $this->_t(3) + $customAdminViewButton .= PHP_EOL . Indent::_(3) . ""; } - $customAdminViewButton .= PHP_EOL . $this->_t(3) . '
    '; + $customAdminViewButton .= PHP_EOL . Indent::_(3) . ''; } return $customAdminViewButton; @@ -12244,30 +12123,30 @@ class Interpretation extends Fields && $this->adminFilterType[$nameListCode] == 1) { $body[] = ""; } // Trigger Event: jcb_ce_onSetDefaultViewsBodyTop - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onSetDefaultViewsBodyTop', array(&$this, &$body, @@ -12278,17 +12157,17 @@ class Interpretation extends Fields . $component . "&view=" . $nameListCode . "'); ?>\" method=\"post\" name=\"adminForm\" id=\"adminForm\">"; $body[] = "sidebar)): ?>"; - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "
    "; - $body[] = $this->_t(2) . "sidebar; ?>"; - $body[] = $this->_t(1) . "
    "; - $body[] = $this->_t(1) + $body[] = Indent::_(2) . "sidebar; ?>"; + $body[] = Indent::_(1) . ""; + $body[] = Indent::_(1) . "
    "; $body[] = ""; - $body[] = $this->_t(1) . "
    "; + $body[] = Indent::_(1) . "
    "; $body[] = ""; // Trigger Event: jcb_ce_onSetDefaultViewsFormTop - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onSetDefaultViewsFormTop', array(&$this, &$body, @@ -12301,21 +12180,21 @@ class Interpretation extends Fields { $body[] = "_t(1) + $addTrashHelper = Indent::_(1) . "echo JLayoutHelper::render('trashhelper', \$this);"; // add the trash helper layout if found in JCB if ($this->setTemplateAndLayoutData($addTrashHelper, $nameListCode)) { - $body[] = $this->_t(1) . "//" . $this->setLine( - __LINE__ + $body[] = Indent::_(1) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add the trash helper layout"; $body[] = $addTrashHelper; } // add the new search toolbar ;) - $body[] = $this->_t(1) . "//" . $this->setLine( - __LINE__ + $body[] = Indent::_(1) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add the searchtools"; - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "echo JLayoutHelper::render('joomla.searchtools.default', array('view' => \$this));"; $body[] = "?>"; } @@ -12324,67 +12203,67 @@ class Interpretation extends Fields if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1) { - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "loadTemplate('toolbar');?>"; } - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "
    "; - $body[] = $this->_t(2) + $body[] = Indent::_(2) . ""; - $body[] = $this->_t(1) . "
    "; + $body[] = Indent::_(1) . "
    "; $body[] = ""; // check if the filter type is sidebar (1 = sidebar) if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1) { - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "loadTemplate('toolbar');?>"; } - $body[] = $this->_t(1) . ""; - $body[] = $this->_t(2) + $body[] = Indent::_(2) . "loadTemplate('head');?>"; - $body[] = $this->_t(2) + $body[] = Indent::_(2) . "loadTemplate('foot');?>"; - $body[] = $this->_t(2) + $body[] = Indent::_(2) . "loadTemplate('body');?>"; - $body[] = $this->_t(1) . "
    "; - $body[] = $this->_t(1) . "setLine( - __LINE__ + $body[] = Indent::_(1) . ""; + $body[] = Indent::_(1) . ""; - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "canCreate && \$this->canEdit) : ?>"; - $body[] = $this->_t(2) . "_t(3) . "'bootstrap.renderModal',"; - $body[] = $this->_t(3) . "'collapseModal',"; - $body[] = $this->_t(3) . "array("; - $body[] = $this->_t(4) . "'title' => JText::_('COM_" . $COMPONENT . "_" + $body[] = Indent::_(2) . " JText::_('COM_" . $COMPONENT . "_" . $VIEWS . "_BATCH_OPTIONS'),"; - $body[] = $this->_t(4) + $body[] = Indent::_(4) . "'footer' => \$this->loadTemplate('batch_footer')"; - $body[] = $this->_t(3) . "),"; - $body[] = $this->_t(3) . "\$this->loadTemplate('batch_body')"; - $body[] = $this->_t(2) . "); ?>"; - $body[] = $this->_t(1) . ""; + $body[] = Indent::_(3) . "),"; + $body[] = Indent::_(3) . "\$this->loadTemplate('batch_body')"; + $body[] = Indent::_(2) . "); ?>"; + $body[] = Indent::_(1) . ""; // check if the filter type is sidebar (1 = sidebar) if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1) { - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "listOrder; ?>\" />"; - $body[] = $this->_t(1) + $body[] = Indent::_(1) . "listDirn; ?>\" />"; } - $body[] = $this->_t(1) + $body[] = Indent::_(1) . ""; - $body[] = $this->_t(1) . "
    "; + $body[] = Indent::_(1) . "
    "; $body[] = ""; - $body[] = $this->_t(1) + $body[] = Indent::_(1) . ""; - $body[] = $this->_t(1) . ""; + $body[] = Indent::_(1) . ""; // Trigger Event: jcb_ce_onSetDefaultViewsFormBottom - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onSetDefaultViewsFormBottom', array(&$this, &$body, @@ -12393,7 +12272,7 @@ class Interpretation extends Fields ); $body[] = ""; // Trigger Event: jcb_ce_onSetDefaultViewsBodyBottom - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onSetDefaultViewsBodyBottom', array(&$this, &$body, @@ -12439,39 +12318,39 @@ class Interpretation extends Fields // set id lang $idLangName = $langView . '_ID'; // add to lang array - $this->setLangContent($this->lang, $statusLangName, 'Status'); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $statusLangName, 'Status'); // add to lang array - $this->setLangContent($this->lang, $idLangName, 'Id'); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $idLangName, 'Id'); // set default $head = ''; - $head .= PHP_EOL . $this->_t(1) + $head .= PHP_EOL . Indent::_(1) . "canEdit&& \$this->canState): ?>"; if (!isset($this->fieldsNames[$nameSingleCode]['ordering'])) { - $head .= PHP_EOL . $this->_t(2) + $head .= PHP_EOL . Indent::_(2) . ''; - $head .= PHP_EOL . $this->_t(3) + $head .= PHP_EOL . Indent::_(3) . "listDirn, \$this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'" . $jhtml_sort_icon_2 . "); ?>"; - $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . Indent::_(2) . ""; } - $head .= PHP_EOL . $this->_t(2) + $head .= PHP_EOL . Indent::_(2) . ''; - $head .= PHP_EOL . $this->_t(3) + $head .= PHP_EOL . Indent::_(3) . ""; - $head .= PHP_EOL . $this->_t(2) . ""; - $head .= PHP_EOL . $this->_t(1) . ""; - $head .= PHP_EOL . $this->_t(2) + $head .= PHP_EOL . Indent::_(2) . ""; + $head .= PHP_EOL . Indent::_(1) . ""; + $head .= PHP_EOL . Indent::_(2) . ''; - $head .= PHP_EOL . $this->_t(3) . "▾"; - $head .= PHP_EOL . $this->_t(2) . ""; - $head .= PHP_EOL . $this->_t(2) + $head .= PHP_EOL . Indent::_(3) . "▾"; + $head .= PHP_EOL . Indent::_(2) . ""; + $head .= PHP_EOL . Indent::_(2) . ''; - $head .= PHP_EOL . $this->_t(3) . "■"; - $head .= PHP_EOL . $this->_t(2) . ""; - $head .= PHP_EOL . $this->_t(1) . ""; + $head .= PHP_EOL . Indent::_(3) . "■"; + $head .= PHP_EOL . Indent::_(2) . ""; + $head .= PHP_EOL . Indent::_(1) . ""; // set footer Column number $this->listColnrBuilder[$nameListCode] = 4; // build the dynamic fields @@ -12532,42 +12411,42 @@ class Interpretation extends Fields $title = ""; } - $head .= PHP_EOL . $this->_t(1) . ''; - $head .= PHP_EOL . $this->_t(3) . $title; - $head .= PHP_EOL . $this->_t(1) . ""; + $head .= PHP_EOL . Indent::_(3) . $title; + $head .= PHP_EOL . Indent::_(1) . ""; $this->listColnrBuilder[$nameListCode]++; } } // set default if (!isset($this->fieldsNames[$nameSingleCode]['published'])) { - $head .= PHP_EOL . $this->_t(1) + $head .= PHP_EOL . Indent::_(1) . "canState): ?>"; - $head .= PHP_EOL . $this->_t(2) + $head .= PHP_EOL . Indent::_(2) . ''; - $head .= PHP_EOL . $this->_t(3) + $head .= PHP_EOL . Indent::_(3) . "listDirn, \$this->listOrder); ?>"; - $head .= PHP_EOL . $this->_t(2) . ""; - $head .= PHP_EOL . $this->_t(1) . ""; - $head .= PHP_EOL . $this->_t(2) + $head .= PHP_EOL . Indent::_(2) . ""; + $head .= PHP_EOL . Indent::_(1) . ""; + $head .= PHP_EOL . Indent::_(2) . ''; - $head .= PHP_EOL . $this->_t(3) . ""; - $head .= PHP_EOL . $this->_t(2) . ""; - $head .= PHP_EOL . $this->_t(1) . ""; + $head .= PHP_EOL . Indent::_(2) . ""; + $head .= PHP_EOL . Indent::_(1) . ""; } if (!isset($this->fieldsNames[$nameSingleCode]['id'])) { - $head .= PHP_EOL . $this->_t(1) + $head .= PHP_EOL . Indent::_(1) . ''; - $head .= PHP_EOL . $this->_t(3) + $head .= PHP_EOL . Indent::_(3) . "listDirn, \$this->listOrder); ?>"; - $head .= PHP_EOL . $this->_t(1) . ""; + $head .= PHP_EOL . Indent::_(1) . ""; } $head .= PHP_EOL . ""; @@ -12620,23 +12499,23 @@ class Interpretation extends Fields foreach ($fields as $field) { // add each field - $fieldArray[] = PHP_EOL . $this->_t(4) . "'" . $field + $fieldArray[] = PHP_EOL . Indent::_(4) . "'" . $field . "'"; } // add the alignemnt key - $alignmentArray[] = PHP_EOL . $this->_t(3) . "'" + $alignmentArray[] = PHP_EOL . Indent::_(3) . "'" . $this->alignmentOptions[$alignment] . "' => array(" - . implode(',', $fieldArray) . PHP_EOL . $this->_t(3) + . implode(',', $fieldArray) . PHP_EOL . Indent::_(3) . ")"; } // add the layout key - $layoutArray[] = PHP_EOL . $this->_t(2) . "'" + $layoutArray[] = PHP_EOL . Indent::_(2) . "'" . StringHelper::safe($layout) . "' => array(" . implode(',', $alignmentArray) . PHP_EOL - . $this->_t(2) . ")"; + . Indent::_(2) . ")"; } - return 'array(' . implode(',', $layoutArray) . PHP_EOL . $this->_t( + return 'array(' . implode(',', $layoutArray) . PHP_EOL . Indent::_( 1 ) . ")"; } @@ -12699,7 +12578,7 @@ class Interpretation extends Fields $body = PHP_EOL . '
    '; if (StringHelper::check($span)) { - $body .= PHP_EOL . $this->_t(1) . '
    '; + $body .= PHP_EOL . Indent::_(1) . '
    '; } // now build the dynamic tabs foreach ($tabBucket as $tabCodeName => $positions) @@ -12715,7 +12594,7 @@ class Interpretation extends Fields // set acctive tab (must be in side foreach loop to get active tab code name) if ($tabCounter == 0) { - $body .= PHP_EOL . PHP_EOL . $this->_t(1) + $body .= PHP_EOL . PHP_EOL . Indent::_(1) . " '" . $tabCodeName . "')); ?>"; @@ -12758,7 +12637,7 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$coreLinked['core.access']] )) { - $body .= PHP_EOL . PHP_EOL . $this->_t(1) + $body .= PHP_EOL . PHP_EOL . Indent::_(1) . "canDo->get('" . $coreLinked['core.access'] . "')) : ?>"; $closeIT = true; @@ -12775,31 +12654,31 @@ class Interpretation extends Fields $body .= PHP_EOL; } // start addtab body - $body .= PHP_EOL . $this->_t(1) + $body .= PHP_EOL . Indent::_(1) . ""; // add the main - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . '
    '; $body .= $main; - $body .= PHP_EOL . $this->_t(2) . "
    "; + $body .= PHP_EOL . Indent::_(2) . "
    "; // add main body bottom div if needed if (strlen($mainbottom) > 0) { // add the main bottom - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . '
    '; $body .= $mainbottom; - $body .= PHP_EOL . $this->_t(2) . "
    "; + $body .= PHP_EOL . Indent::_(2) . "
    "; } // end addtab body - $body .= PHP_EOL . $this->_t(1) + $body .= PHP_EOL . Indent::_(1) . ""; // if we had permissions added if ($closeIT) { - $body .= PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . Indent::_(1) . ""; } // check if custom tab must be added if (($_customTabHTML = $this->addCustomTabs( @@ -12812,30 +12691,30 @@ class Interpretation extends Fields $tabCounter++; } // add option to load forms loaded in via plugins (TODO) we may want to move these tab locations - $body .= PHP_EOL . PHP_EOL . $this->_t(1) + $body .= PHP_EOL . PHP_EOL . Indent::_(1) . "ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>"; - $body .= PHP_EOL . $this->_t(1) . "tab_name = '" + $body .= PHP_EOL . Indent::_(1) . "tab_name = '" . $nameSingleCode . "Tab'; ?>"; - $body .= PHP_EOL . $this->_t(1) + $body .= PHP_EOL . Indent::_(1) . ""; // add the publish and meta data tabs $body .= $this->getEditBodyPublishMetaTabs( $nameSingleCode, $langView ); // end the tab set - $body .= PHP_EOL . PHP_EOL . $this->_t(1) + $body .= PHP_EOL . PHP_EOL . Indent::_(1) . ""; - $body .= PHP_EOL . PHP_EOL . $this->_t(1) . "
    "; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . PHP_EOL . Indent::_(1) . "
    "; + $body .= PHP_EOL . Indent::_(2) . ''; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . ""; - $body .= PHP_EOL . $this->_t(1) . "
    "; + $body .= PHP_EOL . Indent::_(1) . "
    "; // close divs if (StringHelper::check($span)) { - $body .= PHP_EOL . $this->_t(1) . "
    "; + $body .= PHP_EOL . Indent::_(1) . ""; } $body .= PHP_EOL . ""; // check if left has been set @@ -12971,7 +12850,7 @@ class Interpretation extends Fields /// set the values to use in search latter $searchTabs[$tabCodeName] = $tabNr; // add to lang array - $this->setLangContent($this->lang, $tabLangName, $tabName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $tabLangName, $tabName); // check if linked view belongs to this tab $buildLayout = true; $linkedViewId = ''; @@ -13009,7 +12888,7 @@ class Interpretation extends Fields } else { - $items .= "," . PHP_EOL . $this->_t(1) . "'" . $name + $items .= "," . PHP_EOL . Indent::_(1) . "'" . $name . "'"; } $itemCounter++; @@ -13061,7 +12940,7 @@ class Interpretation extends Fields 'layouttitle' ); // load to header - $header .= PHP_EOL . $this->_t(1) + $header .= PHP_EOL . Indent::_(1) . ""; @@ -13087,7 +12966,7 @@ class Interpretation extends Fields 'layoutitems' ); // load the body - $leftside .= PHP_EOL . $this->_t(1) + $leftside .= PHP_EOL . Indent::_(1) . ""; @@ -13100,7 +12979,7 @@ class Interpretation extends Fields 'layoutitems' ); // load the body - $rightside .= PHP_EOL . $this->_t(1) + $rightside .= PHP_EOL . Indent::_(1) . ""; @@ -13182,9 +13061,9 @@ class Interpretation extends Fields { case 1: // left case 2: // right - $main .= PHP_EOL . $this->_t(3) . '
    '; - $main .= PHP_EOL . $this->_t(4) . $string; - $main .= PHP_EOL . $this->_t(3) . '
    '; + $main .= PHP_EOL . Indent::_(3) . '
    '; + $main .= PHP_EOL . Indent::_(4) . $string; + $main .= PHP_EOL . Indent::_(3) . '
    '; break; } } @@ -13194,20 +13073,20 @@ class Interpretation extends Fields { case 1: // left case 2: // right - $main .= PHP_EOL . $this->_t(3) + $main .= PHP_EOL . Indent::_(3) . '
    '; - $main .= PHP_EOL . $this->_t(4) . $string; - $main .= PHP_EOL . $this->_t(3) . '
    '; + $main .= PHP_EOL . Indent::_(4) . $string; + $main .= PHP_EOL . Indent::_(3) . ''; break; } } switch ($position) { case 3: // fullwidth - $mainbottom .= PHP_EOL . $this->_t(3) + $mainbottom .= PHP_EOL . Indent::_(3) . '
    '; - $mainbottom .= PHP_EOL . $this->_t(4) . $string; - $mainbottom .= PHP_EOL . $this->_t(3) . '
    '; + $mainbottom .= PHP_EOL . Indent::_(4) . $string; + $mainbottom .= PHP_EOL . Indent::_(3) . ''; break; } } @@ -13230,7 +13109,7 @@ class Interpretation extends Fields // set default publishing tab lang $tabLangName = $langView . '_PUBLISHING'; // add to lang array - $this->setLangContent($this->lang, $tabLangName, 'Publishing'); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $tabLangName, 'Publishing'); // the default publishing items $items = array('left' => array(), 'right' => array()); // Setup the default (custom) fields @@ -13318,7 +13197,7 @@ class Interpretation extends Fields if (ArrayHelper::check($items['left'])) { $items_one .= "'" . implode( - "'," . PHP_EOL . $this->_t(1) . "'", $items['left'] + "'," . PHP_EOL . Indent::_(1) . "'", $items['left'] ) . "'"; } if (ArrayHelper::check($items['right'])) @@ -13326,9 +13205,9 @@ class Interpretation extends Fields // there is already fields just add these if (strlen($items_one) > 3) { - $items_one .= "," . PHP_EOL . $this->_t(1) . "'" + $items_one .= "," . PHP_EOL . Indent::_(1) . "'" . implode( - "'," . PHP_EOL . $this->_t(1) . "'", + "'," . PHP_EOL . Indent::_(1) . "'", $items['right'] ) . "'"; } @@ -13336,7 +13215,7 @@ class Interpretation extends Fields else { $items_one .= "'" . implode( - "'," . PHP_EOL . $this->_t(1) . "'", + "'," . PHP_EOL . Indent::_(1) . "'", $items['right'] ) . "'"; } @@ -13385,7 +13264,7 @@ class Interpretation extends Fields { // load all items $items_one = "'" . implode( - "'," . PHP_EOL . $this->_t(1) . "'", $items['left'] + "'," . PHP_EOL . Indent::_(1) . "'", $items['left'] ) . "'"; // set the publishing layout $this->setLayout( @@ -13399,7 +13278,7 @@ class Interpretation extends Fields { // load all items $items_two = "'" . implode( - "'," . PHP_EOL . $this->_t(1) . "'", $items['right'] + "'," . PHP_EOL . Indent::_(1) . "'", $items['right'] ) . "'"; // set the publishing layout $this->setLayout( @@ -13498,38 +13377,38 @@ class Interpretation extends Fields // add the AND values to OR $publishingPerOR[] = '(' . implode(' && ', $publishingPerAND) . ')'; // now build the complete showhide behaviour for the publishing area - $tabs .= PHP_EOL . PHP_EOL . $this->_t(1) . ""; // set the default publishing tab - $tabs .= PHP_EOL . $this->_t(1) + $tabs .= PHP_EOL . Indent::_(1) . ""; - $tabs .= PHP_EOL . $this->_t(2) + $tabs .= PHP_EOL . Indent::_(2) . '
    '; if ($items_one) { - $tabs .= PHP_EOL . $this->_t(3) . '
    '; - $tabs .= PHP_EOL . $this->_t(4) + $tabs .= PHP_EOL . Indent::_(4) . ""; - $tabs .= PHP_EOL . $this->_t(3) . "
    "; + $tabs .= PHP_EOL . Indent::_(3) . "
    "; } if ($items_two) { - $tabs .= PHP_EOL . $this->_t(3) . '
    '; - $tabs .= PHP_EOL . $this->_t(4) + $tabs .= PHP_EOL . Indent::_(4) . ""; - $tabs .= PHP_EOL . $this->_t(3) . "
    "; + $tabs .= PHP_EOL . Indent::_(3) . ""; } - $tabs .= PHP_EOL . $this->_t(2) . ""; - $tabs .= PHP_EOL . $this->_t(1) + $tabs .= PHP_EOL . Indent::_(2) . ""; + $tabs .= PHP_EOL . Indent::_(1) . ""; - $tabs .= PHP_EOL . $this->_t(1) . ""; + $tabs .= PHP_EOL . Indent::_(1) . ""; // check if custom tab must be added if (($_customTabHTML = $this->addCustomTabs( 15, $nameSingleCode, 2 @@ -13549,34 +13428,34 @@ class Interpretation extends Fields // set permissions tab code name $tabCodeName = 'permissions'; // add to lang array - $this->setLangContent($this->lang, $tabLangName, 'Permissions'); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $tabLangName, 'Permissions'); // set the permissions tab - $tabs .= PHP_EOL . PHP_EOL . $this->_t(1) + $tabs .= PHP_EOL . PHP_EOL . Indent::_(1) . "canDo->get('core.admin')) : ?>"; - $tabs .= PHP_EOL . $this->_t(1) + $tabs .= PHP_EOL . Indent::_(1) . ""; - $tabs .= PHP_EOL . $this->_t(2) + $tabs .= PHP_EOL . Indent::_(2) . '
    '; - $tabs .= PHP_EOL . $this->_t(3) . '
    '; - $tabs .= PHP_EOL . $this->_t(4) . '
    '; - $tabs .= PHP_EOL . $this->_t(5) . '
    '; - $tabs .= PHP_EOL . $this->_t(5) + $tabs .= PHP_EOL . Indent::_(3) . '
    '; + $tabs .= PHP_EOL . Indent::_(4) . '
    '; + $tabs .= PHP_EOL . Indent::_(5) . '
    '; + $tabs .= PHP_EOL . Indent::_(5) . "form->getFieldset('accesscontrol') as \$field): ?>"; - $tabs .= PHP_EOL . $this->_t(6) . "
    "; - $tabs .= PHP_EOL . $this->_t(7) + $tabs .= PHP_EOL . Indent::_(6) . "
    "; + $tabs .= PHP_EOL . Indent::_(7) . "label; echo \$field->input;?>"; - $tabs .= PHP_EOL . $this->_t(6) . "
    "; - $tabs .= PHP_EOL . $this->_t(6) . '
    '; - $tabs .= PHP_EOL . $this->_t(5) . ""; - $tabs .= PHP_EOL . $this->_t(5) . "
    "; - $tabs .= PHP_EOL . $this->_t(4) . "
    "; - $tabs .= PHP_EOL . $this->_t(3) . "
    "; - $tabs .= PHP_EOL . $this->_t(2) . "
    "; - $tabs .= PHP_EOL . $this->_t(1) + $tabs .= PHP_EOL . Indent::_(6) . "
    "; + $tabs .= PHP_EOL . Indent::_(6) . '
    '; + $tabs .= PHP_EOL . Indent::_(5) . ""; + $tabs .= PHP_EOL . Indent::_(5) . "
    "; + $tabs .= PHP_EOL . Indent::_(4) . ""; + $tabs .= PHP_EOL . Indent::_(3) . ""; + $tabs .= PHP_EOL . Indent::_(2) . ""; + $tabs .= PHP_EOL . Indent::_(1) . ""; - $tabs .= PHP_EOL . $this->_t(1) . ""; + $tabs .= PHP_EOL . Indent::_(1) . ""; } return $tabs; @@ -13624,34 +13503,34 @@ class Interpretation extends Fields { // set view name $fadein[] = ""; $fadein[] = "
    componentCodeName . "_loader\" style=\"display: none;\">"; @@ -13677,7 +13556,7 @@ class Interpretation extends Fields $target = array('admin' => $nameSingleCode); $this->buildDynamique($target, $type, $layoutName); // add to front if needed - if ($this->lang === 'both') + if (CFactory::_('Config')->lang_target === 'both') { $target = array('site' => $nameSingleCode); $this->buildDynamique($target, $type, $layoutName); @@ -13686,14 +13565,14 @@ class Interpretation extends Fields { // LAYOUTITEMS <<>> $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][$this->hhh . 'LAYOUTITEMS' . $this->hhh] + . $layoutName][Placefix::_h('LAYOUTITEMS')] = $items; } else { // LAYOUTITEMS <<>> $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][$this->hhh . 'bogus' . $this->hhh] + . $layoutName][Placefix::_h('bogus')] = 'boom'; } } @@ -13715,7 +13594,7 @@ class Interpretation extends Fields $target = array('admin' => $nameSingleCode); $this->buildDynamique($target, 'layoutoverride', $layoutName); // add to front if needed - if ($this->lang === 'both') + if (CFactory::_('Config')->lang_target === 'both') { $target = array('site' => $nameSingleCode); $this->buildDynamique($target, 'layoutoverride', $layoutName); @@ -13727,37 +13606,33 @@ class Interpretation extends Fields } // set placeholder $placeholder = $this->placeholders; - $placeholder[$this->hhh . 'LAYOUTITEMS' . $this->hhh] = $items; + $placeholder[Placefix::_h('LAYOUTITEMS')] = $items; // OVERRIDE_LAYOUT_CODE <<>> $php_view = (array) explode(PHP_EOL, $data['php_view']); if (ArrayHelper::check($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][$this->hhh - . 'OVERRIDE_LAYOUT_CODE' . $this->hhh] - = $this->setPlaceholders( + . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_CODE')] + = CFactory::_('Placeholder')->update( $php_view, $placeholder ); } else { $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][$this->hhh - . 'OVERRIDE_LAYOUT_CODE' . $this->hhh] + . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_CODE')] = ''; } // OVERRIDE_LAYOUT_BODY <<>> $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][$this->hhh - . 'OVERRIDE_LAYOUT_BODY' . $this->hhh] - = PHP_EOL . $this->setPlaceholders( + . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_BODY')] + = PHP_EOL . CFactory::_('Placeholder')->update( $data['html'], $placeholder ); // OVERRIDE_LAYOUT_HEADER <<>> $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutName][$this->hhh - . 'OVERRIDE_LAYOUT_HEADER' . $this->hhh] + . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_HEADER')] = (($header = $this->setFileHeader( 'override.layout', $layoutName, false) @@ -13784,10 +13659,10 @@ class Interpretation extends Fields array($this->componentCodeName . $nameSingleCode . $layoutName) )) { - $data = $this->layoutData[$this->target][$this->componentCodeName + $data = $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName . $nameSingleCode . $layoutName]; // remove since we will add the layout now - if ($this->lang === 'both') + if (CFactory::_('Config')->lang_target === 'both') { unset( $this->layoutData['admin'][$this->componentCodeName @@ -13801,7 +13676,7 @@ class Interpretation extends Fields else { unset( - $this->layoutData[$this->target][$this->componentCodeName + $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName . $nameSingleCode . $layoutName] ); } @@ -13814,10 +13689,10 @@ class Interpretation extends Fields array($this->componentCodeName . $layoutName) )) { - $data = $this->layoutData[$this->target][$this->componentCodeName + $data = $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName . $layoutName]; // remove since we will add the layout now - if ($this->lang === 'both') + if (CFactory::_('Config')->lang_target === 'both') { unset( $this->layoutData['admin'][$this->componentCodeName @@ -13831,7 +13706,7 @@ class Interpretation extends Fields else { unset( - $this->layoutData[$this->target][$this->componentCodeName + $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName . $layoutName] ); } @@ -13844,10 +13719,10 @@ class Interpretation extends Fields array($nameSingleCode . $layoutName) )) { - $data = $this->layoutData[$this->target][$nameSingleCode + $data = $this->layoutData[CFactory::_('Config')->build_target][$nameSingleCode . $layoutName]; // remove since we will add the layout now - if ($this->lang === 'both') + if (CFactory::_('Config')->lang_target === 'both') { unset( $this->layoutData['admin'][$nameSingleCode . $layoutName] @@ -13856,7 +13731,7 @@ class Interpretation extends Fields } else { - unset($this->layoutData[$this->target][$layoutName]); + unset($this->layoutData[CFactory::_('Config')->build_target][$layoutName]); } return $data; @@ -13867,16 +13742,16 @@ class Interpretation extends Fields array($layoutName) )) { - $data = $this->layoutData[$this->target][$layoutName]; + $data = $this->layoutData[CFactory::_('Config')->build_target][$layoutName]; // remove since we will add the layout now - if ($this->lang === 'both') + if (CFactory::_('Config')->lang_target === 'both') { unset($this->layoutData['admin'][$layoutName]); unset($this->layoutData['site'][$layoutName]); } else { - unset($this->layoutData[$this->target][$layoutName]); + unset($this->layoutData[CFactory::_('Config')->build_target][$layoutName]); } return $data; @@ -13924,47 +13799,46 @@ class Interpretation extends Fields $functionName = StringHelper::safe($codeName, 'F'); // LAYOUTITEMSTABLE <<>> $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] + . $layoutCodeName][Placefix::_h('LAYOUTITEMSTABLE')] = $head . $body; // LAYOUTITEMSHEADER <<>> - $headerscript = '//' . $this->setLine(__LINE__) + $headerscript = '//' . Line::_(__Line__, __Class__) . ' set the edit URL'; $headerscript .= PHP_EOL . '$edit = "index.php?option=com_' . $this->componentCodeName . '&view=' . $name_list_code . '&task=' . $name_single_code . '.edit";'; - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' set a return value'; $headerscript .= PHP_EOL . '$return = ($id) ? "index.php?option=com_' . $this->componentCodeName . '&view=' . $nameSingleCode . '&layout=edit&id=" . $id : "";'; - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' check for a return value'; $headerscript .= PHP_EOL . '$jinput = JFactory::getApplication()->input;'; $headerscript .= PHP_EOL . "if (\$_return = \$jinput->get('return', null, 'base64'))"; $headerscript .= PHP_EOL . '{'; - $headerscript .= PHP_EOL . $this->_t(1) + $headerscript .= PHP_EOL . Indent::_(1) . '$return .= "&return=" . $_return;'; $headerscript .= PHP_EOL . '}'; - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' check if return value was set'; $headerscript .= PHP_EOL . 'if (' - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper::checkString($return))'; + . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::checkString($return))'; $headerscript .= PHP_EOL . '{'; - $headerscript .= PHP_EOL . $this->_t(1) . '//' . $this->setLine( - __LINE__ + $headerscript .= PHP_EOL . Indent::_(1) . '//' . Line::_( + __LINE__,__CLASS__ ) . ' set the referral values'; - $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref=' + $headerscript .= PHP_EOL . Indent::_(1) . '$ref = ($id) ? "&ref=' . $nameSingleCode . '&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return));'; $headerscript .= PHP_EOL . '}'; $headerscript .= PHP_EOL . 'else'; $headerscript .= PHP_EOL . '{'; - $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref=' + $headerscript .= PHP_EOL . Indent::_(1) . '$ref = ($id) ? "&ref=' . $nameSingleCode . '&refid=" . $id : "";'; $headerscript .= PHP_EOL . '}'; if ($addNewButon > 0) @@ -13972,7 +13846,7 @@ class Interpretation extends Fields // add the link for new if ($addNewButon == 1 || $addNewButon == 2) { - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' set the create new URL'; $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->componentCodeName . '&view=' . $name_list_code @@ -13982,7 +13856,7 @@ class Interpretation extends Fields // and the link for close and new if ($addNewButon == 2 || $addNewButon == 3) { - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' set the create new and close URL'; $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' @@ -13990,28 +13864,25 @@ class Interpretation extends Fields . '&task=' . $name_single_code . '.edit";'; } - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' load the action object'; $headerscript .= PHP_EOL . '$can = ' - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper::getActions(' . "'" + . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::getActions(' . "'" . $name_single_code . "'" . ');'; } $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] + . $layoutCodeName][Placefix::_h('LAYOUTITEMSHEADER')] = $headerscript; // LINKEDVIEWITEMS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWITEMS' . $this->hhh] - .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ - ) . " Get Linked view data" . PHP_EOL . $this->_t(2) + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWITEMS')] + .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Get Linked view data" . PHP_EOL . Indent::_(2) . "\$this->" . $codeName . " = \$this->get('" . $functionName . "');"; // LINKEDVIEWTABLESCRIPTS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWTABLESCRIPTS')] = $this->setFootableScripts(); if (strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false) @@ -14053,9 +13924,8 @@ class Interpretation extends Fields = StringHelper::safe( $_key . $this->uniquekey(4) ); - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWGLOBAL' . $this->hhh] - .= PHP_EOL . $this->_t(2) . "\$this->" + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')] + .= PHP_EOL . Indent::_(2) . "\$this->" . $globalKey[$parent_key] . " = \$item->" . $parent_key . ";"; } @@ -14066,14 +13936,12 @@ class Interpretation extends Fields $globalKey = StringHelper::safe( $_key . $this->uniquekey(4) ); - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWGLOBAL' . $this->hhh] - .= PHP_EOL . $this->_t(2) . "\$this->" . $globalKey + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')] + .= PHP_EOL . Indent::_(2) . "\$this->" . $globalKey . " = \$item->" . $parent_key . ";"; } // LINKEDVIEWMETHODS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWMETHODS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWMETHODS')] .= $this->setListQueryLinked( $name_single_code, $name_list_code, $functionName, $key, $_key, $parentKey, @@ -14083,10 +13951,10 @@ class Interpretation extends Fields else { $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] + . $layoutCodeName][Placefix::_h('LAYOUTITEMSTABLE')] = 'oops! error.....'; $this->fileContentDynamic[$nameSingleCode . '_' - . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] + . $layoutCodeName][Placefix::_h('LAYOUTITEMSHEADER')] = ''; } } @@ -14101,62 +13969,62 @@ class Interpretation extends Fields if (!isset($this->footableVersion) || 2 == $this->footableVersion) // loading version 2 { - $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $foo = PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add the CSS for Footable."; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "JHtml::_('stylesheet', 'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.core.min.css', ['version' => 'auto']);"; - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $foo .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Use the Metro Style"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "if (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)"; - $foo .= PHP_EOL . $this->_t(2) . "{"; - $foo .= PHP_EOL . $this->_t(3) + $foo .= PHP_EOL . Indent::_(2) . "{"; + $foo .= PHP_EOL . Indent::_(3) . "JHtml::_('stylesheet', 'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.metro.min.css', ['version' => 'auto']);"; - $foo .= PHP_EOL . $this->_t(2) . "}"; - $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $foo .= PHP_EOL . Indent::_(2) . "}"; + $foo .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Use the Legacy Style."; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "elseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)"; - $foo .= PHP_EOL . $this->_t(2) . "{"; - $foo .= PHP_EOL . $this->_t(3) + $foo .= PHP_EOL . Indent::_(2) . "{"; + $foo .= PHP_EOL . Indent::_(3) . "JHtml::_('stylesheet', 'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.standalone.min.css', ['version' => 'auto']);"; - $foo .= PHP_EOL . $this->_t(2) . "}"; - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $foo .= PHP_EOL . Indent::_(2) . "}"; + $foo .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add the JavaScript for Footable"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "JHtml::_('script', 'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.js', ['version' => 'auto']);"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "JHtml::_('script', 'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.sort.js', ['version' => 'auto']);"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "JHtml::_('script', 'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.filter.js', ['version' => 'auto']);"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "JHtml::_('script', 'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.paginate.js', ['version' => 'auto']);"; if ($init) { - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . PHP_EOL . Indent::_(2) . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable(); }); jQuery(' . "'.nav-tabs'" . ').on(' . "'click'" . ', ' . "'li'" . ', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery(' . "'.footable'" . ').trigger(' . "'footable_resize'" . '); }";'; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; } @@ -14164,27 +14032,27 @@ class Interpretation extends Fields elseif (3 == $this->footableVersion) // loading version 3 { - $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $foo = PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add the CSS for Footable"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "JHtml::_('stylesheet', 'media/com_" . $this->componentCodeName . "/footable-v3/css/footable.standalone.min.css', ['version' => 'auto']);"; - $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $foo .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Add the JavaScript for Footable (adding all functions)"; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "JHtml::_('script', 'media/com_" . $this->componentCodeName . "/footable-v3/js/footable.min.js', ['version' => 'auto']);"; if ($init) { - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . PHP_EOL . Indent::_(2) . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable();});});";'; - $foo .= PHP_EOL . $this->_t(2) + $foo .= PHP_EOL . Indent::_(2) . "\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; } @@ -14212,8 +14080,7 @@ class Interpretation extends Fields )) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; // make sure the custom links are only added once $firstTimeBeingAdded = true; // setup correct core target @@ -14228,16 +14095,16 @@ class Interpretation extends Fields // add the default $body = PHP_EOL . ""; $body .= PHP_EOL . " \$item): ?>"; - $body .= PHP_EOL . $this->_t(1) . "_t(2) + $body .= PHP_EOL . Indent::_(1) . "authorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;"; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "\$userChkOut = JFactory::getUser(\$item->checked_out);"; - $body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper + $body .= PHP_EOL . Indent::_(2) . "\$canDo = " . $Helper . "::getActions('" . $nameSingleCode . "',\$item,'" . $nameListCode . "');"; - $body .= PHP_EOL . $this->_t(1) . "?>"; - $body .= PHP_EOL . $this->_t(1) . ''; + $body .= PHP_EOL . Indent::_(1) . "?>"; + $body .= PHP_EOL . Indent::_(1) . ''; // check if this view has fields that should not be escaped $doNotEscape = false; if (isset($this->doNotEscape[$nameListCode])) @@ -14272,10 +14139,10 @@ class Interpretation extends Fields $firstTimeBeingAdded = false; } // add row to body - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; $body .= $itemRow; $body .= $customAdminViewButtons; - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(2) . ""; // increment counter $counter++; } @@ -14288,95 +14155,95 @@ class Interpretation extends Fields { $counter++; // add the defaults - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "published == 1): ?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) + $body .= PHP_EOL . Indent::_(4) . 'langPrefix . "_PUBLISHED'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_PUBLISHED'" . '); ?>'; - $body .= PHP_EOL . $this->_t(4) . ''; - $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . Indent::_(4) . ''; + $body .= PHP_EOL . Indent::_(3) . ''; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "published == 0): ?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) + $body .= PHP_EOL . Indent::_(4) . 'langPrefix . "_INACTIVE'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_INACTIVE'" . '); ?>'; - $body .= PHP_EOL . $this->_t(4) . ''; - $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . Indent::_(4) . ''; + $body .= PHP_EOL . Indent::_(3) . ''; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "published == 2): ?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) + $body .= PHP_EOL . Indent::_(4) . 'langPrefix . "_ARCHIVED'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_ARCHIVED'" . '); ?>'; - $body .= PHP_EOL . $this->_t(4) . ''; - $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . Indent::_(4) . ''; + $body .= PHP_EOL . Indent::_(3) . ''; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . "published == -2): ?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) + $body .= PHP_EOL . Indent::_(4) . 'langPrefix . "_TRASHED'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_TRASHED'" . '); ?>'; - $body .= PHP_EOL . $this->_t(4) . ''; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . Indent::_(4) . ''; + $body .= PHP_EOL . Indent::_(3) . ''; + $body .= PHP_EOL . Indent::_(2) . ''; } // add the defaults if (!isset($this->fieldsNames[$nameSingleCode]['id'])) { $counter++; - $body .= PHP_EOL . $this->_t(2) + $body .= PHP_EOL . Indent::_(2) . ''; - $body .= PHP_EOL . $this->_t(3) . "id; ?>"; - $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . Indent::_(3) . "id; ?>"; + $body .= PHP_EOL . Indent::_(2) . ""; } - $body .= PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . Indent::_(1) . ""; $body .= PHP_EOL . ""; $body .= PHP_EOL . ""; if (2 == $this->footableVersion) { $body .= PHP_EOL . ''; - $body .= PHP_EOL . $this->_t(1) . ''; - $body .= PHP_EOL . $this->_t(2) . ''; - $body .= PHP_EOL . $this->_t(3) + $body .= PHP_EOL . Indent::_(3) . ''; - $body .= PHP_EOL . $this->_t(2) . ''; - $body .= PHP_EOL . $this->_t(1) . ''; + $body .= PHP_EOL . Indent::_(2) . ''; + $body .= PHP_EOL . Indent::_(1) . ''; $body .= PHP_EOL . ''; } $body .= PHP_EOL . ''; $body .= PHP_EOL . ''; - $body .= PHP_EOL . $this->_t(1) + $body .= PHP_EOL . Indent::_(1) . '
    '; - $body .= PHP_EOL . $this->_t(2) . ''; - $body .= PHP_EOL . $this->_t(1) . '
    '; + $body .= PHP_EOL . Indent::_(1) . '
    '; $body .= PHP_EOL . ''; // return the build @@ -14406,8 +14273,7 @@ class Interpretation extends Fields )) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; $head = ''; // only add new button if set if ($addNewButon > 0) @@ -14444,13 +14310,13 @@ class Interpretation extends Fields $tabB = ""; if ($addNewButon == 2) { - $head .= PHP_EOL . $this->_t(1) . '
    '; - $tabB = $this->_t(1); + $head .= PHP_EOL . Indent::_(1) . '
    '; + $tabB = Indent::_(1); } // add the new buttons if ($addNewButon == 1 || $addNewButon == 2) { - $head .= PHP_EOL . $tabB . $this->_t(1) + $head .= PHP_EOL . $tabB . Indent::_(1) . ' langPrefix . "_NEW'" . '); ?>'; @@ -14458,7 +14324,7 @@ class Interpretation extends Fields // add the close and new button if ($addNewButon == 2 || $addNewButon == 3) { - $head .= PHP_EOL . $tabB . $this->_t(1) + $head .= PHP_EOL . $tabB . Indent::_(1) . ' _t(1) . '


    '; + $head .= PHP_EOL . Indent::_(1) . '


    '; } else { @@ -14503,10 +14369,10 @@ class Interpretation extends Fields // make sure only first link is used as togeler $firstLink = true; // add to lang array - $this->setLangContent($this->lang, $statusLangName, 'Status'); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $statusLangName, 'Status'); // add to lang array - $this->setLangContent($this->lang, $idLangName, 'Id'); - $head .= PHP_EOL . $this->_t(1) . ""; + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $idLangName, 'Id'); + $head .= PHP_EOL . Indent::_(1) . ""; // set controller for data hiding options $controller = 1; // build the dynamic fields @@ -14546,11 +14412,11 @@ class Interpretation extends Fields ? ' data-toggle="true"' : ''; $firstLink = false; } - $head .= PHP_EOL . $this->_t(2) . ""; - $head .= PHP_EOL . $this->_t(3) . ""; - $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . Indent::_(2) . ""; $controller++; } } @@ -14560,11 +14426,11 @@ class Interpretation extends Fields // add the defaults if (!isset($this->fieldsNames[$nameSingleCode]['published'])) { - $head .= PHP_EOL . $this->_t(2) . ''; - $head .= PHP_EOL . $this->_t(3) . ""; - $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . Indent::_(2) . ""; } // add the defaults @@ -14573,15 +14439,15 @@ class Interpretation extends Fields $data_type = (2 == $this->footableVersion) ? 'data-type="numeric"' : 'data-type="number"'; - $head .= PHP_EOL . $this->_t(2) . ''; - $head .= PHP_EOL . $this->_t(3) . ""; - $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . Indent::_(2) . ""; } - $head .= PHP_EOL . $this->_t(1) . ""; + $head .= PHP_EOL . Indent::_(1) . ""; $head .= PHP_EOL . ""; return $head; @@ -14619,44 +14485,44 @@ class Interpretation extends Fields { $addCategory = false; } - $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $query .= PHP_EOL . $this->_t(1) . " * Method to get list data."; - $query .= PHP_EOL . $this->_t(1) . " *"; - $query .= PHP_EOL . $this->_t(1) + $query = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $query .= PHP_EOL . Indent::_(1) . " * Method to get list data."; + $query .= PHP_EOL . Indent::_(1) . " *"; + $query .= PHP_EOL . Indent::_(1) . " * @return mixed An array of data items on success, false on failure."; - $query .= PHP_EOL . $this->_t(1) . " */"; - $query .= PHP_EOL . $this->_t(1) . "public function get" . $functionName + $query .= PHP_EOL . Indent::_(1) . " */"; + $query .= PHP_EOL . Indent::_(1) . "public function get" . $functionName . "()"; - $query .= PHP_EOL . $this->_t(1) . "{"; + $query .= PHP_EOL . Indent::_(1) . "{"; // setup the query - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get the user object."; - $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();"; + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Create a new query object."; - $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();"; - $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDBO();"; + $query .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Select some fields"; - $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');"; + $query .= PHP_EOL . Indent::_(2) . "\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " From the " . $this->componentCodeName . "_" . $nameSingleCode . " table"; - $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" + $query .= PHP_EOL . Indent::_(2) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $nameSingleCode . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; @@ -14678,28 +14544,28 @@ class Interpretation extends Fields && strpos($parentKey, '-A>') === false && strpos($parentKey, '-OR>') === false) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by " . $globalKey . " global."; - $query .= PHP_EOL . $this->_t(2) . "\$" . $globalKey . " = \$this->" + $query .= PHP_EOL . Indent::_(2) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" . $globalKey + $query .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$" . $globalKey . " ))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $key . " = ' . (int) \$" . $globalKey . " );"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "elseif (is_string(\$" . $globalKey . "))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $key . " = ' . \$db->quote(\$" . $globalKey . "));"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "else"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "else"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $key . " = -5');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } elseif (strpos($parentKey, '-OR>') !== false || strpos($key, '-OR>') !== false) @@ -14730,30 +14596,30 @@ class Interpretation extends Fields $ORquery['s'][] = "a." . $ORkey . " = ' . \$db->quote(\$" . $_globalKey . ")"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Filter by " . $_globalKey + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Filter by " . $_globalKey . " global."; - $query .= PHP_EOL . $this->_t(2) . "\$" . $_globalKey + $query .= PHP_EOL . Indent::_(2) . "\$" . $_globalKey . " = \$this->" . $_globalKey . ";"; - $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" + $query .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$" . $_globalKey . " ))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode( + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('" . implode( " . ' OR ", $ORquery['i'] ) . ", ' OR');"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "elseif (is_string(\$" . $_globalKey . "))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode( + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('" . implode( " . ' OR ", $ORquery['s'] ) . ", ' OR');"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "else"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $ORkey + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "else"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $ORkey . " = -5');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } } if (isset($this->accessBuilder[$nameSingleCode]) @@ -14761,58 +14627,57 @@ class Interpretation extends Fields $this->accessBuilder[$nameSingleCode] )) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Join over the asset groups."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; // check if the access field was over ridden if (!isset($this->fieldsNames[$nameSingleCode]['access'])) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; // load the access filter query code - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by access level."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$_access = \$this->getState('filter.access');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "if (\$_access && is_numeric(\$_access))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a.access = ' . (int) \$_access);"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (" + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "elseif (" . $Helper . "::checkArray(\$_access))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Secure the array for the query"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$_access = ArrayHelper::toInteger(\$_access);"; - $query .= PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Filter by the Access Array."; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Filter by the Access Array."; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a.access IN (' . implode(',', \$_access) . ')');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } // TODO the following will fight against the above access filter - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Implement View Level Access"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } // add dynamic ordering (Linked view) if (isset($this->viewsDefaultOrdering[$nameListCode]) @@ -14831,11 +14696,11 @@ class Interpretation extends Fields )) !== false) { // default ordering is by publish and ordering - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Order the results by ordering"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->order('" . $order_field_name . " " . $order_field['direction'] . "');"; @@ -14845,33 +14710,33 @@ class Interpretation extends Fields else { // default ordering is by publish and ordering - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Order the results by ordering"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->order('a.published ASC');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->order('a.ordering ASC');"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Load the items"; - $query .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; - $query .= PHP_EOL . $this->_t(2) . "\$db->execute();"; - $query .= PHP_EOL . $this->_t(2) . "if (\$db->getNumRows())"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$items = \$db->loadObjectList();"; + $query .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);"; + $query .= PHP_EOL . Indent::_(2) . "\$db->execute();"; + $query .= PHP_EOL . Indent::_(2) . "if (\$db->getNumRows())"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$items = \$db->loadObjectList();"; // add the fixing strings method $query .= $this->setGetItemsMethodStringFix( $nameSingleCode, $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], - $this->_t(1) + $this->fileContentStatic[Placefix::_h('Component')], + Indent::_(1) ); // add translations $query .= $this->setSelectionTranslationFix( $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], - $this->_t(1) + $this->fileContentStatic[Placefix::_h('Component')], + Indent::_(1) ); // filter by child repetable field values if (StringHelper::check($globalKey) && $key @@ -14881,44 +14746,41 @@ class Interpretation extends Fields && strpos($key, '-A>') === false) { list($field, $target) = explode('-R>', $key); - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by " . $globalKey . " in this Repetable Field"; - $query .= PHP_EOL . $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$items) && isset(\$this->" + $query .= PHP_EOL . Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$this->" . $globalKey . "))"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "foreach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL . $this->_t(4) . "{"; - $query .= PHP_EOL . $this->_t(5) . "if (isset(\$item->" . $field - . ") && " . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkJson(\$item->" . $field . "))"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) + $query .= PHP_EOL . Indent::_(4) . "{"; + $query .= PHP_EOL . Indent::_(5) . "if (isset(\$item->" . $field + . ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $field . "))"; + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "\$tmpArray = json_decode(\$item->" . $field . ",true);"; - $query .= PHP_EOL . $this->_t(6) . "if (!isset(\$tmpArray['" - . $target . "']) || !" . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] . "Helper::checkArray(\$tmpArray['" + $query .= PHP_EOL . Indent::_(6) . "if (!isset(\$tmpArray['" + . $target . "']) || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$tmpArray['" . $target . "']) || !in_array(\$this->" . $globalKey . ", \$tmpArray['" . $target . "']))"; - $query .= PHP_EOL . $this->_t(6) . "{"; - $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(7) . "continue;"; - $query .= PHP_EOL . $this->_t(6) . "}"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "else"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(6) . "continue;"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(4) . "}"; - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "else"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "return false;"; - $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . Indent::_(6) . "{"; + $query .= PHP_EOL . Indent::_(7) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(7) . "continue;"; + $query .= PHP_EOL . Indent::_(6) . "}"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(5) . "else"; + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(6) . "continue;"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(4) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "else"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "return false;"; + $query .= PHP_EOL . Indent::_(3) . "}"; } // filter by child array field values if (StringHelper::check($globalKey) && $key @@ -14927,71 +14789,66 @@ class Interpretation extends Fields ) === false && strpos($key, '-A>') !== false) { - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by " . $globalKey . " Array Field"; - $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" + $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$items) && \$" . $globalKey + $query .= PHP_EOL . Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && \$" . $globalKey . ")"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "foreach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL . $this->_t(4) . "{"; + $query .= PHP_EOL . Indent::_(4) . "{"; list($bin, $target) = explode('-A>', $key); if (StringHelper::check($target)) { - $query .= PHP_EOL . $this->_t(5) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkJson(\$item->" . $target + $query .= PHP_EOL . Indent::_(5) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $target . "))"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "\$item->" . $target + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "\$item->" . $target . " = json_decode(\$item->" . $target . ", true);"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" - . $target . ") || !" . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->" + . $target . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->" . $target . "))"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(6) . "continue;"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(6) . "continue;"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(5) . "if (!in_array(\$" . $globalKey . ",\$item->" . $target . "))"; } else { - $query .= PHP_EOL . $this->_t(5) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkJson(\$item->" . $_key . "))"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "\$item->" . $_key + $query .= PHP_EOL . Indent::_(5) . "if (" + . $this->fileContentStatic[Placefix::_h('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 . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" - . $_key . ") || !" . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->" + . $_key . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->" . $_key . "))"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(6) . "continue;"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(6) . "continue;"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(5) . "if (!in_array(\$" . $globalKey . ",\$item->" . $_key . "))"; } - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(6) . "continue;"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(4) . "}"; - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "else"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "return false;"; - $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(6) . "continue;"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(4) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "else"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "return false;"; + $query .= PHP_EOL . Indent::_(3) . "}"; } // filter by parent repetable field values if (StringHelper::check($globalKey) && $key @@ -15001,45 +14858,42 @@ class Interpretation extends Fields && strpos($parentKey, '-A>') === false) { list($bin, $target) = explode('-R>', $parentKey); - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by " . $_key . " Repetable Field"; - $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey + $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = json_decode(\$this->" . $globalKey . ",true);"; - $query .= PHP_EOL . $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$items) && isset(\$" - . $globalKey . ") && " . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] . "Helper::checkArray(\$" + $query .= PHP_EOL . Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$" + . $globalKey . ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "))"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "foreach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL . $this->_t(4) . "{"; - $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key + $query .= PHP_EOL . Indent::_(4) . "{"; + $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key . " && isset(\$" . $globalKey . "['" . $target . "']) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; - $query .= PHP_EOL . $this->_t(6) . "{"; - $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(7) . "continue;"; - $query .= PHP_EOL . $this->_t(6) . "}"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "else"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(6) . "continue;"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(4) . "}"; - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "else"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "return false;"; - $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . Indent::_(6) . "{"; + $query .= PHP_EOL . Indent::_(7) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(7) . "continue;"; + $query .= PHP_EOL . Indent::_(6) . "}"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(5) . "else"; + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(6) . "continue;"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(4) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "else"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "return false;"; + $query .= PHP_EOL . Indent::_(3) . "}"; } // filter by parent array field values if (StringHelper::check($globalKey) && $key @@ -15048,69 +14902,66 @@ class Interpretation extends Fields ) === false && strpos($parentKey, '-A>') !== false) { - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by " . $globalKey . " Array Field"; - $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" + $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$items) && " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && " + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "foreach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL . $this->_t(4) . "{"; + $query .= PHP_EOL . Indent::_(4) . "{"; list($bin, $target) = explode('-A>', $parentKey); if (StringHelper::check($target)) { - $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key - . " && " . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" + $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key + . " && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; } else { - $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . ")"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" + $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key . ")"; + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "))"; } - $query .= PHP_EOL . $this->_t(6) . "{"; - $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(7) . "continue;"; - $query .= PHP_EOL . $this->_t(6) . "}"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "else"; - $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; - $query .= PHP_EOL . $this->_t(6) . "continue;"; - $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(4) . "}"; - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "else"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "return false;"; - $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . Indent::_(6) . "{"; + $query .= PHP_EOL . Indent::_(7) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(7) . "continue;"; + $query .= PHP_EOL . Indent::_(6) . "}"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(5) . "else"; + $query .= PHP_EOL . Indent::_(5) . "{"; + $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . Indent::_(6) . "continue;"; + $query .= PHP_EOL . Indent::_(5) . "}"; + $query .= PHP_EOL . Indent::_(4) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "else"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "return false;"; + $query .= PHP_EOL . Indent::_(3) . "}"; } // add custom php to getitems method after all $query .= $this->getCustomScriptBuilder( 'php_getitems_after_all', $nameSingleCode, - PHP_EOL . PHP_EOL . $this->_t(1) + PHP_EOL . PHP_EOL . Indent::_(1) ); - $query .= PHP_EOL . $this->_t(3) . "return \$items;"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "return false;"; - $query .= PHP_EOL . $this->_t(1) . "}"; + $query .= PHP_EOL . Indent::_(3) . "return \$items;"; + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "return false;"; + $query .= PHP_EOL . Indent::_(1) . "}"; // SELECTIONTRANSLATIONFIXFUNC<<>> $query .= $this->setSelectionTranslationFixFunc( $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] + $this->fileContentStatic[Placefix::_h('Component')] ); // fixe mothod name clash @@ -15143,24 +14994,24 @@ class Interpretation extends Fields { // Load to lang $keyLang = $this->langPrefix . '_' . $custom_button['NAME']; - $this->setLangContent( - $this->lang, $keyLang, StringHelper::safe( + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $keyLang, StringHelper::safe( $custom_button['name'], 'Ww' ) ); // add cpanel button - $buttons[] = $this->_t(2) . "if (\$this->canDo->get('" + $buttons[] = Indent::_(2) . "if (\$this->canDo->get('" . $custom_button['link'] . ".access'))"; - $buttons[] = $this->_t(2) . "{"; - $buttons[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $buttons[] = Indent::_(2) . "{"; + $buttons[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " add " . $custom_button['name'] . " button."; - $buttons[] = $this->_t(3) . "JToolBarHelper::custom('" + $buttons[] = Indent::_(3) . "JToolBarHelper::custom('" . $nameListCode . ".redirectTo" . StringHelper::safe( $custom_button['link'], 'F' ) . "', '" . $custom_button['icon'] . "', '', '" . $keyLang . "', true);"; - $buttons[] = $this->_t(2) . "}"; + $buttons[] = Indent::_(2) . "}"; } if (ArrayHelper::check($buttons)) { @@ -15191,59 +15042,59 @@ class Interpretation extends Fields ) { // add the custom redirect method - $method[] = PHP_EOL . PHP_EOL . $this->_t(1) + $method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "public function redirectTo" . StringHelper::safe( $custom_button['link'], 'F' ) . "()"; - $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(1) . "{"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check for request forgeries"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if export is allowed for this user."; - $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $method[] = $this->_t(2) . "if (\$user->authorise('" + $method[] = Indent::_(2) . "\$user = JFactory::getUser();"; + $method[] = Indent::_(2) . "if (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->componentCodeName . "'))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get the input"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$input = JFactory::getApplication()->input;"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Sanitize the input"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$pks = ArrayHelper::toInteger(\$pks);"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " convert to string"; - $method[] = $this->_t(3) . "\$ids = implode('_', \$pks);"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$ids = implode('_', \$pks);"; + $method[] = Indent::_(3) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));"; - $method[] = $this->_t(3) . "return;"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "return;"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Redirect to the list screen with error."; - $method[] = $this->_t(2) . "\$message = JText:" . ":_('" + $method[] = Indent::_(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $nameListCode . "', false), \$message, 'error');"; - $method[] = $this->_t(2) . "return;"; - $method[] = $this->_t(1) . "}"; + $method[] = Indent::_(2) . "return;"; + $method[] = Indent::_(1) . "}"; // add to lang array $lankey = $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED"; - $this->setLangContent( - $this->lang, $lankey, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lankey, 'Access to ' . $custom_button['link'] . ' was denied.' ); } @@ -15279,109 +15130,107 @@ class Interpretation extends Fields && $this->eximportView[$nameListCode]) || !$isExport) { - $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $query .= PHP_EOL . $this->_t(1) . " * " . $config['docDesc']; - $query .= PHP_EOL . $this->_t(1) . " *"; - $query .= PHP_EOL . $this->_t(1) + $query = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $query .= PHP_EOL . Indent::_(1) . " * " . $config['docDesc']; + $query .= PHP_EOL . Indent::_(1) . " *"; + $query .= PHP_EOL . Indent::_(1) . " * @param array \$pks The ids of the items to get"; - $query .= PHP_EOL . $this->_t(1) + $query .= PHP_EOL . Indent::_(1) . " * @param JUser \$user The user making the request"; - $query .= PHP_EOL . $this->_t(1) . " *"; - $query .= PHP_EOL . $this->_t(1) + $query .= PHP_EOL . Indent::_(1) . " *"; + $query .= PHP_EOL . Indent::_(1) . " * @return mixed An array of data items on success, false on failure."; - $query .= PHP_EOL . $this->_t(1) . " */"; - $query .= PHP_EOL . $this->_t(1) . "public function " + $query .= PHP_EOL . Indent::_(1) . " */"; + $query .= PHP_EOL . Indent::_(1) . "public function " . $config['functionName'] . "(\$pks, \$user = null)"; - $query .= PHP_EOL . $this->_t(1) . "{"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(1) . "{"; + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " setup the query"; - $query .= PHP_EOL . $this->_t(2) . "if ((\$pks_size = " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + $query .= PHP_EOL . Indent::_(2) . "if ((\$pks_size = " + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$pks)) !== false || 'bulk' === \$pks)"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set a value to know this is " . $config['type'] . " method. (USE IN CUSTOM CODE TO ALTER OUTCOME)"; - $query .= PHP_EOL . $this->_t(3) . "\$_" . $config['type'] + $query .= PHP_EOL . Indent::_(3) . "\$_" . $config['type'] . " = true;"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get the user object if not set."; - $query .= PHP_EOL . $this->_t(3) . "if (!isset(\$user) || !" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkObject(\$user))"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "\$user = JFactory::getUser();"; - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(3) . "if (!isset(\$user) || !" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$user))"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "\$user = JFactory::getUser();"; + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Create a new query object."; - $query .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDBO();"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$db = JFactory::getDBO();"; + $query .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Select some fields"; - $query .= PHP_EOL . $this->_t(3) . "\$query->select('a.*');"; - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(3) . "\$query->select('a.*');"; + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " From the " . $this->componentCodeName . "_" . $nameSingleCode . " table"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $nameSingleCode . "', 'a'));"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The bulk export path"; - $query .= PHP_EOL . $this->_t(3) . "if ('bulk' === \$pks)"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "if ('bulk' === \$pks)"; + $query .= PHP_EOL . Indent::_(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(4) . "\$query->where('a.id > 0');"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " A large array of ID's will not work out well"; - $query .= PHP_EOL . $this->_t(3) . "elseif (\$pks_size > 500)"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "elseif (\$pks_size > 500)"; + $query .= PHP_EOL . Indent::_(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Use lowest ID"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(4) . "\$query->where('a.id >= ' . (int) min(\$pks));"; - $query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Use highest ID"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(4) . "\$query->where('a.id <= ' . (int) max(\$pks));"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The normal default path"; - $query .= PHP_EOL . $this->_t(3) . "else"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "else"; + $query .= PHP_EOL . Indent::_(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(4) . "\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "}"; // add custom filtering php $query .= $this->getCustomScriptBuilder( 'php_getlistquery', $nameSingleCode, - PHP_EOL . PHP_EOL . $this->_t(1) + PHP_EOL . PHP_EOL . Indent::_(1) ); // first check if we export of text only is avalable if ($this->exportTextOnly) { // add switch - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get global switch to activate text only export"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$export_text_only = JComponentHelper::getParams('com_" . $this->componentCodeName . "')->get('export_text_only', 0);"; // first check if we have custom queries $custom_query = $this->setCustomQuery( - $nameListCode, $nameSingleCode, $this->_t(2), true + $nameListCode, $nameSingleCode, Indent::_(2), true ); } // if values were returned add the area @@ -15390,14 +15239,14 @@ class Interpretation extends Fields $custom_query )) { - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add these queries only if text only is required"; - $query .= PHP_EOL . $this->_t(3) . "if (\$export_text_only)"; - $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . Indent::_(3) . "if (\$export_text_only)"; + $query .= PHP_EOL . Indent::_(3) . "{"; // add the custom fields query $query .= $custom_query; - $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; } // add access levels if the view has access set if (isset($this->accessBuilder[$nameSingleCode]) @@ -15405,18 +15254,18 @@ class Interpretation extends Fields $this->accessBuilder[$nameSingleCode] )) { - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Implement View Level Access"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(4) . "\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; } // add dynamic ordering (Exported data) if (isset($this->viewsDefaultOrdering[$nameListCode]) @@ -15432,11 +15281,11 @@ class Interpretation extends Fields $nameListCode, $order_field['field'] )) !== false) { - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Order the results by ordering"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$query->order('" . $order_field_name . " " . $order_field['direction'] . "');"; @@ -15445,68 +15294,67 @@ class Interpretation extends Fields } else { - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" - . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Order the results by ordering"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$query->order('a.ordering ASC');"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Load the items"; - $query .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; - $query .= PHP_EOL . $this->_t(3) . "\$db->execute();"; - $query .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);"; + $query .= PHP_EOL . Indent::_(3) . "\$db->execute();"; + $query .= PHP_EOL . Indent::_(3) . "if (\$db->getNumRows())"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "\$items = \$db->loadObjectList();"; // set the string fixing code $query .= $this->setGetItemsMethodStringFix( $nameSingleCode, $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], - $this->_t(2), $isExport, true + $this->fileContentStatic[Placefix::_h('Component')], + Indent::_(2), $isExport, true ); // first check if we export of text only is avalable if ($this->exportTextOnly) { $query_translations = $this->setSelectionTranslationFix( $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh], $this->_t(3) + $this->fileContentStatic[Placefix::_h('Component')], Indent::_(3) ); } // add translations if (isset($query_translations) && StringHelper::check($query_translations)) { - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add these translation only if text only is required"; - $query .= PHP_EOL . $this->_t(3) . "if (\$export_text_only)"; - $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . Indent::_(3) . "if (\$export_text_only)"; + $query .= PHP_EOL . Indent::_(3) . "{"; $query .= $query_translations; - $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; } // add custom php to getItems method after all $query .= $this->getCustomScriptBuilder( 'php_getitems_after_all', $nameSingleCode, - PHP_EOL . PHP_EOL . $this->_t(2) + PHP_EOL . PHP_EOL . Indent::_(2) ); // in privacy export we must return array of arrays if ('privacy' === $config['type']) { - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(4) . "return json_decode(json_encode(\$items), true);"; } else { - $query .= PHP_EOL . $this->_t(4) . "return \$items;"; + $query .= PHP_EOL . Indent::_(4) . "return \$items;"; } - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "return false;"; - $query .= PHP_EOL . $this->_t(1) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "return false;"; + $query .= PHP_EOL . Indent::_(1) . "}"; // get the header script if ($isExport) { @@ -15517,7 +15365,7 @@ class Interpretation extends Fields 'php_import_headers', 'import_' . $nameListCode, PHP_EOL . PHP_EOL, null, true, // set a default script for those with no custom script - PHP_EOL . PHP_EOL . $this->setPlaceholders( + PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $header, $this->placeholders ) ); @@ -15538,150 +15386,147 @@ class Interpretation extends Fields $method = array(); // add the export method - $method[] = PHP_EOL . PHP_EOL . $this->_t(1) + $method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "public function exportData()"; - $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(1) . "{"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check for request forgeries"; - $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" + $method[] = Indent::_(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if export is allowed for this user."; - $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $method[] = $this->_t(2) . "if (\$user->authorise('" + $method[] = Indent::_(2) . "\$user = JFactory::getUser();"; + $method[] = Indent::_(2) . "if (\$user->authorise('" . $nameSingleCode . ".export', 'com_" . $this->componentCodeName . "') && \$user->authorise('core.export', 'com_" . $this->componentCodeName . "'))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get the input"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$input = JFactory::getApplication()->input;"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Sanitize the input"; - $method[] = $this->_t(3) . "\$pks = ArrayHelper::toInteger(\$pks);"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "\$pks = ArrayHelper::toInteger(\$pks);"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get the model"; - $method[] = $this->_t(3) . "\$model = \$this->getModel('" + $method[] = Indent::_(3) . "\$model = \$this->getModel('" . StringHelper::safe($nameListCode, 'F') . "');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get the data to export"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$data = \$model->getExportData(\$pks);"; - $method[] = $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkArray(\$data))"; - $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$data))"; + $method[] = Indent::_(3) . "{"; + $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " now set the data to the spreadsheet"; - $method[] = $this->_t(4) . "\$date = JFactory::getDate();"; - $method[] = $this->_t(4) . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] . "Helper::xls(\$data,'" + $method[] = Indent::_(4) . "\$date = JFactory::getDate();"; + $method[] = Indent::_(4) . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::xls(\$data,'" . StringHelper::safe($nameListCode, 'F') . "_'.\$date->format('jS_F_Y'),'" . StringHelper::safe($nameListCode, 'Ww') . " exported ('.\$date->format('jS F, Y').')','" . StringHelper::safe($nameListCode, 'w') . "');"; - $method[] = $this->_t(3) . "}"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "}"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Redirect to the list screen with error."; - $method[] = $this->_t(2) . "\$message = JText:" . ":_('" + $method[] = Indent::_(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_EXPORT_FAILED');"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $nameListCode . "', false), \$message, 'error');"; - $method[] = $this->_t(2) . "return;"; - $method[] = $this->_t(1) . "}"; + $method[] = Indent::_(2) . "return;"; + $method[] = Indent::_(1) . "}"; // add the import method - $method[] = PHP_EOL . PHP_EOL . $this->_t(1) + $method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "public function importData()"; - $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(1) . "{"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check for request forgeries"; - $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" + $method[] = Indent::_(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if import is allowed for this user."; - $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $method[] = $this->_t(2) . "if (\$user->authorise('" + $method[] = Indent::_(2) . "\$user = JFactory::getUser();"; + $method[] = Indent::_(2) . "if (\$user->authorise('" . $nameSingleCode . ".import', 'com_" . $this->componentCodeName . "') && \$user->authorise('core.import', 'com_" . $this->componentCodeName . "'))"; - $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(2) . "{"; + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get the import model"; - $method[] = $this->_t(3) . "\$model = \$this->getModel('" + $method[] = Indent::_(3) . "\$model = \$this->getModel('" . StringHelper::safe($nameListCode, 'F') . "');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get the headers to import"; - $method[] = $this->_t(3) + $method[] = Indent::_(3) . "\$headers = \$model->getExImPortHeaders();"; - $method[] = $this->_t(3) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkObject(\$headers))"; - $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(3) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$headers))"; + $method[] = Indent::_(3) . "{"; + $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Load headers to session."; - $method[] = $this->_t(4) . "\$session = JFactory::getSession();"; - $method[] = $this->_t(4) . "\$headers = json_encode(\$headers);"; - $method[] = $this->_t(4) . "\$session->set('" . $nameSingleCode + $method[] = Indent::_(4) . "\$session = JFactory::getSession();"; + $method[] = Indent::_(4) . "\$headers = json_encode(\$headers);"; + $method[] = Indent::_(4) . "\$session->set('" . $nameSingleCode . "_VDM_IMPORTHEADERS', \$headers);"; - $method[] = $this->_t(4) . "\$session->set('backto_VDM_IMPORT', '" + $method[] = Indent::_(4) . "\$session->set('backto_VDM_IMPORT', '" . $nameListCode . "');"; - $method[] = $this->_t(4) + $method[] = Indent::_(4) . "\$session->set('dataType_VDM_IMPORTINTO', '" . $nameSingleCode . "');"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Redirect to import view."; // add to lang array $selectImportFileNote = $this->langPrefix . "_IMPORT_SELECT_FILE_FOR_" . StringHelper::safe($nameListCode, 'U'); - $this->setLangContent( - $this->lang, $selectImportFileNote, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $selectImportFileNote, 'Select the file to import data to ' . $nameListCode . '.' ); - $method[] = $this->_t(4) . "\$message = JText:" . ":_('" + $method[] = Indent::_(4) . "\$message = JText:" . ":_('" . $selectImportFileNote . "');"; // if this view has custom script it must have as custom import (model, veiw, controller) if (isset($this->importCustomScripts[$nameListCode]) && $this->importCustomScripts[$nameListCode]) { - $method[] = $this->_t(4) + $method[] = Indent::_(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=import_" . $nameListCode . "', false), \$message);"; } else { - $method[] = $this->_t(4) + $method[] = Indent::_(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=import', false), \$message);"; } - $method[] = $this->_t(4) . "return;"; - $method[] = $this->_t(3) . "}"; - $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $method[] = Indent::_(4) . "return;"; + $method[] = Indent::_(3) . "}"; + $method[] = Indent::_(2) . "}"; + $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Redirect to the list screen with error."; - $method[] = $this->_t(2) . "\$message = JText:" . ":_('" + $method[] = Indent::_(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_IMPORT_FAILED');"; - $method[] = $this->_t(2) + $method[] = Indent::_(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $nameListCode . "', false), \$message, 'error');"; - $method[] = $this->_t(2) . "return;"; - $method[] = $this->_t(1) . "}"; + $method[] = Indent::_(2) . "return;"; + $method[] = Indent::_(1) . "}"; return implode(PHP_EOL, $method); } @@ -15699,16 +15544,16 @@ class Interpretation extends Fields $langExport = $this->langPrefix . '_' . StringHelper::safe('Export Data', 'U'); // add to lang array - $this->setLangContent($this->lang, $langExport, 'Export Data'); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langExport, 'Export Data'); $button = array(); - $button[] = PHP_EOL . PHP_EOL . $this->_t(3) + $button[] = PHP_EOL . PHP_EOL . Indent::_(3) . "if (\$this->canDo->get('core.export') && \$this->canDo->get('" . $nameSingleCode . ".export'))"; - $button[] = $this->_t(3) . "{"; - $button[] = $this->_t(4) . "JToolBarHelper::custom('" + $button[] = Indent::_(3) . "{"; + $button[] = Indent::_(4) . "JToolBarHelper::custom('" . $nameListCode . ".exportData', 'download', '', '" . $langExport . "', true);"; - $button[] = $this->_t(3) . "}"; + $button[] = Indent::_(3) . "}"; return implode(PHP_EOL, $button); } @@ -15726,17 +15571,17 @@ class Interpretation extends Fields $langImport = $this->langPrefix . '_' . StringHelper::safe('Import Data', 'U'); // add to lang array - $this->setLangContent($this->lang, $langImport, 'Import Data'); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langImport, 'Import Data'); $button = array(); - $button[] = PHP_EOL . PHP_EOL . $this->_t(2) + $button[] = PHP_EOL . PHP_EOL . Indent::_(2) . "if (\$this->canDo->get('core.import') && \$this->canDo->get('" . $nameSingleCode . ".import'))"; - $button[] = $this->_t(2) . "{"; - $button[] = $this->_t(3) . "JToolBarHelper::custom('" + $button[] = Indent::_(2) . "{"; + $button[] = Indent::_(3) . "JToolBarHelper::custom('" . $nameListCode . ".importData', 'upload', '', '" . $langImport . "', false);"; - $button[] = $this->_t(2) . "}"; + $button[] = Indent::_(2) . "}"; return implode(PHP_EOL, $button); } @@ -15751,46 +15596,40 @@ class Interpretation extends Fields $this->buildDynamique($target, 'customimport'); // load the custom script to the files // IMPORT_EXT_METHOD <<>> - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'IMPORT_EXT_METHOD' . $this->hhh] + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_EXT_METHOD')] = $this->getCustomScriptBuilder( 'php_import_ext', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_DISPLAY_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'IMPORT_DISPLAY_METHOD_CUSTOM' . $this->hhh] + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DISPLAY_METHOD_CUSTOM')] = $this->getCustomScriptBuilder( 'php_import_display', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_SETDATA_METHOD <<>> - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'IMPORT_SETDATA_METHOD' . $this->hhh] + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SETDATA_METHOD')] = $this->getCustomScriptBuilder( 'php_import_setdata', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'IMPORT_METHOD_CUSTOM' . $this->hhh] + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_METHOD_CUSTOM')] = $this->getCustomScriptBuilder( 'php_import', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_SAVE_METHOD <<>> - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'IMPORT_SAVE_METHOD' . $this->hhh] + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SAVE_METHOD')] = $this->getCustomScriptBuilder( 'php_import_save', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_DEFAULT_VIEW_CUSTOM <<>> - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'IMPORT_DEFAULT_VIEW_CUSTOM' . $this->hhh] + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DEFAULT_VIEW_CUSTOM')] = $this->getCustomScriptBuilder( 'html_import_view', 'import_' . $nameListCode, PHP_EOL, null, @@ -15798,30 +15637,18 @@ class Interpretation extends Fields ); // insure we have the view placeholders setup - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'VIEW' . $this->hhh] - = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' - . $this->hhh]; - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'View' . $this->hhh] - = 'Import_' . $this->placeholders[$this->hhh . 'views' - . $this->hhh]; - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'view' . $this->hhh] - = 'import_' . $this->placeholders[$this->hhh . 'views' - . $this->hhh]; - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'VIEWS' . $this->hhh] - = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' - . $this->hhh]; - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'Views' . $this->hhh] - = 'Import_' . $this->placeholders[$this->hhh . 'views' - . $this->hhh]; - $this->fileContentDynamic['import_' . $nameListCode][$this->hhh - . 'views' . $this->hhh] - = 'import_' . $this->placeholders[$this->hhh . 'views' - . $this->hhh]; + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('VIEW')] + = 'IMPORT_' . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]; + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('View')] + = 'Import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('view')] + = 'import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('VIEWS')] + = 'IMPORT_' . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]; + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('Views')] + = 'Import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; + $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('views')] + = 'import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')]; } public function setListQuery(&$nameSingleCode, &$nameListCode) @@ -15843,31 +15670,31 @@ class Interpretation extends Fields $addCategoryFilter = 0; } // setup the query - $query = "//" . $this->setLine(__LINE__) . " Get the user object."; - $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $query = "//" . Line::_(__Line__, __Class__) . " Get the user object."; + $query .= PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();"; + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Create a new query object."; - $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();"; - $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDBO();"; + $query .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Select some fields"; - $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');"; + $query .= PHP_EOL . Indent::_(2) . "\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " From the " . $this->componentCodeName . "_item table"; - $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" + $query .= PHP_EOL . Indent::_(2) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $nameSingleCode . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; @@ -15878,78 +15705,77 @@ class Interpretation extends Fields ); // add the custom fields query $query .= $this->setCustomQuery($nameListCode, $nameSingleCode); - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by published state"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$published = \$this->getState('filter.published');"; - $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$published))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$published))"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a.published = ' . (int) \$published);"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (\$published === '')"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "elseif (\$published === '')"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('(a.published = 0 OR a.published = 1)');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; if (isset($this->accessBuilder[$nameSingleCode]) && StringHelper::check( $this->accessBuilder[$nameSingleCode] )) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Join over the asset groups."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; // check if the access field was over ridden if (!isset($this->fieldsNames[$nameSingleCode]['access'])) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; // load the access filter query code - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by access level."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$_access = \$this->getState('filter.access');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "if (\$_access && is_numeric(\$_access))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a.access = ' . (int) \$_access);"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (" + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "elseif (" . $Helper . "::checkArray(\$_access))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Secure the array for the query"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$_access = ArrayHelper::toInteger(\$_access);"; - $query .= PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Filter by the Access Array."; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Filter by the Access Array."; + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a.access IN (' . implode(',', \$_access) . ')');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } // TODO the following will fight against the above access filter - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Implement View Level Access"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } // set the search query $query .= $this->setSearchQuery($nameListCode); @@ -15958,38 +15784,38 @@ class Interpretation extends Fields // add the category if ($addCategory && $addCategoryFilter >= 1) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Filter by a single or group of categories."; - $query .= PHP_EOL . $this->_t(2) . "\$baselevel = 1;"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$baselevel = 1;"; + $query .= PHP_EOL . Indent::_(2) . "\$categoryId = \$this->getState('filter.category_id');"; $query .= PHP_EOL; - $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$categoryId))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$categoryId))"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$cat_tbl = JTable::getInstance('Category', 'JTable');"; - $query .= PHP_EOL . $this->_t(3) . "\$cat_tbl->load(\$categoryId);"; - $query .= PHP_EOL . $this->_t(3) . "\$rgt = \$cat_tbl->rgt;"; - $query .= PHP_EOL . $this->_t(3) . "\$lft = \$cat_tbl->lft;"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$cat_tbl->load(\$categoryId);"; + $query .= PHP_EOL . Indent::_(3) . "\$rgt = \$cat_tbl->rgt;"; + $query .= PHP_EOL . Indent::_(3) . "\$lft = \$cat_tbl->lft;"; + $query .= PHP_EOL . Indent::_(3) . "\$baselevel = (int) \$cat_tbl->level;"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$query->where('c.lft >= ' . (int) \$lft)"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(4) . "->where('c.rgt <= ' . (int) \$rgt);"; - $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "elseif (is_array(\$categoryId))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$categoryId = ArrayHelper::toInteger(\$categoryId);"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$categoryId = implode(',', \$categoryId);"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $categoryCodeName . " IN (' . \$categoryId . ')');"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; $query .= PHP_EOL; } // setup values for the view ordering @@ -16013,30 +15839,30 @@ class Interpretation extends Fields { // just the first field is based on state $order_first = false; - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Add the list ordering clause."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$orderCol = \$this->state->get('list.ordering', '" . $order_field_name . "');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$orderDirn = \$this->state->get('list.direction', '" . $order_field['direction'] . "');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "if (\$orderCol != '')"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } else { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Add a permanent list ordering."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$query->order(\$db->escape('" . $order_field_name . " " . $order_field['direction'] . "'));"; @@ -16046,21 +15872,21 @@ class Interpretation extends Fields } else { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Add the list ordering clause."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$orderCol = \$this->state->get('list.ordering', 'a.id');"; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$orderDirn = \$this->state->get('list.direction', 'desc');"; - $query .= PHP_EOL . $this->_t(2) . "if (\$orderCol != '')"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "if (\$orderCol != '')"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; } $query .= PHP_EOL; - $query .= PHP_EOL . $this->_t(2) . "return \$query;"; + $query .= PHP_EOL . Indent::_(2) . "return \$query;"; return $query; } @@ -16100,26 +15926,26 @@ class Interpretation extends Fields } $search .= ")'"; // now setup query - $query = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $query = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Filter by search."; - $query .= PHP_EOL . $this->_t(2) + $query .= PHP_EOL . Indent::_(2) . "\$search = \$this->getState('filter.search');"; - $query .= PHP_EOL . $this->_t(2) . "if (!empty(\$search))"; - $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) + $query .= PHP_EOL . Indent::_(2) . "if (!empty(\$search))"; + $query .= PHP_EOL . Indent::_(2) . "{"; + $query .= PHP_EOL . Indent::_(3) . "if (stripos(\$search, 'id:') === 0)"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "\$query->where('a.id = ' . (int) substr(\$search, 3));"; - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "else"; - $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(3) . "else"; + $query .= PHP_EOL . Indent::_(3) . "{"; + $query .= PHP_EOL . Indent::_(4) . "\$search = \$db->quote('%' . \$db->escape(\$search) . '%');"; - $query .= PHP_EOL . $this->_t(4) . "\$query->where(" . $search + $query .= PHP_EOL . Indent::_(4) . "\$query->where(" . $search . ");"; - $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . Indent::_(3) . "}"; + $query .= PHP_EOL . Indent::_(2) . "}"; $query .= PHP_EOL; return $query; @@ -16161,8 +15987,8 @@ class Interpretation extends Fields ) && $filter['method'] == 0)) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . $tab . "//" - . $this->setLine(__LINE__) . " From the " + $query .= PHP_EOL . PHP_EOL . Indent::_(2) . $tab . "//" + . Line::_(__Line__, __Class__) . " From the " . StringHelper::safe( StringHelper::safe( $filter['custom']['table'], 'w' @@ -16175,7 +16001,7 @@ class Interpretation extends Fields // we want to at times just have the words and not the ids as well if ($just_text) { - $query .= PHP_EOL . $this->_t(2) . $tab + $query .= PHP_EOL . Indent::_(2) . $tab . "\$query->select(\$db->quoteName(['" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" @@ -16185,7 +16011,7 @@ class Interpretation extends Fields } else { - $query .= PHP_EOL . $this->_t(2) . $tab + $query .= PHP_EOL . Indent::_(2) . $tab . "\$query->select(\$db->quoteName(['" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" @@ -16199,7 +16025,7 @@ class Interpretation extends Fields // we want to at times just have the words and not the ids as well if ($just_text) { - $query .= PHP_EOL . $this->_t(2) . $tab + $query .= PHP_EOL . Indent::_(2) . $tab . "\$query->select(\$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" @@ -16207,7 +16033,7 @@ class Interpretation extends Fields } else { - $query .= PHP_EOL . $this->_t(2) . $tab + $query .= PHP_EOL . Indent::_(2) . $tab . "\$query->select(\$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" @@ -16215,7 +16041,7 @@ class Interpretation extends Fields . "'));"; } } - $query .= PHP_EOL . $this->_t(2) . $tab + $query .= PHP_EOL . Indent::_(2) . $tab . "\$query->join('LEFT', \$db->quoteName('" . $filter['custom']['table'] . "', '" . $filter['custom']['db'] @@ -16250,8 +16076,7 @@ class Interpretation extends Fields )) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; // start building the filter query $filterQuery = ""; foreach ($this->filterBuilder[$nameListCode] as $filter) @@ -16259,8 +16084,8 @@ class Interpretation extends Fields // only add for none category fields if ($filter['type'] != 'category') { - $filterQuery .= PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Filter by " + $filterQuery .= PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Filter by " . ucwords($filter['code']) . "."; // we only add multi filter option if new filter type // and we have multi filter set for this field (2 = topbar) @@ -16300,34 +16125,34 @@ class Interpretation extends Fields */ protected function setSingleFilterQuery($filter, $Helper, $a = "a") { - $filterQuery = PHP_EOL . $this->_t(2) . "\$_" + $filterQuery = PHP_EOL . Indent::_(2) . "\$_" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "');"; - $filterQuery .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$_" + $filterQuery .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$_" . $filter['code'] . "))"; - $filterQuery .= PHP_EOL . $this->_t(2) . "{"; - $filterQuery .= PHP_EOL . $this->_t(3) . "if (is_float(\$_" + $filterQuery .= PHP_EOL . Indent::_(2) . "{"; + $filterQuery .= PHP_EOL . Indent::_(3) . "if (is_float(\$_" . $filter['code'] . "))"; - $filterQuery .= PHP_EOL . $this->_t(3) . "{"; - $filterQuery .= PHP_EOL . $this->_t(4) + $filterQuery .= PHP_EOL . Indent::_(3) . "{"; + $filterQuery .= PHP_EOL . Indent::_(4) . "\$query->where('" . $a . "." . $filter['code'] . " = ' . (float) \$_" . $filter['code'] . ");"; - $filterQuery .= PHP_EOL . $this->_t(3) . "}"; - $filterQuery .= PHP_EOL . $this->_t(3) . "else"; - $filterQuery .= PHP_EOL . $this->_t(3) . "{"; - $filterQuery .= PHP_EOL . $this->_t(4) + $filterQuery .= PHP_EOL . Indent::_(3) . "}"; + $filterQuery .= PHP_EOL . Indent::_(3) . "else"; + $filterQuery .= PHP_EOL . Indent::_(3) . "{"; + $filterQuery .= PHP_EOL . Indent::_(4) . "\$query->where('" . $a . "." . $filter['code'] . " = ' . (int) \$_" . $filter['code'] . ");"; - $filterQuery .= PHP_EOL . $this->_t(3) . "}"; - $filterQuery .= PHP_EOL . $this->_t(2) . "}"; - $filterQuery .= PHP_EOL . $this->_t(2) . "elseif (" + $filterQuery .= PHP_EOL . Indent::_(3) . "}"; + $filterQuery .= PHP_EOL . Indent::_(2) . "}"; + $filterQuery .= PHP_EOL . Indent::_(2) . "elseif (" . $Helper . "::checkString(\$_" . $filter['code'] . "))"; - $filterQuery .= PHP_EOL . $this->_t(2) . "{"; - $filterQuery .= PHP_EOL . $this->_t(3) + $filterQuery .= PHP_EOL . Indent::_(2) . "{"; + $filterQuery .= PHP_EOL . Indent::_(3) . "\$query->where('" . $a . "." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$_" . $filter['code'] . ")));"; - $filterQuery .= PHP_EOL . $this->_t(2) . "}"; + $filterQuery .= PHP_EOL . Indent::_(2) . "}"; return $filterQuery; } @@ -16344,71 +16169,71 @@ class Interpretation extends Fields */ protected function setMultiFilterQuery($filter, $Helper, $a = "a") { - $filterQuery = PHP_EOL . $this->_t(2) . "\$_" + $filterQuery = PHP_EOL . Indent::_(2) . "\$_" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "');"; - $filterQuery .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$_" + $filterQuery .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$_" . $filter['code'] . "))"; - $filterQuery .= PHP_EOL . $this->_t(2) . "{"; - $filterQuery .= PHP_EOL . $this->_t(3) . "if (is_float(\$_" + $filterQuery .= PHP_EOL . Indent::_(2) . "{"; + $filterQuery .= PHP_EOL . Indent::_(3) . "if (is_float(\$_" . $filter['code'] . "))"; - $filterQuery .= PHP_EOL . $this->_t(3) . "{"; - $filterQuery .= PHP_EOL . $this->_t(4) + $filterQuery .= PHP_EOL . Indent::_(3) . "{"; + $filterQuery .= PHP_EOL . Indent::_(4) . "\$query->where('" . $a . "." . $filter['code'] . " = ' . (float) \$_" . $filter['code'] . ");"; - $filterQuery .= PHP_EOL . $this->_t(3) . "}"; - $filterQuery .= PHP_EOL . $this->_t(3) . "else"; - $filterQuery .= PHP_EOL . $this->_t(3) . "{"; - $filterQuery .= PHP_EOL . $this->_t(4) + $filterQuery .= PHP_EOL . Indent::_(3) . "}"; + $filterQuery .= PHP_EOL . Indent::_(3) . "else"; + $filterQuery .= PHP_EOL . Indent::_(3) . "{"; + $filterQuery .= PHP_EOL . Indent::_(4) . "\$query->where('" . $a . "." . $filter['code'] . " = ' . (int) \$_" . $filter['code'] . ");"; - $filterQuery .= PHP_EOL . $this->_t(3) . "}"; - $filterQuery .= PHP_EOL . $this->_t(2) . "}"; - $filterQuery .= PHP_EOL . $this->_t(2) . "elseif (" + $filterQuery .= PHP_EOL . Indent::_(3) . "}"; + $filterQuery .= PHP_EOL . Indent::_(2) . "}"; + $filterQuery .= PHP_EOL . Indent::_(2) . "elseif (" . $Helper . "::checkString(\$_" . $filter['code'] . "))"; - $filterQuery .= PHP_EOL . $this->_t(2) . "{"; - $filterQuery .= PHP_EOL . $this->_t(3) + $filterQuery .= PHP_EOL . Indent::_(2) . "{"; + $filterQuery .= PHP_EOL . Indent::_(3) . "\$query->where('" . $a . "." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$_" . $filter['code'] . ")));"; - $filterQuery .= PHP_EOL . $this->_t(2) . "}"; - $filterQuery .= PHP_EOL . $this->_t(2) . "elseif (" + $filterQuery .= PHP_EOL . Indent::_(2) . "}"; + $filterQuery .= PHP_EOL . Indent::_(2) . "elseif (" . $Helper . "::checkArray(\$_" . $filter['code'] . "))"; - $filterQuery .= PHP_EOL . $this->_t(2) . "{"; + $filterQuery .= PHP_EOL . Indent::_(2) . "{"; - $filterQuery .= PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Secure the array for the query"; + $filterQuery .= PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Secure the array for the query"; - $filterQuery .= PHP_EOL . $this->_t(3) . "\$_" . $filter['code'] + $filterQuery .= PHP_EOL . Indent::_(3) . "\$_" . $filter['code'] . " = array_map( function (\$val) use(&\$db) {"; - $filterQuery .= PHP_EOL . $this->_t(4) . "if (is_numeric(\$val))"; - $filterQuery .= PHP_EOL . $this->_t(4) . "{"; - $filterQuery .= PHP_EOL . $this->_t(5) . "if (is_float(\$val))"; - $filterQuery .= PHP_EOL . $this->_t(5) . "{"; - $filterQuery .= PHP_EOL . $this->_t(6) . "return (float) \$val;"; - $filterQuery .= PHP_EOL . $this->_t(5) . "}"; - $filterQuery .= PHP_EOL . $this->_t(5) . "else"; - $filterQuery .= PHP_EOL . $this->_t(5) . "{"; - $filterQuery .= PHP_EOL . $this->_t(6) . "return (int) \$val;"; - $filterQuery .= PHP_EOL . $this->_t(5) . "}"; - $filterQuery .= PHP_EOL . $this->_t(4) . "}"; - $filterQuery .= PHP_EOL . $this->_t(4) . "elseif (" + $filterQuery .= PHP_EOL . Indent::_(4) . "if (is_numeric(\$val))"; + $filterQuery .= PHP_EOL . Indent::_(4) . "{"; + $filterQuery .= PHP_EOL . Indent::_(5) . "if (is_float(\$val))"; + $filterQuery .= PHP_EOL . Indent::_(5) . "{"; + $filterQuery .= PHP_EOL . Indent::_(6) . "return (float) \$val;"; + $filterQuery .= PHP_EOL . Indent::_(5) . "}"; + $filterQuery .= PHP_EOL . Indent::_(5) . "else"; + $filterQuery .= PHP_EOL . Indent::_(5) . "{"; + $filterQuery .= PHP_EOL . Indent::_(6) . "return (int) \$val;"; + $filterQuery .= PHP_EOL . Indent::_(5) . "}"; + $filterQuery .= PHP_EOL . Indent::_(4) . "}"; + $filterQuery .= PHP_EOL . Indent::_(4) . "elseif (" . $Helper . "::checkString(\$val))"; - $filterQuery .= PHP_EOL . $this->_t(4) . "{"; - $filterQuery .= PHP_EOL . $this->_t(5) + $filterQuery .= PHP_EOL . Indent::_(4) . "{"; + $filterQuery .= PHP_EOL . Indent::_(5) . "return \$db->quote(\$db->escape(\$val));"; - $filterQuery .= PHP_EOL . $this->_t(4) . "}"; - $filterQuery .= PHP_EOL . $this->_t(3) . "}, \$_" + $filterQuery .= PHP_EOL . Indent::_(4) . "}"; + $filterQuery .= PHP_EOL . Indent::_(3) . "}, \$_" . $filter['code'] . ");"; - $filterQuery .= PHP_EOL . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Filter by the " + $filterQuery .= PHP_EOL . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Filter by the " . ucwords($filter['code']) . " Array."; - $filterQuery .= PHP_EOL . $this->_t(3) + $filterQuery .= PHP_EOL . Indent::_(3) . "\$query->where('" . $a . "." . $filter['code'] . " IN (' . implode(',', \$_" . $filter['code'] . ") . ')');"; - $filterQuery .= PHP_EOL . $this->_t(2) . "}"; + $filterQuery .= PHP_EOL . Indent::_(2) . "}"; return $filterQuery; } @@ -16580,7 +16405,7 @@ class Interpretation extends Fields if (ArrayHelper::check($functions)) { // now build the initial script - $initial .= "//" . $this->setLine(__LINE__) . " Initial Script" + $initial .= "//" . Line::_(__Line__, __Class__) . " Initial Script" . PHP_EOL . "jQuery(document).ready(function()"; $initial .= PHP_EOL . "{"; foreach ($functions as $function => $matchKeys) @@ -16628,8 +16453,8 @@ class Interpretation extends Fields $name = $name . '_id'; } - $listener .= PHP_EOL . "//" . $this->setLine( - __LINE__ + $listener .= PHP_EOL . "//" . Line::_( + __LINE__,__CLASS__ ) . " #jform_" . $name . " listeners for " . $l_matchKey . " function"; $listener .= PHP_EOL . "jQuery('#jform_" . $name @@ -16641,7 +16466,7 @@ class Interpretation extends Fields . "jQuery('#adminForm').on('change', '#jform_" . $name . "',function (e)"; $listener .= PHP_EOL . "{"; - $listener .= PHP_EOL . $this->_t(1) + $listener .= PHP_EOL . Indent::_(1) . "e.preventDefault();"; $listener .= $funcCall['code']; $listener .= PHP_EOL . "});" . PHP_EOL; @@ -16651,9 +16476,9 @@ class Interpretation extends Fields if (StringHelper::check($modal)) { $listener .= PHP_EOL . "window.SqueezeBox.initialize({"; - $listener .= PHP_EOL . $this->_t(1) . "onClose:function(){"; + $listener .= PHP_EOL . Indent::_(1) . "onClose:function(){"; $listener .= $modal; - $listener .= PHP_EOL . $this->_t(1) . "}"; + $listener .= PHP_EOL . Indent::_(1) . "}"; $listener .= PHP_EOL . "});" . PHP_EOL; } @@ -16673,7 +16498,7 @@ class Interpretation extends Fields { $addArray = true; } - $func .= PHP_EOL . "//" . $this->setLine(__LINE__) + $func .= PHP_EOL . "//" . Line::_(__Line__, __Class__) . " the " . $f_function . " function"; $func .= PHP_EOL . "function " . $f_function . "("; $fucounter = 0; @@ -16699,52 +16524,52 @@ class Interpretation extends Fields foreach ($f_matchKeys as $a_matchKey) { $name = $matchNames[$a_matchKey]; - $func .= PHP_EOL . $this->_t(1) . "if (isSet(" + $func .= PHP_EOL . Indent::_(1) . "if (isSet(" . $a_matchKey . ") && " . $a_matchKey . ".constructor !== Array)" . PHP_EOL - . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) + . Indent::_(1) . "{" . PHP_EOL . Indent::_(2) . "var temp_" . $f_function . " = " - . $a_matchKey . ";" . PHP_EOL . $this->_t(2) + . $a_matchKey . ";" . PHP_EOL . Indent::_(2) . "var " . $a_matchKey . " = [];" . PHP_EOL - . $this->_t(2) . $a_matchKey . ".push(temp_" - . $f_function . ");" . PHP_EOL . $this->_t(1) + . Indent::_(2) . $a_matchKey . ".push(temp_" + . $f_function . ");" . PHP_EOL . Indent::_(1) . "}"; - $func .= PHP_EOL . $this->_t(1) . "else if (!isSet(" - . $a_matchKey . "))" . PHP_EOL . $this->_t(1) + $func .= PHP_EOL . Indent::_(1) . "else if (!isSet(" + . $a_matchKey . "))" . PHP_EOL . Indent::_(1) . "{"; - $func .= PHP_EOL . $this->_t(2) . "var " + $func .= PHP_EOL . Indent::_(2) . "var " . $a_matchKey . " = [];"; - $func .= PHP_EOL . $this->_t(1) . "}"; - $func .= PHP_EOL . $this->_t(1) . "var " . $name + $func .= PHP_EOL . Indent::_(1) . "}"; + $func .= PHP_EOL . Indent::_(1) . "var " . $name . " = " . $a_matchKey . ".some(" . $a_matchKey . "_SomeFunc);" . PHP_EOL; // setup the map function - $map .= PHP_EOL . "//" . $this->setLine(__LINE__) + $map .= PHP_EOL . "//" . Line::_(__Line__, __Class__) . " the " . $f_function . " Some function"; $map .= PHP_EOL . "function " . $a_matchKey . "_SomeFunc(" . $a_matchKey . ")"; $map .= PHP_EOL . "{"; - $map .= PHP_EOL . $this->_t(1) . "//" - . $this->setLine(__LINE__) + $map .= PHP_EOL . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " set the function logic"; - $map .= PHP_EOL . $this->_t(1) . "if ("; + $map .= PHP_EOL . Indent::_(1) . "if ("; $if = $ifValue[$a_matchKey]; if (StringHelper::check($if)) { $map .= $if; } $map .= ")"; - $map .= PHP_EOL . $this->_t(1) . "{"; - $map .= PHP_EOL . $this->_t(2) . "return true;"; - $map .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL - . $this->_t(1) . "return false;"; + $map .= PHP_EOL . Indent::_(1) . "{"; + $map .= PHP_EOL . Indent::_(2) . "return true;"; + $map .= PHP_EOL . Indent::_(1) . "}" . PHP_EOL + . Indent::_(1) . "return false;"; $map .= PHP_EOL . "}" . PHP_EOL; } - $func .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" - . $this->setLine(__LINE__) + $func .= PHP_EOL . PHP_EOL . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " set this function logic"; - $func .= PHP_EOL . $this->_t(1) . "if ("; + $func .= PHP_EOL . Indent::_(1) . "if ("; // set if counter $aifcounter = 0; foreach ($f_matchKeys as $af_matchKey) @@ -16760,14 +16585,14 @@ class Interpretation extends Fields } $aifcounter++; } - $func .= ")" . PHP_EOL . $this->_t(1) . "{"; + $func .= ")" . PHP_EOL . Indent::_(1) . "{"; } else { - $func .= PHP_EOL . $this->_t(1) . "//" . $this->setLine( - __LINE__ + $func .= PHP_EOL . Indent::_(1) . "//" . Line::_( + __LINE__,__CLASS__ ) . " set the function logic"; - $func .= PHP_EOL . $this->_t(1) . "if ("; + $func .= PHP_EOL . Indent::_(1) . "if ("; // set if counter $ifcounter = 0; foreach ($f_matchKeys as $f_matchKey) @@ -16786,7 +16611,7 @@ class Interpretation extends Fields $ifcounter++; } } - $func .= ")" . PHP_EOL . $this->_t(1) . "{"; + $func .= ")" . PHP_EOL . Indent::_(1) . "{"; } // get the controles $controls = $targetControls[$f_matchKeys[0]]; @@ -16808,8 +16633,8 @@ class Interpretation extends Fields // check if this is a toggle switch if ($toggleSwitch[$f_matchKeys[0]]) { - $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL - . $this->_t(1) . "else" . PHP_EOL . $this->_t(1) + $func .= PHP_EOL . Indent::_(1) . "}" . PHP_EOL + . Indent::_(1) . "else" . PHP_EOL . Indent::_(1) . "{"; // load the default behavior foreach ($controls as $target => $action) @@ -16823,7 +16648,7 @@ class Interpretation extends Fields } } } - $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . "}" + $func .= PHP_EOL . Indent::_(1) . "}" . PHP_EOL . "}" . PHP_EOL . $map; } // add the needed validation to file @@ -16835,69 +16660,69 @@ class Interpretation extends Fields $validation .= PHP_EOL . "// update fields required"; $validation .= PHP_EOL . "function updateFieldRequired(name, status) {"; - $validation .= PHP_EOL . $this->_t(1) + $validation .= PHP_EOL . Indent::_(1) . "// check if not_required exist"; - $validation .= PHP_EOL . $this->_t(1) + $validation .= PHP_EOL . Indent::_(1) . "if (jQuery('#jform_not_required').length > 0) {"; - $validation .= PHP_EOL . $this->_t(2) + $validation .= PHP_EOL . Indent::_(2) . "var not_required = jQuery('#jform_not_required').val().split(\",\");"; - $validation .= PHP_EOL . PHP_EOL . $this->_t(2) + $validation .= PHP_EOL . PHP_EOL . Indent::_(2) . "if(status == 1)"; - $validation .= PHP_EOL . $this->_t(2) . "{"; - $validation .= PHP_EOL . $this->_t(3) + $validation .= PHP_EOL . Indent::_(2) . "{"; + $validation .= PHP_EOL . Indent::_(3) . "not_required.push(name);"; - $validation .= PHP_EOL . $this->_t(2) . "}"; - $validation .= PHP_EOL . $this->_t(2) . "else"; - $validation .= PHP_EOL . $this->_t(2) . "{"; - $validation .= PHP_EOL . $this->_t(3) + $validation .= PHP_EOL . Indent::_(2) . "}"; + $validation .= PHP_EOL . Indent::_(2) . "else"; + $validation .= PHP_EOL . Indent::_(2) . "{"; + $validation .= PHP_EOL . Indent::_(3) . "not_required = removeFieldFromNotRequired(not_required, name);"; - $validation .= PHP_EOL . $this->_t(2) . "}"; - $validation .= PHP_EOL . PHP_EOL . $this->_t(2) + $validation .= PHP_EOL . Indent::_(2) . "}"; + $validation .= PHP_EOL . PHP_EOL . Indent::_(2) . "jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString());"; - $validation .= PHP_EOL . $this->_t(1) . "}"; + $validation .= PHP_EOL . Indent::_(1) . "}"; $validation .= PHP_EOL . "}" . PHP_EOL; $validation .= PHP_EOL . "// remove field from not_required"; $validation .= PHP_EOL . "function removeFieldFromNotRequired(array, what) {"; - $validation .= PHP_EOL . $this->_t(1) + $validation .= PHP_EOL . Indent::_(1) . "return array.filter(function(element){"; - $validation .= PHP_EOL . $this->_t(2) + $validation .= PHP_EOL . Indent::_(2) . "return element !== what;"; - $validation .= PHP_EOL . $this->_t(1) . "});"; + $validation .= PHP_EOL . Indent::_(1) . "});"; $validation .= PHP_EOL . "}" . PHP_EOL; $validation .= PHP_EOL . "// fix not required array"; $validation .= PHP_EOL . "function fixNotRequiredArray(array) {"; - $validation .= PHP_EOL . $this->_t(1) . "var seen = {};"; - $validation .= PHP_EOL . $this->_t(1) + $validation .= PHP_EOL . Indent::_(1) . "var seen = {};"; + $validation .= PHP_EOL . Indent::_(1) . "return removeEmptyFromNotRequiredArray(array).filter(function(item) {"; - $validation .= PHP_EOL . $this->_t(2) + $validation .= PHP_EOL . Indent::_(2) . "return seen.hasOwnProperty(item) ? false : (seen[item] = true);"; - $validation .= PHP_EOL . $this->_t(1) . "});"; + $validation .= PHP_EOL . Indent::_(1) . "});"; $validation .= PHP_EOL . "}" . PHP_EOL; $validation .= PHP_EOL . "// remove empty from not_required array"; $validation .= PHP_EOL . "function removeEmptyFromNotRequiredArray(array) {"; - $validation .= PHP_EOL . $this->_t(1) + $validation .= PHP_EOL . Indent::_(1) . "return array.filter(function (el) {"; - $validation .= PHP_EOL . $this->_t(2) + $validation .= PHP_EOL . Indent::_(2) . "// remove ( 一_一) as well - lol"; - $validation .= PHP_EOL . $this->_t(2) + $validation .= PHP_EOL . Indent::_(2) . "return (el.length > 0 && '一_一' !== el);"; - $validation .= PHP_EOL . $this->_t(1) . "});"; + $validation .= PHP_EOL . Indent::_(1) . "});"; $validation .= PHP_EOL . "}" . PHP_EOL; } // set the isSet function $isSet = PHP_EOL . "// the isSet function"; $isSet .= PHP_EOL . "function isSet(val)"; $isSet .= PHP_EOL . "{"; - $isSet .= PHP_EOL . $this->_t(1) + $isSet .= PHP_EOL . Indent::_(1) . "if ((val != undefined) && (val != null) && 0 !== val.length){"; - $isSet .= PHP_EOL . $this->_t(2) . "return true;"; - $isSet .= PHP_EOL . $this->_t(1) . "}"; - $isSet .= PHP_EOL . $this->_t(1) . "return false;"; + $isSet .= PHP_EOL . Indent::_(2) . "return true;"; + $isSet .= PHP_EOL . Indent::_(1) . "}"; + $isSet .= PHP_EOL . Indent::_(1) . "return false;"; $isSet .= PHP_EOL . "}"; } // load to this buket @@ -16918,7 +16743,7 @@ class Interpretation extends Fields $this->customScriptBuilder['view_footer'][$nameSingleCode] )) { - $customFooterScript = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $customFooterScript = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $this->customScriptBuilder['view_footer'][$nameSingleCode], $this->placeholders ); @@ -16946,34 +16771,29 @@ class Interpretation extends Fields $_created = $this->getCreatedDate($viewArray); $_modified = $this->getLastModifiedDate($viewArray); // add file to view - $_target = array($this->target => $nameListCode); - $_config = array($this->hhh . 'CREATIONDATE' - . $this->hhh => $_created, - $this->hhh . 'BUILDDATE' - . $this->hhh => $_modified, - $this->hhh . 'VERSION' - . $this->hhh => $viewArray['settings']->version); + $_target = array(CFactory::_('Config')->build_target => $nameListCode); + $_config = array(Placefix::_h('CREATIONDATE') => $_created, + Placefix::_h('BUILDDATE') => $_modified, + Placefix::_h('VERSION') => $viewArray['settings']->version); $this->buildDynamique($_target, 'javascript_file', false, $_config); // set path $_path = '/administrator/components/com_' . $this->componentCodeName . '/assets/js/' . $nameListCode . '.js'; // load the file to the list view - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_ADD_JAVASCRIPT_FILE' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ - ) . " Add List View JavaScript File" . PHP_EOL . $this->_t(2) + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_ADD_JAVASCRIPT_FILE')] + = PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ + ) . " Add List View JavaScript File" . PHP_EOL . Indent::_(2) . $this->setIncludeLibScript($_path); } else { $list_fileScript = ''; - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_ADD_JAVASCRIPT_FILE' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_ADD_JAVASCRIPT_FILE')] = ''; } // minfy the script - if (Config::get('minify', 0) && isset($list_fileScript) + if (CFactory::_('Config')->get('minify', 0) && isset($list_fileScript) && StringHelper::check($list_fileScript)) { // minify the fielScript javscript @@ -16982,7 +16802,7 @@ class Interpretation extends Fields $list_fileScript = $minifier->minify(); } // minfy the script - if (Config::get('minify', 0) && isset($fileScript) + if (CFactory::_('Config')->get('minify', 0) && isset($fileScript) && StringHelper::check($fileScript)) { // minify the fielScript javscript @@ -16991,7 +16811,7 @@ class Interpretation extends Fields $fileScript = $minifier->minify(); } // minfy the script - if (Config::get('minify', 0) && isset($footerScript) + if (CFactory::_('Config')->get('minify', 0) && isset($footerScript) && StringHelper::check($footerScript)) { // minify the footerScript javscript @@ -17062,13 +16882,13 @@ class Interpretation extends Fields $value = $getValue[$matchKey]; if ($value['isArray']) { - $initial .= PHP_EOL . $this->_t(1) . $value['get']; + $initial .= PHP_EOL . Indent::_(1) . $value['get']; $funcsets[] = $matchKey; $array = true; } else { - $initial .= PHP_EOL . $this->_t(1) . $value['get']; + $initial .= PHP_EOL . Indent::_(1) . $value['get']; $funcsets[] = $matchKey; } } @@ -17076,7 +16896,7 @@ class Interpretation extends Fields // make sure that the function is loaded only once if (ArrayHelper::check($funcsets)) { - $initial .= PHP_EOL . $this->_t(1) . $function . "("; + $initial .= PHP_EOL . Indent::_(1) . $function . "("; $initial .= implode(',', $funcsets); $initial .= ");" . PHP_EOL; } @@ -17230,13 +17050,13 @@ class Interpretation extends Fields $targetType = "#jform_"; } // set the target behavior - $bucket[$target['name']]['behavior'] = PHP_EOL . $this->_t( + $bucket[$target['name']]['behavior'] = PHP_EOL . Indent::_( 2 ) . "jQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetBehavior . "();"; // set the target default - $bucket[$target['name']]['default'] = PHP_EOL . $this->_t(2) + $bucket[$target['name']]['default'] = PHP_EOL . Indent::_(2) . "jQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetDefault . "();"; @@ -17246,112 +17066,112 @@ class Interpretation extends Fields if ($toggleSwitch) { $hide = PHP_EOL - . $this->_t(2) . "//" . $this->setLine(__LINE__) + . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " remove required attribute from " . $target['name'] . " field"; $hide .= PHP_EOL - . $this->_t(2) . "if (!jform_" . $unique + . Indent::_(2) . "if (!jform_" . $unique . "_required)"; $hide .= PHP_EOL - . $this->_t(2) . "{"; + . Indent::_(2) . "{"; $hide .= PHP_EOL - . $this->_t(3) . "updateFieldRequired('" + . Indent::_(3) . "updateFieldRequired('" . $target['name'] . "',1);"; $hide .= PHP_EOL - . $this->_t(3) . "jQuery('#jform_" + . Indent::_(3) . "jQuery('#jform_" . $target['name'] . "').removeAttr('required');"; $hide .= PHP_EOL - . $this->_t(3) . "jQuery('#jform_" + . Indent::_(3) . "jQuery('#jform_" . $target['name'] . "').removeAttr('aria-required');"; $hide .= PHP_EOL - . $this->_t(3) . "jQuery('#jform_" + . Indent::_(3) . "jQuery('#jform_" . $target['name'] . "').removeClass('required');"; $hide .= PHP_EOL - . $this->_t(3) . "jform_" . $unique + . Indent::_(3) . "jform_" . $unique . "_required = true;"; $hide .= PHP_EOL - . $this->_t(2) . "}"; + . Indent::_(2) . "}"; $bucket[$target['name']]['hide'] = $hide; // the show required function $show = PHP_EOL - . $this->_t(2) . "//" . $this->setLine(__LINE__) + . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " add required attribute to " . $target['name'] . " field"; $show .= PHP_EOL - . $this->_t(2) . "if (jform_" . $unique + . Indent::_(2) . "if (jform_" . $unique . "_required)"; $show .= PHP_EOL - . $this->_t(2) . "{"; + . Indent::_(2) . "{"; $show .= PHP_EOL - . $this->_t(3) . "updateFieldRequired('" + . Indent::_(3) . "updateFieldRequired('" . $target['name'] . "',0);"; $show .= PHP_EOL - . $this->_t(3) . "jQuery('#jform_" + . Indent::_(3) . "jQuery('#jform_" . $target['name'] . "').prop('required','required');"; $show .= PHP_EOL - . $this->_t(3) . "jQuery('#jform_" + . Indent::_(3) . "jQuery('#jform_" . $target['name'] . "').attr('aria-required',true);"; $show .= PHP_EOL - . $this->_t(3) . "jQuery('#jform_" + . Indent::_(3) . "jQuery('#jform_" . $target['name'] . "').addClass('required');"; $show .= PHP_EOL - . $this->_t(3) . "jform_" . $unique + . Indent::_(3) . "jform_" . $unique . "_required = false;"; $show .= PHP_EOL - . $this->_t(2) . "}"; + . Indent::_(2) . "}"; $bucket[$target['name']]['show'] = $show; } else { $hide = PHP_EOL - . $this->_t(2) . "//" . $this->setLine(__LINE__) + . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " remove required attribute from " . $target['name'] . " field"; $hide .= PHP_EOL - . $this->_t(2) . "updateFieldRequired('" + . Indent::_(2) . "updateFieldRequired('" . $target['name'] . "',1);"; $hide .= PHP_EOL - . $this->_t(2) . "jQuery('#jform_" + . Indent::_(2) . "jQuery('#jform_" . $target['name'] . "').removeAttr('required');"; $hide .= PHP_EOL - . $this->_t(2) . "jQuery('#jform_" + . Indent::_(2) . "jQuery('#jform_" . $target['name'] . "').removeAttr('aria-required');"; $hide .= PHP_EOL - . $this->_t(2) . "jQuery('#jform_" + . Indent::_(2) . "jQuery('#jform_" . $target['name'] . "').removeClass('required');"; $hide .= PHP_EOL - . $this->_t(2) . "jform_" . $unique + . Indent::_(2) . "jform_" . $unique . "_required = true;" . PHP_EOL; $bucket[$target['name']]['hide'] = $hide; // the show required function $show = PHP_EOL - . $this->_t(2) . "//" . $this->setLine(__LINE__) + . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " add required attribute to " . $target['name'] . " field"; $show .= PHP_EOL - . $this->_t(2) . "updateFieldRequired('" + . Indent::_(2) . "updateFieldRequired('" . $target['name'] . "',0);"; $show .= PHP_EOL - . $this->_t(2) . "jQuery('#jform_" + . Indent::_(2) . "jQuery('#jform_" . $target['name'] . "').prop('required','required');"; $show .= PHP_EOL - . $this->_t(2) . "jQuery('#jform_" + . Indent::_(2) . "jQuery('#jform_" . $target['name'] . "').attr('aria-required',true);"; $show .= PHP_EOL - . $this->_t(2) . "jQuery('#jform_" + . Indent::_(2) . "jQuery('#jform_" . $target['name'] . "').addClass('required');"; $show .= PHP_EOL - . $this->_t(2) . "jform_" . $unique + . Indent::_(2) . "jform_" . $unique . "_required = false;" . PHP_EOL; $bucket[$target['name']]['show'] = $show; } @@ -17763,14 +17583,14 @@ class Interpretation extends Fields $keyName = $name . '_' . $unique; if ($type === 'checkboxes' || $extends === 'checkboxes') { - $select = "var " . $keyName . " = [];" . PHP_EOL . $this->_t(1) + $select = "var " . $keyName . " = [];" . PHP_EOL . Indent::_(1) . "jQuery('#jform_" . $name . " input[type=checkbox]').each(function()" . PHP_EOL - . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) - . "if (jQuery(this).is(':checked'))" . PHP_EOL . $this->_t(2) - . "{" . PHP_EOL . $this->_t(3) . $keyName - . ".push(jQuery(this).prop('value'));" . PHP_EOL . $this->_t(2) - . "}" . PHP_EOL . $this->_t(1) . "});"; + . Indent::_(1) . "{" . PHP_EOL . Indent::_(2) + . "if (jQuery(this).is(':checked'))" . PHP_EOL . Indent::_(2) + . "{" . PHP_EOL . Indent::_(3) . $keyName + . ".push(jQuery(this).prop('value'));" . PHP_EOL . Indent::_(2) + . "}" . PHP_EOL . Indent::_(1) . "});"; $isArray = true; } elseif ($type === 'checkbox') @@ -17851,60 +17671,60 @@ class Interpretation extends Fields $this->validationFixBuilder[$view] )) { - $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $fix .= PHP_EOL . Indent::_(1) . " * Method to validate the form data."; - $fix .= PHP_EOL . $this->_t(1) . " *"; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . Indent::_(1) . " *"; + $fix .= PHP_EOL . Indent::_(1) . " * @param JForm \$form The form to validate against."; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . Indent::_(1) . " * @param array \$data The data to validate."; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . Indent::_(1) . " * @param string \$group The name of the field group to validate."; - $fix .= PHP_EOL . $this->_t(1) . " *"; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . Indent::_(1) . " *"; + $fix .= PHP_EOL . Indent::_(1) . " * @return mixed Array of filtered data if valid, false otherwise."; - $fix .= PHP_EOL . $this->_t(1) . " *"; - $fix .= PHP_EOL . $this->_t(1) . " * @see JFormRule"; - $fix .= PHP_EOL . $this->_t(1) . " * @see JFilterInput"; - $fix .= PHP_EOL . $this->_t(1) . " * @since 12.2"; - $fix .= PHP_EOL . $this->_t(1) . " */"; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . Indent::_(1) . " *"; + $fix .= PHP_EOL . Indent::_(1) . " * @see JFormRule"; + $fix .= PHP_EOL . Indent::_(1) . " * @see JFilterInput"; + $fix .= PHP_EOL . Indent::_(1) . " * @since 12.2"; + $fix .= PHP_EOL . Indent::_(1) . " */"; + $fix .= PHP_EOL . Indent::_(1) . "public function validate(\$form, \$data, \$group = null)"; - $fix .= PHP_EOL . $this->_t(1) . "{"; - $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(1) . "{"; + $fix .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if the not_required field is set"; - $fix .= PHP_EOL . $this->_t(2) + $fix .= PHP_EOL . Indent::_(2) . "if (isset(\$data['not_required']) && " . $Component . "Helper::checkString(\$data['not_required']))"; - $fix .= PHP_EOL . $this->_t(2) . "{"; - $fix .= PHP_EOL . $this->_t(3) + $fix .= PHP_EOL . Indent::_(2) . "{"; + $fix .= PHP_EOL . Indent::_(3) . "\$requiredFields = (array) explode(',',(string) \$data['not_required']);"; - $fix .= PHP_EOL . $this->_t(3) + $fix .= PHP_EOL . Indent::_(3) . "\$requiredFields = array_unique(\$requiredFields);"; - $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " now change the required field attributes value"; - $fix .= PHP_EOL . $this->_t(3) + $fix .= PHP_EOL . Indent::_(3) . "foreach (\$requiredFields as \$requiredField)"; - $fix .= PHP_EOL . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(3) . "{"; + $fix .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " make sure there is a string value"; - $fix .= PHP_EOL . $this->_t(4) . "if (" . $Component + $fix .= PHP_EOL . Indent::_(4) . "if (" . $Component . "Helper::checkString(\$requiredField))"; - $fix .= PHP_EOL . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(4) . "{"; + $fix .= PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " change to false"; - $fix .= PHP_EOL . $this->_t(5) + $fix .= PHP_EOL . Indent::_(5) . "\$form->setFieldAttribute(\$requiredField, 'required', 'false');"; - $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " also clear the data set"; - $fix .= PHP_EOL . $this->_t(5) . "\$data[\$requiredField] = '';"; - $fix .= PHP_EOL . $this->_t(4) . "}"; - $fix .= PHP_EOL . $this->_t(3) . "}"; - $fix .= PHP_EOL . $this->_t(2) . "}"; - $fix .= PHP_EOL . $this->_t(2) + $fix .= PHP_EOL . Indent::_(5) . "\$data[\$requiredField] = '';"; + $fix .= PHP_EOL . Indent::_(4) . "}"; + $fix .= PHP_EOL . Indent::_(3) . "}"; + $fix .= PHP_EOL . Indent::_(2) . "}"; + $fix .= PHP_EOL . Indent::_(2) . "return parent::validate(\$form, \$data, \$group);"; - $fix .= PHP_EOL . $this->_t(1) . "}"; + $fix .= PHP_EOL . Indent::_(1) . "}"; } return $fix; @@ -17916,9 +17736,9 @@ class Interpretation extends Fields if (isset($this->customScriptBuilder['token'][$view]) && $this->customScriptBuilder['token'][$view]) { - $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Add Ajax Token"; - $fix .= PHP_EOL . $this->_t(2) + $fix .= PHP_EOL . Indent::_(2) . "\$this->document->addScriptDeclaration(\"var token = '\".JSession::getFormToken().\"';\");"; } @@ -17947,7 +17767,7 @@ class Interpretation extends Fields { foreach ($taskArray as $name) { - $tasks .= PHP_EOL . $this->_t(2) . "\$this->registerTask('" + $tasks .= PHP_EOL . Indent::_(2) . "\$this->registerTask('" . $name . "', 'ajax');"; } } @@ -17983,8 +17803,7 @@ class Interpretation extends Fields . $task['value_name'] . "Value"; $getModel[$task['task_name']] = "\$result = \$this->getModel('ajax')->" - . $task['method_name'] . "(" . $this->bbb . "valueArray" - . $this->ddd . ");"; + . $task['method_name'] . "(" . Placefix::_("valueArray") . ");"; // check if null or zero is allowed if (!isset($task['allow_zero']) || 1 != $task['allow_zero']) { @@ -18008,18 +17827,18 @@ class Interpretation extends Fields { foreach ($getModel as $task => $getMethod) { - $cases .= PHP_EOL . $this->_t(4) . "case '" . $task . "':"; - $cases .= PHP_EOL . $this->_t(5) . "try"; - $cases .= PHP_EOL . $this->_t(5) . "{"; + $cases .= PHP_EOL . Indent::_(4) . "case '" . $task . "':"; + $cases .= PHP_EOL . Indent::_(5) . "try"; + $cases .= PHP_EOL . Indent::_(5) . "{"; foreach ($input[$task] as $string) { - $cases .= PHP_EOL . $this->_t(6) . $string; + $cases .= PHP_EOL . Indent::_(6) . $string; } // set the values $values = implode(', ', $valueArray[$task]); // set the values to method $getMethod = str_replace( - $this->bbb . 'valueArray' . $this->ddd, $values, + Placefix::_('valueArray'), $values, $getMethod ); // check if we have some values to check @@ -18029,59 +17848,59 @@ class Interpretation extends Fields // set if string $ifvalues = implode(' && ', $ifArray[$task]); // add to case - $cases .= PHP_EOL . $this->_t(6) . "if(" . $ifvalues + $cases .= PHP_EOL . Indent::_(6) . "if(" . $ifvalues . ")"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) . $getMethod; - $cases .= PHP_EOL . $this->_t(6) . "}"; - $cases .= PHP_EOL . $this->_t(6) . "else"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) . "\$result = false;"; - $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . $getMethod; + $cases .= PHP_EOL . Indent::_(6) . "}"; + $cases .= PHP_EOL . Indent::_(6) . "else"; + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . "\$result = false;"; + $cases .= PHP_EOL . Indent::_(6) . "}"; } else { - $cases .= PHP_EOL . $this->_t(6) . $getMethod; + $cases .= PHP_EOL . Indent::_(6) . $getMethod; } // continue the build - $cases .= PHP_EOL . $this->_t(6) + $cases .= PHP_EOL . Indent::_(6) . "if(\$callback)"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . "echo \$callback . \"(\".json_encode(\$result).\");\";"; - $cases .= PHP_EOL . $this->_t(6) . "}"; - $cases .= PHP_EOL . $this->_t(6) . "elseif(\$returnRaw)"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) + $cases .= PHP_EOL . Indent::_(6) . "}"; + $cases .= PHP_EOL . Indent::_(6) . "elseif(\$returnRaw)"; + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . "echo json_encode(\$result);"; - $cases .= PHP_EOL . $this->_t(6) . "}"; - $cases .= PHP_EOL . $this->_t(6) . "else"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) + $cases .= PHP_EOL . Indent::_(6) . "}"; + $cases .= PHP_EOL . Indent::_(6) . "else"; + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . "echo \"(\".json_encode(\$result).\");\";"; - $cases .= PHP_EOL . $this->_t(6) . "}"; - $cases .= PHP_EOL . $this->_t(5) . "}"; - $cases .= PHP_EOL . $this->_t(5) . "catch(Exception \$e)"; - $cases .= PHP_EOL . $this->_t(5) . "{"; - $cases .= PHP_EOL . $this->_t(6) + $cases .= PHP_EOL . Indent::_(6) . "}"; + $cases .= PHP_EOL . Indent::_(5) . "}"; + $cases .= PHP_EOL . Indent::_(5) . "catch(Exception \$e)"; + $cases .= PHP_EOL . Indent::_(5) . "{"; + $cases .= PHP_EOL . Indent::_(6) . "if(\$callback)"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . "echo \$callback.\"(\".json_encode(\$e).\");\";"; - $cases .= PHP_EOL . $this->_t(6) . "}"; - $cases .= PHP_EOL . $this->_t(6) + $cases .= PHP_EOL . Indent::_(6) . "}"; + $cases .= PHP_EOL . Indent::_(6) . "elseif(\$returnRaw)"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . "echo json_encode(\$e);"; - $cases .= PHP_EOL . $this->_t(6) . "}"; - $cases .= PHP_EOL . $this->_t(6) . "else"; - $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) + $cases .= PHP_EOL . Indent::_(6) . "}"; + $cases .= PHP_EOL . Indent::_(6) . "else"; + $cases .= PHP_EOL . Indent::_(6) . "{"; + $cases .= PHP_EOL . Indent::_(7) . "echo \"(\".json_encode(\$e).\");\";"; - $cases .= PHP_EOL . $this->_t(6) . "}"; - $cases .= PHP_EOL . $this->_t(5) . "}"; - $cases .= PHP_EOL . $this->_t(4) . "break;"; + $cases .= PHP_EOL . Indent::_(6) . "}"; + $cases .= PHP_EOL . Indent::_(5) . "}"; + $cases .= PHP_EOL . Indent::_(4) . "break;"; } } } @@ -18102,9 +17921,9 @@ class Interpretation extends Fields $method ) { - $methods .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" - . $this->setLine(__LINE__) . " Used in " . $view . PHP_EOL; - $methods .= $this->setPlaceholders( + $methods .= PHP_EOL . PHP_EOL . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " Used in " . $view . PHP_EOL; + $methods .= CFactory::_('Placeholder')->update( $method, $this->placeholders ); } @@ -18150,114 +17969,114 @@ class Interpretation extends Fields // add if this is a function path if ($funtion_path) { - $function[] = PHP_EOL . $this->_t(1) + $function[] = PHP_EOL . Indent::_(1) . "protected function getThe" . $filter['function'] . StringHelper::safe( $filter['custom']['text'], 'F' ) . "Selections()"; - $function[] = $this->_t(1) . "{"; + $function[] = Indent::_(1) . "{"; } - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get a db connection."; - $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "\$db = JFactory::getDbo();"; + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query = \$db->getQuery(true);"; - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Select the text."; - $function[] = $this->_t(2) + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Select the text."; + $function[] = Indent::_(2) . "\$query->select(\$db->quoteName(array('a." . $filter['custom']['id'] . "','a." . $filter['custom']['text'] . "')));"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->from(\$db->quoteName('" . $filter['custom']['table'] . "', 'a'));"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get the targeted groups"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$groups= JComponentHelper::getParams('com_" . $component . "')->get('" . $filter['type'] . "');"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "if (!empty(\$groups) && count((array) \$groups) > 0)"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "\$query->join('LEFT', \$db->quoteName('#__user_usergroup_map', 'group') . ' ON (' . \$db->quoteName('group.user_id') . ' = ' . \$db->quoteName('a.id') . ')');"; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "\$query->where('group.group_id IN (' . implode(',', \$groups) . ')');"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "\$query->order('a." + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "\$query->order('a." . $filter['custom']['text'] . " ASC');"; - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Reset the query using our newly populated query object."; - $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $function[] = PHP_EOL . $this->_t(2) + $function[] = Indent::_(2) . "\$db->setQuery(\$query);"; + $function[] = PHP_EOL . Indent::_(2) . "\$results = \$db->loadObjectList();"; - $function[] = $this->_t(2) . "\$_filter = array();"; + $function[] = Indent::_(2) . "\$_filter = array();"; // if this is not a multi field if (!$funtion_path && $filter['multi'] == 1) { - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$_filter[] = JHtml::_('select.option', '', '- Select ' . JText:" . ":_('" . $filter['lang'] . "') . ' -');"; } - $function[] = $this->_t(2) . "if (\$results)"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) + $function[] = Indent::_(2) . "if (\$results)"; + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "foreach (\$results as \$result)"; - $function[] = $this->_t(3) . "{"; - $function[] = $this->_t(4) + $function[] = Indent::_(3) . "{"; + $function[] = Indent::_(4) . "\$_filter[] = JHtml::_('select.option', \$result->" . $filter['custom']['id'] . ", \$result->" . $filter['custom']['text'] . ");"; - $function[] = $this->_t(3) . "}"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "return \$_filter;"; + $function[] = Indent::_(3) . "}"; + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "return \$_filter;"; // add if this is a function path if ($funtion_path) { - $function[] = $this->_t(1) . "}"; + $function[] = Indent::_(1) . "}"; } /* else { - $function[] = PHP_EOL.$this->_t(1) . "protected function getThe".$filter['function'].StringHelper::safe($filter['custom']['text'],'F')."Selections()"; - $function[] = $this->_t(1) . "{"; - $function[] = $this->_t(2) . "//".$this->setLine(__LINE__)." Get a db connection."; - $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; - $function[] = PHP_EOL.$this->_t(2) . "//".$this->setLine(__LINE__)." Select the text."; - $function[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; - $function[] = PHP_EOL.$this->_t(2) . "//".$this->setLine(__LINE__)." Select the text."; - $function[] = $this->_t(2) . "\$query->select(\$db->quoteName(array('".$filter['custom']['id']."','".$filter['custom']['text']."')));"; - $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('".$filter['custom']['table']."'));"; - $function[] = $this->_t(2) . "\$query->where(\$db->quoteName('published') . ' = 1');"; - $function[] = $this->_t(2) . "\$query->order(\$db->quoteName('".$filter['custom']['text']."') . ' ASC');"; - $function[] = PHP_EOL.$this->_t(2) . "//".$this->setLine(__LINE__)." Reset the query using our newly populated query object."; - $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $function[] = PHP_EOL.$this->_t(2) . "\$results = \$db->loadObjectList();"; - $function[] = PHP_EOL.$this->_t(2) . "if (\$results)"; - $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) . "\$filter = array();"; - $function[] = $this->_t(3) . "\$batch = array();"; - $function[] = $this->_t(3) . "foreach (\$results as \$result)"; - $function[] = $this->_t(3) . "{"; + $function[] = PHP_EOL.Indent::_(1) . "protected function getThe".$filter['function'].StringHelper::safe($filter['custom']['text'],'F')."Selections()"; + $function[] = Indent::_(1) . "{"; + $function[] = Indent::_(2) . "//".Line::_(__Line__, __Class__)." Get a db connection."; + $function[] = Indent::_(2) . "\$db = JFactory::getDbo();"; + $function[] = PHP_EOL.Indent::_(2) . "//".Line::_(__Line__, __Class__)." Select the text."; + $function[] = Indent::_(2) . "\$query = \$db->getQuery(true);"; + $function[] = PHP_EOL.Indent::_(2) . "//".Line::_(__Line__, __Class__)." Select the text."; + $function[] = Indent::_(2) . "\$query->select(\$db->quoteName(array('".$filter['custom']['id']."','".$filter['custom']['text']."')));"; + $function[] = Indent::_(2) . "\$query->from(\$db->quoteName('".$filter['custom']['table']."'));"; + $function[] = Indent::_(2) . "\$query->where(\$db->quoteName('published') . ' = 1');"; + $function[] = Indent::_(2) . "\$query->order(\$db->quoteName('".$filter['custom']['text']."') . ' ASC');"; + $function[] = PHP_EOL.Indent::_(2) . "//".Line::_(__Line__, __Class__)." Reset the query using our newly populated query object."; + $function[] = Indent::_(2) . "\$db->setQuery(\$query);"; + $function[] = PHP_EOL.Indent::_(2) . "\$results = \$db->loadObjectList();"; + $function[] = PHP_EOL.Indent::_(2) . "if (\$results)"; + $function[] = Indent::_(2) . "{"; + $function[] = Indent::_(3) . "\$filter = array();"; + $function[] = Indent::_(3) . "\$batch = array();"; + $function[] = Indent::_(3) . "foreach (\$results as \$result)"; + $function[] = Indent::_(3) . "{"; if ($filter['custom']['text'] === 'user') { - $function[] = $this->_t(4) . "\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; - $function[] = $this->_t(4) . "\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; + $function[] = Indent::_(4) . "\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; + $function[] = Indent::_(4) . "\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; } else { - $function[] = $this->_t(4) . "\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", \$result->".$filter['custom']['text'].");"; - $function[] = $this->_t(4) . "\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", \$result->".$filter['custom']['text'].");"; + $function[] = Indent::_(4) . "\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", \$result->".$filter['custom']['text'].");"; + $function[] = Indent::_(4) . "\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", \$result->".$filter['custom']['text'].");"; } - $function[] = $this->_t(3) . "}"; - $function[] = $this->_t(3) . "return array('filter' => \$filter, 'batch' => \$batch);"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "return false;"; - $function[] = $this->_t(1) . "}"; + $function[] = Indent::_(3) . "}"; + $function[] = Indent::_(3) . "return array('filter' => \$filter, 'batch' => \$batch);"; + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "return false;"; + $function[] = Indent::_(1) . "}"; } */ } elseif ($filter['type'] != 'category' @@ -18278,139 +18097,139 @@ class Interpretation extends Fields // add if this is a function path if ($funtion_path) { - $function[] = PHP_EOL . $this->_t(1) + $function[] = PHP_EOL . Indent::_(1) . "protected function getThe" . $filter['function'] . "Selections()"; - $function[] = $this->_t(1) . "{"; - $function[] = $this->_t(2) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(1) . "{"; + $function[] = Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get a db connection."; } else { - $function[] = "//" . $this->setLine(__LINE__) + $function[] = "//" . Line::_(__Line__, __Class__) . " Get a db connection."; } - $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $function[] = Indent::_(2) . "\$db = JFactory::getDbo();"; + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Create a new query object."; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query = \$db->getQuery(true);"; // check if usergroup as we change to an object query if ($filter['type'] === 'usergroup') { - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Select the text."; - $function[] = $this->_t(2) + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Select the text."; + $function[] = Indent::_(2) . "\$query->select(\$db->quoteName('g." . $filter['code'] . "', 'id'));"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->select(\$db->quoteName('ug.title', 'title'));"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "', 'g'));"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->join('LEFT', \$db->quoteName('#__usergroups', 'ug') . ' ON (' . (\$db->quoteName('g." . $filter['code'] . "') . ' = ' . \$db->quoteName('ug.id') . ')'));"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->order(\$db->quoteName('title') . ' ASC');"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->group(\$db->quoteName('ug.id'));"; - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Reset the query using our newly populated query object."; - $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $function[] = PHP_EOL . $this->_t(2) + $function[] = Indent::_(2) . "\$db->setQuery(\$query);"; + $function[] = PHP_EOL . Indent::_(2) . "\$results = \$db->loadObjectList();"; } else { - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Select the text."; - $function[] = $this->_t(2) + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Select the text."; + $function[] = Indent::_(2) . "\$query->select(\$db->quoteName('" . $filter['code'] . "'));"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "'));"; - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$query->order(\$db->quoteName('" . $filter['code'] . "') . ' ASC');"; - $function[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) + $function[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Reset the query using our newly populated query object."; - $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $function[] = PHP_EOL . $this->_t(2) + $function[] = Indent::_(2) . "\$db->setQuery(\$query);"; + $function[] = PHP_EOL . Indent::_(2) . "\$results = \$db->loadColumn();"; } - $function[] = $this->_t(2) . "\$_filter = array();"; + $function[] = Indent::_(2) . "\$_filter = array();"; // if this is not a multi field if (!$funtion_path && $filter['multi'] == 1) { - $function[] = $this->_t(2) + $function[] = Indent::_(2) . "\$_filter[] = JHtml::_('select.option', '', '- ' . JText:" . ":_('" . $filter['lang_select'] . "') . ' -');"; } - $function[] = PHP_EOL . $this->_t(2) . "if (\$results)"; - $function[] = $this->_t(2) . "{"; + $function[] = PHP_EOL . Indent::_(2) . "if (\$results)"; + $function[] = Indent::_(2) . "{"; // check if translated value is used if ($funtion_path && $translation) { - $function[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " get model"; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "\$model = \$this->getModel();"; } elseif ($translation) { - $function[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " get " . $nameListCode . "model"; - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "\$model = " . $Component . "Helper::getModel('" . $nameListCode . "');"; } // check if usergroup as we change to an object query if ($filter['type'] !== 'usergroup') { - $function[] = $this->_t(3) + $function[] = Indent::_(3) . "\$results = array_unique(\$results);"; } - $function[] = $this->_t(3) . "foreach (\$results as \$" + $function[] = Indent::_(3) . "foreach (\$results as \$" . $filter['code'] . ")"; - $function[] = $this->_t(3) . "{"; + $function[] = Indent::_(3) . "{"; // check if translated value is used if ($translation) { - $function[] = $this->_t(4) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Translate the " . $filter['code'] . " selection"; - $function[] = $this->_t(4) + $function[] = Indent::_(4) . "\$text = \$model->selectionTranslation(\$" . $filter['code'] . ",'" . $filter['code'] . "');"; - $function[] = $this->_t(4) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) + $function[] = Indent::_(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JText:" . ":_(\$text));"; } elseif ($filter['type'] === 'user') { - $function[] = $this->_t(4) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) + $function[] = Indent::_(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JFactory::getUser(\$" . $filter['code'] . ")->name);"; @@ -18419,34 +18238,34 @@ class Interpretation extends Fields { if ($filter['type'] === 'usergroup') { - $function[] = $this->_t(4) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) + $function[] = Indent::_(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . "->id, \$" . $filter['code'] . "->title);"; } else { - $function[] = $this->_t(4) . "//" . $this->setLine( - __LINE__ + $function[] = Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) + $function[] = Indent::_(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", \$" . $filter['code'] . ");"; } } - $function[] = $this->_t(3) . "}"; - $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "return \$_filter;"; + $function[] = Indent::_(3) . "}"; + $function[] = Indent::_(2) . "}"; + $function[] = Indent::_(2) . "return \$_filter;"; // add if this is a function path if ($funtion_path) { - $function[] = $this->_t(1) . "}"; + $function[] = Indent::_(1) . "}"; } } // we check if this is a multi field @@ -18476,7 +18295,7 @@ class Interpretation extends Fields . $filter['id'] . '" target="_blank"'; $field_fix = "
    if (\$this->multiple === false) { // <-- this if statement is needed";
    -						$field_fix .= PHP_EOL . $this->_t(1)
    +						$field_fix .= PHP_EOL . Indent::_(1)
     							. "\$options[] = JHtml::_('select.option', '', 'Select an option'); // <-- the empty option";
     						$field_fix .= PHP_EOL . "}
    "; $this->app->enqueueMessage( @@ -18517,30 +18336,30 @@ class Interpretation extends Fields public function setUniqueFields(&$view) { $fields = array(); - $fields[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $fields[] = $this->_t(1) + $fields[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $fields[] = Indent::_(1) . " * Method to get the unique fields of this table."; - $fields[] = $this->_t(1) . " *"; - $fields[] = $this->_t(1) + $fields[] = Indent::_(1) . " *"; + $fields[] = Indent::_(1) . " * @return mixed An array of field names, boolean false if none is set."; - $fields[] = $this->_t(1) . " *"; - $fields[] = $this->_t(1) . " * @since 3.0"; - $fields[] = $this->_t(1) . " */"; - $fields[] = $this->_t(1) . "protected function getUniqueFields()"; - $fields[] = $this->_t(1) . "{"; + $fields[] = Indent::_(1) . " *"; + $fields[] = Indent::_(1) . " * @since 3.0"; + $fields[] = Indent::_(1) . " */"; + $fields[] = Indent::_(1) . "protected function getUniqueFields()"; + $fields[] = Indent::_(1) . "{"; if (isset($this->dbUniqueKeys[$view]) && ArrayHelper::check($this->dbUniqueKeys[$view])) { // if guid should also be added if (isset($this->dbUniqueGuid[$view])) { - $fields[] = $this->_t(2) . "return array('" . implode( + $fields[] = Indent::_(2) . "return array('" . implode( "','", $this->dbUniqueKeys[$view] ) . "', 'guid');"; } else { - $fields[] = $this->_t(2) . "return array('" . implode( + $fields[] = Indent::_(2) . "return array('" . implode( "','", $this->dbUniqueKeys[$view] ) . "');"; } @@ -18548,13 +18367,13 @@ class Interpretation extends Fields // if only GUID is found elseif (isset($this->dbUniqueGuid[$view])) { - $fields[] = $this->_t(2) . "return array('guid');"; + $fields[] = Indent::_(2) . "return array('guid');"; } else { - $fields[] = $this->_t(2) . "return false;"; + $fields[] = Indent::_(2) . "return false;"; } - $fields[] = $this->_t(1) . "}"; + $fields[] = Indent::_(1) . "}"; // return the unique fields return implode(PHP_EOL, $fields); @@ -18590,8 +18409,7 @@ class Interpretation extends Fields )) { // get component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; // load the rest of the filters foreach ($this->filterBuilder[$nameListCode] as $filter) { @@ -18609,53 +18427,53 @@ class Interpretation extends Fields $type = StringHelper::safe( $filter['custom']['type'], 'F' ); - $fieldFilters[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Set " . $CodeName + $fieldFilters[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Set " . $CodeName . " Selection"; - $fieldFilters[] = $this->_t(2) . "\$this->" . $codeName + $fieldFilters[] = Indent::_(2) . "\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->options;"; - $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( - __LINE__ + $fieldFilters[] = Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " We do some sanitation for " . $CodeName . " filter"; - $fieldFilters[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = Indent::_(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $codeName . "Options) &&"; - $fieldFilters[] = $this->_t(3) . "isset(\$this->" + $fieldFilters[] = Indent::_(3) . "isset(\$this->" . $codeName . "Options[0]->value) &&"; - $fieldFilters[] = $this->_t(3) . "!" . $Component + $fieldFilters[] = Indent::_(3) . "!" . $Component . "Helper::checkString(\$this->" . $codeName . "Options[0]->value))"; - $fieldFilters[] = $this->_t(2) . "{"; - $fieldFilters[] = $this->_t(3) . "unset(\$this->" + $fieldFilters[] = Indent::_(2) . "{"; + $fieldFilters[] = Indent::_(3) . "unset(\$this->" . $codeName . "Options[0]);"; - $fieldFilters[] = $this->_t(2) . "}"; - $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( - __LINE__ + $fieldFilters[] = Indent::_(2) . "}"; + $fieldFilters[] = Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Only load " . $CodeName . " filter if it has values"; - $fieldFilters[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = Indent::_(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $codeName . "Options))"; - $fieldFilters[] = $this->_t(2) . "{"; - $fieldFilters[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fieldFilters[] = Indent::_(2) . "{"; + $fieldFilters[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " " . $CodeName . " Filter"; - $fieldFilters[] = $this->_t(3) . "JHtmlSidebar::addFilter("; - $fieldFilters[] = $this->_t(4) . "'- Select ' . JText:" + $fieldFilters[] = Indent::_(3) . "JHtmlSidebar::addFilter("; + $fieldFilters[] = Indent::_(4) . "'- Select ' . JText:" . ":_('" . $filter['lang'] . "') . ' -',"; - $fieldFilters[] = $this->_t(4) . "'filter_" + $fieldFilters[] = Indent::_(4) . "'filter_" . $filter['code'] . "',"; - $fieldFilters[] = $this->_t(4) + $fieldFilters[] = Indent::_(4) . "JHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; - $fieldFilters[] = $this->_t(3) . ");"; - $fieldFilters[] = $this->_t(2) . "}"; + $fieldFilters[] = Indent::_(3) . ");"; + $fieldFilters[] = Indent::_(2) . "}"; } elseif ($filter['type'] != 'category') { @@ -18676,53 +18494,53 @@ class Interpretation extends Fields $functionName = "\$this->getThe" . $filter['function'] . "Selections();"; } - $fieldFilters[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Set " . $Codename + $fieldFilters[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Set " . $Codename . " Selection"; - $fieldFilters[] = $this->_t(2) . "\$this->" + $fieldFilters[] = Indent::_(2) . "\$this->" . $filter['code'] . "Options = " . $functionName; - $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( - __LINE__ + $fieldFilters[] = Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " We do some sanitation for " . $Codename . " filter"; - $fieldFilters[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = Indent::_(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $filter['code'] . "Options) &&"; - $fieldFilters[] = $this->_t(3) . "isset(\$this->" + $fieldFilters[] = Indent::_(3) . "isset(\$this->" . $filter['code'] . "Options[0]->value) &&"; - $fieldFilters[] = $this->_t(3) . "!" . $Component + $fieldFilters[] = Indent::_(3) . "!" . $Component . "Helper::checkString(\$this->" . $filter['code'] . "Options[0]->value))"; - $fieldFilters[] = $this->_t(2) . "{"; - $fieldFilters[] = $this->_t(3) . "unset(\$this->" + $fieldFilters[] = Indent::_(2) . "{"; + $fieldFilters[] = Indent::_(3) . "unset(\$this->" . $filter['code'] . "Options[0]);"; - $fieldFilters[] = $this->_t(2) . "}"; - $fieldFilters[] = $this->_t(2) . "//" . $this->setLine( - __LINE__ + $fieldFilters[] = Indent::_(2) . "}"; + $fieldFilters[] = Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Only load " . $Codename . " filter if it has values"; - $fieldFilters[] = $this->_t(2) . "if (" . $Component + $fieldFilters[] = Indent::_(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $filter['code'] . "Options))"; - $fieldFilters[] = $this->_t(2) . "{"; - $fieldFilters[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fieldFilters[] = Indent::_(2) . "{"; + $fieldFilters[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " " . $Codename . " Filter"; - $fieldFilters[] = $this->_t(3) . "JHtmlSidebar::addFilter("; - $fieldFilters[] = $this->_t(4) . "'- Select '.JText:" + $fieldFilters[] = Indent::_(3) . "JHtmlSidebar::addFilter("; + $fieldFilters[] = Indent::_(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $fieldFilters[] = $this->_t(4) . "'filter_" + $fieldFilters[] = Indent::_(4) . "'filter_" . $filter['code'] . "',"; - $fieldFilters[] = $this->_t(4) + $fieldFilters[] = Indent::_(4) . "JHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; - $fieldFilters[] = $this->_t(3) . ");"; + $fieldFilters[] = Indent::_(3) . ");"; - $fieldFilters[] = $this->_t(2) . "}"; + $fieldFilters[] = Indent::_(2) . "}"; } } } @@ -18755,20 +18573,20 @@ class Interpretation extends Fields && $this->adminFilterType[$nameListCode] == 1) { // set batch - $filter[] = PHP_EOL . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $filter[] = PHP_EOL . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Only load publish filter if state change is allowed"; - $filter[] = $this->_t(2) + $filter[] = Indent::_(2) . "if (\$this->canState)"; - $filter[] = $this->_t(2) . "{"; - $filter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; - $filter[] = $this->_t(4) . "JText:" + $filter[] = Indent::_(2) . "{"; + $filter[] = Indent::_(3) . "JHtmlSidebar::addFilter("; + $filter[] = Indent::_(4) . "JText:" . ":_('JOPTION_SELECT_PUBLISHED'),"; - $filter[] = $this->_t(4) . "'filter_published',"; - $filter[] = $this->_t(4) + $filter[] = Indent::_(4) . "'filter_published',"; + $filter[] = Indent::_(4) . "JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', \$this->state->get('filter.published'), true)"; - $filter[] = $this->_t(3) . ");"; - $filter[] = $this->_t(2) . "}"; + $filter[] = Indent::_(3) . ");"; + $filter[] = Indent::_(2) . "}"; // check if view has access if (isset($this->accessBuilder[$nameSingleCode]) && StringHelper::check( @@ -18776,13 +18594,13 @@ class Interpretation extends Fields ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) { - $filter[] = PHP_EOL . $this->_t(2) . "JHtmlSidebar::addFilter("; - $filter[] = $this->_t(3) . "JText:" + $filter[] = PHP_EOL . Indent::_(2) . "JHtmlSidebar::addFilter("; + $filter[] = Indent::_(3) . "JText:" . ":_('JOPTION_SELECT_ACCESS'),"; - $filter[] = $this->_t(3) . "'filter_access',"; - $filter[] = $this->_t(3) + $filter[] = Indent::_(3) . "'filter_access',"; + $filter[] = Indent::_(3) . "JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', \$this->state->get('filter.access'))"; - $filter[] = $this->_t(2) . ");"; + $filter[] = Indent::_(2) . ");"; } } } @@ -18810,17 +18628,17 @@ class Interpretation extends Fields && $this->categoryBuilder[$nameListCode]['filter'] >= 1) { // set filter - $filter[] = PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Category Filter."; - $filter[] = $this->_t(2) . "JHtmlSidebar::addFilter("; - $filter[] = $this->_t(3) . "JText:" + $filter[] = PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Category Filter."; + $filter[] = Indent::_(2) . "JHtmlSidebar::addFilter("; + $filter[] = Indent::_(3) . "JText:" . ":_('JOPTION_SELECT_CATEGORY'),"; - $filter[] = $this->_t(3) . "'filter_category_id',"; - $filter[] = $this->_t(3) + $filter[] = Indent::_(3) . "'filter_category_id',"; + $filter[] = Indent::_(3) . "JHtml::_('select.options', JHtml::_('category.options', '" . $this->categoryBuilder[$nameListCode]['extension'] . "'), 'value', 'text', \$this->state->get('filter.category_id'))"; - $filter[] = $this->_t(2) . ");"; + $filter[] = Indent::_(2) . ");"; } } @@ -18856,8 +18674,7 @@ class Interpretation extends Fields $get_values = true; } // get component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh]; + $Component = $this->fileContentStatic[Placefix::_h('Component')]; // load the rest of the batch options foreach ($this->filterBuilder[$nameListCode] as $filter) { @@ -18872,58 +18689,58 @@ class Interpretation extends Fields . StringHelper::safe( $filter['custom']['text'], 'F' ); - $fieldBatch[] = PHP_EOL . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $fieldBatch[] = PHP_EOL . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Only load " . $CodeName . " batch if create, edit, and batch is allowed"; - $fieldBatch[] = $this->_t(2) + $fieldBatch[] = Indent::_(2) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $fieldBatch[] = $this->_t(2) . "{"; + $fieldBatch[] = Indent::_(2) . "{"; // add the get values here if ($get_values) { $type = StringHelper::safe( $filter['custom']['type'], 'F' ); - $fieldBatch[] = $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Set " . $CodeName + $fieldBatch[] = Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Set " . $CodeName . " Selection"; - $fieldBatch[] = $this->_t(3) . "\$this->" . $codeName + $fieldBatch[] = Indent::_(3) . "\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->options;"; - $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fieldBatch[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " We do some sanitation for " . $CodeName . " filter"; - $fieldBatch[] = $this->_t(3) . "if (" . $Component + $fieldBatch[] = Indent::_(3) . "if (" . $Component . "Helper::checkArray(\$this->" . $codeName . "Options) &&"; - $fieldBatch[] = $this->_t(4) . "isset(\$this->" + $fieldBatch[] = Indent::_(4) . "isset(\$this->" . $codeName . "Options[0]->value) &&"; - $fieldBatch[] = $this->_t(4) . "!" . $Component + $fieldBatch[] = Indent::_(4) . "!" . $Component . "Helper::checkString(\$this->" . $codeName . "Options[0]->value))"; - $fieldBatch[] = $this->_t(3) . "{"; - $fieldBatch[] = $this->_t(4) . "unset(\$this->" + $fieldBatch[] = Indent::_(3) . "{"; + $fieldBatch[] = Indent::_(4) . "unset(\$this->" . $codeName . "Options[0]);"; - $fieldBatch[] = $this->_t(3) . "}"; + $fieldBatch[] = Indent::_(3) . "}"; } - $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fieldBatch[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " " . $CodeName . " Batch Selection"; - $fieldBatch[] = $this->_t(3) + $fieldBatch[] = Indent::_(3) . "JHtmlBatch_::addListSelection("; - $fieldBatch[] = $this->_t(4) . "'- Keep Original '.JText:" + $fieldBatch[] = Indent::_(4) . "'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $fieldBatch[] = $this->_t(4) . "'batch[" . $filter['code'] + $fieldBatch[] = Indent::_(4) . "'batch[" . $filter['code'] . "]',"; - $fieldBatch[] = $this->_t(4) + $fieldBatch[] = Indent::_(4) . "JHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text')"; - $fieldBatch[] = $this->_t(3) . ");"; - $fieldBatch[] = $this->_t(2) . "}"; + $fieldBatch[] = Indent::_(3) . ");"; + $fieldBatch[] = Indent::_(2) . "}"; } elseif ($filter['type'] != 'category') { @@ -18931,55 +18748,55 @@ class Interpretation extends Fields $filter['code'], 'W' ); - $fieldBatch[] = PHP_EOL . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $fieldBatch[] = PHP_EOL . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Only load " . $CodeName . " batch if create, edit, and batch is allowed"; - $fieldBatch[] = $this->_t(2) + $fieldBatch[] = Indent::_(2) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $fieldBatch[] = $this->_t(2) . "{"; + $fieldBatch[] = Indent::_(2) . "{"; // add the get values here if ($get_values) { - $fieldBatch[] = $this->_t(3) . "//" - . $this->setLine(__LINE__) . " Set " . $CodeName + $fieldBatch[] = Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Set " . $CodeName . " Selection"; - $fieldBatch[] = $this->_t(3) . "\$this->" + $fieldBatch[] = Indent::_(3) . "\$this->" . $filter['code'] . "Options = JFormHelper::loadFieldType('" . $filter['filter_type'] . "')->options;"; - $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fieldBatch[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " We do some sanitation for " . $CodeName . " filter"; - $fieldBatch[] = $this->_t(3) . "if (" . $Component + $fieldBatch[] = Indent::_(3) . "if (" . $Component . "Helper::checkArray(\$this->" . $filter['code'] . "Options) &&"; - $fieldBatch[] = $this->_t(4) . "isset(\$this->" + $fieldBatch[] = Indent::_(4) . "isset(\$this->" . $filter['code'] . "Options[0]->value) &&"; - $fieldBatch[] = $this->_t(4) . "!" . $Component + $fieldBatch[] = Indent::_(4) . "!" . $Component . "Helper::checkString(\$this->" . $filter['code'] . "Options[0]->value))"; - $fieldBatch[] = $this->_t(3) . "{"; - $fieldBatch[] = $this->_t(4) . "unset(\$this->" + $fieldBatch[] = Indent::_(3) . "{"; + $fieldBatch[] = Indent::_(4) . "unset(\$this->" . $filter['code'] . "Options[0]);"; - $fieldBatch[] = $this->_t(3) . "}"; + $fieldBatch[] = Indent::_(3) . "}"; } - $fieldBatch[] = $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fieldBatch[] = Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " " . $CodeName . " Batch Selection"; - $fieldBatch[] = $this->_t(3) + $fieldBatch[] = Indent::_(3) . "JHtmlBatch_::addListSelection("; - $fieldBatch[] = $this->_t(4) . "'- Keep Original '.JText:" + $fieldBatch[] = Indent::_(4) . "'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $fieldBatch[] = $this->_t(4) . "'batch[" . $filter['code'] + $fieldBatch[] = Indent::_(4) . "'batch[" . $filter['code'] . "]',"; - $fieldBatch[] = $this->_t(4) + $fieldBatch[] = Indent::_(4) . "JHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text')"; - $fieldBatch[] = $this->_t(3) . ");"; - $fieldBatch[] = $this->_t(2) . "}"; + $fieldBatch[] = Indent::_(3) . ");"; + $fieldBatch[] = Indent::_(2) . "}"; } } } @@ -19009,20 +18826,20 @@ class Interpretation extends Fields $this->componentData->name_code, 'U' ); // set batch - $batch[] = PHP_EOL . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $batch[] = PHP_EOL . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Only load published batch if state and batch is allowed"; - $batch[] = $this->_t(2) + $batch[] = Indent::_(2) . "if (\$this->canState && \$this->canBatch)"; - $batch[] = $this->_t(2) . "{"; - $batch[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; - $batch[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT + $batch[] = Indent::_(2) . "{"; + $batch[] = Indent::_(3) . "JHtmlBatch_::addListSelection("; + $batch[] = Indent::_(4) . "JText:" . ":_('COM_" . $COPMONENT . "_KEEP_ORIGINAL_STATE'),"; - $batch[] = $this->_t(4) . "'batch[published]',"; - $batch[] = $this->_t(4) + $batch[] = Indent::_(4) . "'batch[published]',"; + $batch[] = Indent::_(4) . "JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)"; - $batch[] = $this->_t(3) . ");"; - $batch[] = $this->_t(2) . "}"; + $batch[] = Indent::_(3) . ");"; + $batch[] = Indent::_(2) . "}"; // check if view has access if (isset($this->accessBuilder[$nameSingleCode]) && StringHelper::check( @@ -19030,20 +18847,20 @@ class Interpretation extends Fields ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) { - $batch[] = PHP_EOL . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $batch[] = PHP_EOL . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Only load access batch if create, edit and batch is allowed"; - $batch[] = $this->_t(2) + $batch[] = Indent::_(2) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $batch[] = $this->_t(2) . "{"; - $batch[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; - $batch[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT + $batch[] = Indent::_(2) . "{"; + $batch[] = Indent::_(3) . "JHtmlBatch_::addListSelection("; + $batch[] = Indent::_(4) . "JText:" . ":_('COM_" . $COPMONENT . "_KEEP_ORIGINAL_ACCESS'),"; - $batch[] = $this->_t(4) . "'batch[access]',"; - $batch[] = $this->_t(4) + $batch[] = Indent::_(4) . "'batch[access]',"; + $batch[] = Indent::_(4) . "JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')"; - $batch[] = $this->_t(3) . ");"; - $batch[] = $this->_t(2) . "}"; + $batch[] = Indent::_(3) . ");"; + $batch[] = Indent::_(2) . "}"; } } @@ -19069,21 +18886,21 @@ class Interpretation extends Fields $this->componentData->name_code, 'U' ); // set filter - $batch[] = PHP_EOL . $this->_t(2) + $batch[] = PHP_EOL . Indent::_(2) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $batch[] = $this->_t(2) . "{"; - $batch[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $batch[] = Indent::_(2) . "{"; + $batch[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Category Batch selection."; - $batch[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; - $batch[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT + $batch[] = Indent::_(3) . "JHtmlBatch_::addListSelection("; + $batch[] = Indent::_(4) . "JText:" . ":_('COM_" . $COPMONENT . "_KEEP_ORIGINAL_CATEGORY'),"; - $batch[] = $this->_t(4) . "'batch[category]',"; - $batch[] = $this->_t(4) + $batch[] = Indent::_(4) . "'batch[category]',"; + $batch[] = Indent::_(4) . "JHtml::_('select.options', JHtml::_('category.options', '" . $this->categoryBuilder[$nameListCode]['extension'] . "'), 'value', 'text')"; - $batch[] = $this->_t(3) . ");"; - $batch[] = $this->_t(2) . "}"; + $batch[] = Indent::_(3) . ");"; + $batch[] = Indent::_(2) . "}"; } } @@ -19121,68 +18938,59 @@ class Interpretation extends Fields $otherView = $nameSingleCode; } // set the OtherView value - $this->fileContentDynamic['category' . $otherView][$this->hhh - . 'otherview' . $this->hhh] + $this->fileContentDynamic['category' . $otherView][Placefix::_h('otherview')] = $otherView; // load the category helper details in not already loaded if (!isset( - $this->fileContentDynamic['category' . $otherView][$this->hhh - . 'view' . $this->hhh] + $this->fileContentDynamic['category' . $otherView][Placefix::_h('view')] )) { // lets also set the category helper for this view $target = array('site' => 'category' . $otherView); $this->buildDynamique($target, 'category'); // insure the file gets updated - $this->fileContentDynamic['category' . $otherView][$this->hhh - . 'view' . $this->hhh] + $this->fileContentDynamic['category' . $otherView][Placefix::_h('view')] = $otherView; - $this->fileContentDynamic['category' . $otherView][$this->hhh - . 'View' . $this->hhh] + $this->fileContentDynamic['category' . $otherView][Placefix::_h('View')] = ucfirst($otherView); - $this->fileContentDynamic['category' . $otherView][$this->hhh - . 'views' . $this->hhh] + $this->fileContentDynamic['category' . $otherView][Placefix::_h('views')] = $otherViews; - $this->fileContentDynamic['category' . $otherView][$this->hhh - . 'Views' . $this->hhh] + $this->fileContentDynamic['category' . $otherView][Placefix::_h('Views')] = ucfirst($otherViews); // set script to global helper file $includeHelper = array(); - $includeHelper[] = "\n//" . $this->setLine(__LINE__) + $includeHelper[] = "\n//" . Line::_(__Line__, __Class__) . "Insure this view category file is loaded."; $includeHelper[] = "\$classname = '" . ucfirst($component) . ucfirst($otherView) . "Categories';"; $includeHelper[] = "if (!class_exists(\$classname))"; $includeHelper[] = "{"; - $includeHelper[] = $this->_t(1) + $includeHelper[] = Indent::_(1) . "\$path = JPATH_SITE . '/components/com_" . $component . "/helpers/category" . $otherView . ".php';"; - $includeHelper[] = $this->_t(1) . "if (is_file(\$path))"; - $includeHelper[] = $this->_t(1) . "{"; - $includeHelper[] = $this->_t(2) . "include_once \$path;"; - $includeHelper[] = $this->_t(1) . "}"; + $includeHelper[] = Indent::_(1) . "if (is_file(\$path))"; + $includeHelper[] = Indent::_(1) . "{"; + $includeHelper[] = Indent::_(2) . "include_once \$path;"; + $includeHelper[] = Indent::_(1) . "}"; $includeHelper[] = "}"; - $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('CATEGORY_CLASS_TREES')] .= implode("\n", $includeHelper); } // return category view string if (isset( - $this->fileContentStatic[$this->hhh - . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] ) && StringHelper::check( - $this->fileContentStatic[$this->hhh - . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] )) { - return "," . PHP_EOL . $this->_t(3) . '"' + return "," . PHP_EOL . Indent::_(3) . '"' . $this->categoryBuilder[$nameListCode]['extension'] . '" => "' . $otherView . '"'; } else { - return PHP_EOL . $this->_t(3) . '"' + return PHP_EOL . Indent::_(3) . '"' . $this->categoryBuilder[$nameListCode]['extension'] . '" => "' . $otherView . '"'; } @@ -19225,9 +19033,9 @@ class Interpretation extends Fields $otherView = $nameSingleCode; } // setup the category script - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get the user object"; - $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "\$user = JFactory::getUser();"; // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) @@ -19239,29 +19047,29 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Access check."; - $allow[] = $this->_t(2) . "\$access = \$user->authorise('" + $allow[] = Indent::_(2) . "\$access = \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; - $allow[] = $this->_t(2) . "if (!\$access)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "return false;"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; } - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "\$categoryId = ArrayHelper::getValue(\$data, 'catid', \$this->input->getInt('filter_category_id'), 'int');"; - $allow[] = $this->_t(2) . "\$allow = null;"; - $allow[] = PHP_EOL . $this->_t(2) . "if (\$categoryId)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "\$allow = null;"; + $allow[] = PHP_EOL . Indent::_(2) . "if (\$categoryId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " If the category has been passed in the URL check it."; - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "\$allow = \$user->authorise('core.create', \$this->option . '." . $otherView . ".category.' . \$categoryId);"; - $allow[] = $this->_t(2) . "}"; - $allow[] = PHP_EOL . $this->_t(2) . "if (\$allow === null)"; - $allow[] = $this->_t(2) . "{"; + $allow[] = Indent::_(2) . "}"; + $allow[] = PHP_EOL . Indent::_(2) . "if (\$allow === null)"; + $allow[] = Indent::_(2) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) @@ -19274,29 +19082,29 @@ class Interpretation extends Fields )) { // setup the default script - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(3) . "return \$user->authorise('" + $allow[] = Indent::_(3) . "return \$user->authorise('" . $core['core.create'] . "', \$this->option);"; } else { // setup the default script - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(3) . "return parent::allowAdd(\$data);"; + $allow[] = Indent::_(3) . "return parent::allowAdd(\$data);"; } - $allow[] = $this->_t(2) . "}"; - $allow[] = $this->_t(2) . "else"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "return \$allow;"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(2) . "}"; + $allow[] = Indent::_(2) . "else"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return \$allow;"; + $allow[] = Indent::_(2) . "}"; } else { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get user object."; - $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "\$user = JFactory::getUser();"; // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) @@ -19308,14 +19116,14 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Access check."; - $allow[] = $this->_t(2) . "\$access = \$user->authorise('" + $allow[] = Indent::_(2) . "\$access = \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; - $allow[] = $this->_t(2) . "if (!\$access)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "return false;"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; } // load custom permission script $allow[] = $customAllow; @@ -19331,17 +19139,17 @@ class Interpretation extends Fields )) { // setup the default script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" + $allow[] = Indent::_(2) . "return \$user->authorise('" . $core['core.create'] . "', \$this->option);"; } else { // setup the default script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return parent::allowAdd(\$data);"; + $allow[] = Indent::_(2) . "return parent::allowAdd(\$data);"; } } @@ -19384,12 +19192,12 @@ class Interpretation extends Fields $otherView = $nameSingleCode; } // setup the category script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get user object."; - $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get record id."; - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; // load custom permission script $allow[] = $customAllow; @@ -19404,22 +19212,22 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Access check."; - $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; - $allow[] = $this->_t(2) . "if (!\$access)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "return false;"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; } - $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) @@ -19431,18 +19239,18 @@ class Interpretation extends Fields $otherView, $this->permissionBuilder[$core['core.edit']] )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; } - $allow[] = $this->_t(3) . "if (!\$permission)"; - $allow[] = $this->_t(3) . "{"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) @@ -19453,37 +19261,37 @@ class Interpretation extends Fields $otherView, $this->permissionBuilder[$core['core.edit.own']] )) { - $allow[] = $this->_t(4) . "if (\$user->authorise('" + $allow[] = Indent::_(4) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; } else { - $allow[] = $this->_t(4) + $allow[] = Indent::_(4) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; } - $allow[] = $this->_t(4) . "{"; - $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Fallback on edit.own. Now test the owner is the user."; - $allow[] = $this->_t(5) + $allow[] = Indent::_(5) . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; - $allow[] = $this->_t(5) . "if (empty(\$ownerId))"; - $allow[] = $this->_t(5) . "{"; - $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) . " Need to do a lookup from the model."; - $allow[] = $this->_t(6) + $allow[] = Indent::_(6) . "\$record = \$this->getModel()->getItem(\$recordId);"; - $allow[] = PHP_EOL . $this->_t(6) . "if (empty(\$record))"; - $allow[] = $this->_t(6) . "{"; - $allow[] = $this->_t(7) . "return false;"; - $allow[] = $this->_t(6) . "}"; - $allow[] = $this->_t(6) . "\$ownerId = \$record->created_by;"; - $allow[] = $this->_t(5) . "}"; - $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " If the owner matches 'me' then do the test."; - $allow[] = $this->_t(5) . "if (\$ownerId == \$user->id)"; - $allow[] = $this->_t(5) . "{"; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) @@ -19495,33 +19303,33 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.own']] )) { - $allow[] = $this->_t(6) . "if (\$user->authorise('" + $allow[] = Indent::_(6) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; } else { - $allow[] = $this->_t(6) + $allow[] = Indent::_(6) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; } - $allow[] = $this->_t(6) . "{"; - $allow[] = $this->_t(7) . "return true;"; - $allow[] = $this->_t(6) . "}"; - $allow[] = $this->_t(5) . "}"; - $allow[] = $this->_t(4) . "}"; - $allow[] = $this->_t(4) . "return false;"; - $allow[] = $this->_t(3) . "}"; -// $allow[] = PHP_EOL.$this->_t(3) . "\$categoryId = (int) isset(\$data['catid']) ? \$data['catid']: \$this->getModel()->getItem(\$recordId)->catid;"; <-- remove category from check -// $allow[] = PHP_EOL.$this->_t(3) . "if (\$categoryId)"; -// $allow[] = $this->_t(3) . "{"; -// $allow[] = $this->_t(4) . "//".$this->setLine(__LINE__)." The category has been set. Check the category permissions."; -// $allow[] = $this->_t(4) . "\$catpermission = \$user->authorise('core.edit', \$this->option . '.".$otherView.".category.' . \$categoryId);"; -// $allow[] = $this->_t(4) . "if (!\$catpermission && !is_null(\$catpermission))"; -// $allow[] = $this->_t(4) . "{"; -// $allow[] = $this->_t(5) . "return false;"; -// $allow[] = $this->_t(4) . "}"; -// $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; +// $allow[] = PHP_EOL.Indent::_(3) . "\$categoryId = (int) isset(\$data['catid']) ? \$data['catid']: \$this->getModel()->getItem(\$recordId)->catid;"; <-- remove category from check +// $allow[] = PHP_EOL.Indent::_(3) . "if (\$categoryId)"; +// $allow[] = Indent::_(3) . "{"; +// $allow[] = Indent::_(4) . "//".Line::_(__Line__, __Class__)." The category has been set. Check the category permissions."; +// $allow[] = Indent::_(4) . "\$catpermission = \$user->authorise('core.edit', \$this->option . '.".$otherView.".category.' . \$categoryId);"; +// $allow[] = Indent::_(4) . "if (!\$catpermission && !is_null(\$catpermission))"; +// $allow[] = Indent::_(4) . "{"; +// $allow[] = Indent::_(5) . "return false;"; +// $allow[] = Indent::_(4) . "}"; +// $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ArrayHelper::check( @@ -19532,28 +19340,28 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit']] )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" + $allow[] = Indent::_(2) . "return \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "return parent::allowEdit(\$data, \$key);"; } } else { // setup the category script - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get user object."; - $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get record id."; - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; // load custom permission script $allow[] = $customAllow; @@ -19568,22 +19376,22 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.access']] )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Access check."; - $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" + $allow[] = Indent::_(2) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; - $allow[] = $this->_t(2) . "if (!\$access)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "return false;"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(2) . "if (!\$access)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "return false;"; + $allow[] = Indent::_(2) . "}"; } - $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) @@ -19596,19 +19404,19 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit']] )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$recordId);"; } - $allow[] = $this->_t(3) . "if (!\$permission)"; - $allow[] = $this->_t(3) . "{"; + $allow[] = Indent::_(3) . "if (!\$permission)"; + $allow[] = Indent::_(3) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) @@ -19620,38 +19428,38 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.own']] )) { - $allow[] = $this->_t(4) . "if (\$user->authorise('" + $allow[] = Indent::_(4) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . \$recordId))"; } else { - $allow[] = $this->_t(4) + $allow[] = Indent::_(4) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "." . $nameSingleCode . ".' . \$recordId))"; } - $allow[] = $this->_t(4) . "{"; - $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(4) . "{"; + $allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " Now test the owner is the user."; - $allow[] = $this->_t(5) + $allow[] = Indent::_(5) . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; - $allow[] = $this->_t(5) . "if (empty(\$ownerId))"; - $allow[] = $this->_t(5) . "{"; - $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(5) . "if (empty(\$ownerId))"; + $allow[] = Indent::_(5) . "{"; + $allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) . " Need to do a lookup from the model."; - $allow[] = $this->_t(6) + $allow[] = Indent::_(6) . "\$record = \$this->getModel()->getItem(\$recordId);"; - $allow[] = PHP_EOL . $this->_t(6) . "if (empty(\$record))"; - $allow[] = $this->_t(6) . "{"; - $allow[] = $this->_t(7) . "return false;"; - $allow[] = $this->_t(6) . "}"; - $allow[] = $this->_t(6) . "\$ownerId = \$record->created_by;"; - $allow[] = $this->_t(5) . "}"; - $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return false;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;"; + $allow[] = Indent::_(5) . "}"; + $allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " If the owner matches 'me' then allow."; - $allow[] = $this->_t(5) . "if (\$ownerId == \$user->id)"; - $allow[] = $this->_t(5) . "{"; + $allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)"; + $allow[] = Indent::_(5) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) @@ -19663,23 +19471,23 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.own']] )) { - $allow[] = $this->_t(6) . "if (\$user->authorise('" + $allow[] = Indent::_(6) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; } else { - $allow[] = $this->_t(6) + $allow[] = Indent::_(6) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; } - $allow[] = $this->_t(6) . "{"; - $allow[] = $this->_t(7) . "return true;"; - $allow[] = $this->_t(6) . "}"; - $allow[] = $this->_t(5) . "}"; - $allow[] = $this->_t(4) . "}"; - $allow[] = $this->_t(4) . "return false;"; - $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(6) . "{"; + $allow[] = Indent::_(7) . "return true;"; + $allow[] = Indent::_(6) . "}"; + $allow[] = Indent::_(5) . "}"; + $allow[] = Indent::_(4) . "}"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ArrayHelper::check( @@ -19690,16 +19498,16 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit']] )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" + $allow[] = Indent::_(2) . "return \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "return parent::allowEdit(\$data, \$key);"; } } @@ -19713,42 +19521,40 @@ class Interpretation extends Fields $component = $this->componentCodeName; // allways load these $getForm = array(); - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if xpath was set in options"; - $getForm[] = $this->_t(2) . "\$xpath = false;"; - $getForm[] = $this->_t(2) . "if (isset(\$options['xpath']))"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$xpath = \$options['xpath'];"; - $getForm[] = $this->_t(3) . "unset(\$options['xpath']);"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "\$xpath = false;"; + $getForm[] = Indent::_(2) . "if (isset(\$options['xpath']))"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "\$xpath = \$options['xpath'];"; + $getForm[] = Indent::_(3) . "unset(\$options['xpath']);"; + $getForm[] = Indent::_(2) . "}"; + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if clear form was set in options"; - $getForm[] = $this->_t(2) . "\$clear = false;"; - $getForm[] = $this->_t(2) . "if (isset(\$options['clear']))"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$clear = \$options['clear'];"; - $getForm[] = $this->_t(3) . "unset(\$options['clear']);"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "\$clear = false;"; + $getForm[] = Indent::_(2) . "if (isset(\$options['clear']))"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "\$clear = \$options['clear'];"; + $getForm[] = Indent::_(3) . "unset(\$options['clear']);"; + $getForm[] = Indent::_(2) . "}"; + $getForm[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get the form."; - $getForm[] = $this->_t(2) . "\$form = \$this->loadForm('com_" + $getForm[] = Indent::_(2) . "\$form = \$this->loadForm('com_" . $component . "." . $nameSingleCode . "', '" . $nameSingleCode . "', \$options, \$clear, \$xpath);"; - $getForm[] = PHP_EOL . $this->_t(2) . "if (empty(\$form))"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "return false;"; - $getForm[] = $this->_t(2) . "}"; + $getForm[] = PHP_EOL . Indent::_(2) . "if (empty(\$form))"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "return false;"; + $getForm[] = Indent::_(2) . "}"; // load license locker if ($this->componentData->add_license && $this->componentData->license_type == 3 && isset( - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'BOOLMETHOD' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('BOOLMETHOD')] )) { $getForm[] = $this->checkStatmentLicenseLocked( - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'BOOLMETHOD' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('BOOLMETHOD')] ); } // setup correct core target @@ -19775,64 +19581,64 @@ class Interpretation extends Fields $otherView = $nameSingleCode; } // setup the category script - $getForm[] = PHP_EOL . $this->_t(2) + $getForm[] = PHP_EOL . Indent::_(2) . "\$jinput = JFactory::getApplication()->input;"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $getForm[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; - $getForm[] = $this->_t(2) . "if (\$jinput->get('a_id'))"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(2) . "if (\$jinput->get('a_id'))"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "\$id = \$jinput->get('a_id', 0, 'INT');"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "}"; + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; - $getForm[] = $this->_t(2) . "else"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "else"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "\$id = \$jinput->get('id', 0, 'INT');"; + $getForm[] = Indent::_(2) . "}"; + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Determine correct permissions to check."; - $getForm[] = $this->_t(2) . "if (\$this->getState('" + $getForm[] = Indent::_(2) . "if (\$this->getState('" . $nameSingleCode . ".id'))"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$id = \$this->getState('" + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "\$id = \$this->getState('" . $nameSingleCode . ".id');"; - $getForm[] = PHP_EOL . $this->_t(3) . "\$catid = 0;"; - $getForm[] = $this->_t(3) + $getForm[] = PHP_EOL . Indent::_(3) . "\$catid = 0;"; + $getForm[] = Indent::_(3) . "if (isset(\$this->getItem(\$id)->catid))"; - $getForm[] = $this->_t(3) . "{"; - $getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "{"; + $getForm[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " set category id"; - $getForm[] = $this->_t(4) + $getForm[] = Indent::_(4) . "\$catid = \$this->getItem(\$id)->catid;"; - $getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $getForm[] = PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Existing record. Can only edit in selected categories."; - $getForm[] = $this->_t(4) + $getForm[] = Indent::_(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit');"; - $getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $getForm[] = PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Existing record. Can only edit own items in selected categories."; - $getForm[] = $this->_t(4) + $getForm[] = Indent::_(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit.own');"; - $getForm[] = $this->_t(3) . "}"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "else"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "}"; + $getForm[] = Indent::_(2) . "}"; + $getForm[] = Indent::_(2) . "else"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " New record. Can only create in selected categories."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('catid', 'action', 'core.create');"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = PHP_EOL . $this->_t(2) + $getForm[] = Indent::_(2) . "}"; + $getForm[] = PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $getForm[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Check for existing item."; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on Edit State access controls."; // get the other view $otherView = $this->catCodeBuilder[$nameSingleCode]['view']; @@ -19847,74 +19653,74 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.state']] )) { - $getForm[] = $this->_t(2) + $getForm[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $otherView . ".category.' . (int) \$catid))"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; } else { - $getForm[] = $this->_t(2) + $getForm[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $otherView . ".category.' . (int) \$catid))"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; } - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');"; - $getForm[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $getForm[] = PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Disable fields while saving."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');"; - $getForm[] = $this->_t(2) . "}"; + $getForm[] = Indent::_(2) . "}"; } else { - $getForm[] = PHP_EOL . $this->_t(2) + $getForm[] = PHP_EOL . Indent::_(2) . "\$jinput = JFactory::getApplication()->input;"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $getForm[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; - $getForm[] = $this->_t(2) . "if (\$jinput->get('a_id'))"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(2) . "if (\$jinput->get('a_id'))"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "\$id = \$jinput->get('a_id', 0, 'INT');"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "}"; + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; - $getForm[] = $this->_t(2) . "else"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = PHP_EOL . $this->_t(2) + $getForm[] = Indent::_(2) . "else"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "\$id = \$jinput->get('id', 0, 'INT');"; + $getForm[] = Indent::_(2) . "}"; + $getForm[] = PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $getForm[] = PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Check for existing item."; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on Edit State access controls."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) @@ -19927,50 +19733,50 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.state']] )) { - $getForm[] = $this->_t(2) + $getForm[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; } else { - $getForm[] = $this->_t(2) + $getForm[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; } - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');"; - $getForm[] = $this->_t(2) . "}"; + $getForm[] = Indent::_(2) . "}"; } - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " If this is a new item insure the greated by is set."; - $getForm[] = $this->_t(2) . "if (0 == \$id)"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "if (0 == \$id)"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set the created_by to this user"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setValue('created_by', null, \$user->id);"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "}"; + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on Edit Creaded By access controls."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.created_by']) @@ -19983,34 +19789,34 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.created_by']] )) { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + $getForm[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + $getForm[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "')))"; } else { - $getForm[] = $this->_t(2) + $getForm[] = Indent::_(2) . "if (!\$user->authorise('core.edit.created_by', 'com_" . $component . "'))"; } - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('created_by', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('created_by', 'readonly', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('created_by', 'filter', 'unset');"; - $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "}"; + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on Edit Creaded Date access controls."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.created']) @@ -20023,28 +19829,28 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.created']] )) { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + $getForm[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + $getForm[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "')))"; } else { - $getForm[] = $this->_t(2) + $getForm[] = Indent::_(2) . "if (!\$user->authorise('core.edit.created', 'com_" . $component . "'))"; } - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('created', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('created', 'filter', 'unset');"; - $getForm[] = $this->_t(2) . "}"; + $getForm[] = Indent::_(2) . "}"; // check if the item has access permissions. if ($coreLoad && isset($core['core.edit.access']) && isset($this->permissionBuilder[$core['core.edit.access']]) @@ -20056,23 +19862,23 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.access']] )) { - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on Edit Access 'access' controls."; - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + $getForm[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + $getForm[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "')))"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('access', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$form->setFieldAttribute('access', 'filter', 'unset');"; - $getForm[] = $this->_t(2) . "}"; + $getForm[] = Indent::_(2) . "}"; } // handel the fields permissions if (isset($this->permissionFields[$nameSingleCode]) @@ -20118,40 +19924,40 @@ class Interpretation extends Fields } } // add the redirect trick to set the field of origin - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Only load these values if no id is found"; - $getForm[] = $this->_t(2) . "if (0 == \$id)"; - $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(2) . "if (0 == \$id)"; + $getForm[] = Indent::_(2) . "{"; + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set redirected view name"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$redirectedView = \$jinput->get('ref', null, 'STRING');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set field name (or fall back to view name)"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$redirectedField = \$jinput->get('field', \$redirectedView, 'STRING');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set redirected view id"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$redirectedId = \$jinput->get('refid', 0, 'INT');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Set field id (or fall back to redirected view id)"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "\$redirectedValue = \$jinput->get('field_id', \$redirectedId, 'INT');"; - $getForm[] = $this->_t(3) + $getForm[] = Indent::_(3) . "if (0 != \$redirectedValue && \$redirectedField)"; - $getForm[] = $this->_t(3) . "{"; - $getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $getForm[] = Indent::_(3) . "{"; + $getForm[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Now set the local-redirected field default value"; - $getForm[] = $this->_t(4) + $getForm[] = Indent::_(4) . "\$form->setValue(\$redirectedField, null, \$redirectedValue);"; - $getForm[] = $this->_t(3) . "}"; + $getForm[] = Indent::_(3) . "}"; // load custom script if found - $getForm[] = $this->_t(2) . "}" . $this->getCustomScriptBuilder( + $getForm[] = Indent::_(2) . "}" . $this->getCustomScriptBuilder( 'php_getform', $nameSingleCode, PHP_EOL ); // setup the default script - $getForm[] = $this->_t(2) . "return \$form;"; + $getForm[] = Indent::_(2) . "return \$form;"; return implode(PHP_EOL, $getForm); } @@ -20163,50 +19969,50 @@ class Interpretation extends Fields // only for fields that can be edited if (!ComponentbuilderHelper::fieldCheck($fieldType, 'spacer')) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on Edit " . StringHelper::safe($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + $allow[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".edit." . $fieldName . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + $allow[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $nameSingleCode . ".edit." . $fieldName . "', 'com_" . $component . "')))"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName + $allow[] = Indent::_(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'disabled', 'true');"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable fields for display."; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName + $allow[] = Indent::_(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'readonly', 'true');"; if ('radio' === $fieldType || 'repeatable' === $fieldType) { - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Disable radio button for display."; - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "\$class = \$form->getFieldAttribute('" . $fieldName . "', 'class', '');"; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" + $allow[] = Indent::_(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'class', \$class.' disabled no-click');"; } - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " If there is no value continue."; - $allow[] = $this->_t(3) . "if (!\$form->getValue('" . $fieldName + $allow[] = Indent::_(3) . "if (!\$form->getValue('" . $fieldName . "'))"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + $allow[] = Indent::_(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + $allow[] = Indent::_(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');"; - $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; } } @@ -20214,21 +20020,21 @@ class Interpretation extends Fields $fieldName, $fieldType, $component ) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the from the form based on " . StringHelper::safe($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + $allow[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".access." . $fieldName . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + $allow[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $nameSingleCode . ".access." . $fieldName . "', 'com_" . $component . "')))"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Remove the field"; - $allow[] = $this->_t(3) . "\$form->removeField('" . $fieldName . "');"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(3) . "\$form->removeField('" . $fieldName . "');"; + $allow[] = Indent::_(2) . "}"; } protected function setPermissionViewFields(&$allow, $nameSingleCode, @@ -20237,71 +20043,71 @@ class Interpretation extends Fields { if (ComponentbuilderHelper::fieldCheck($fieldType, 'spacer')) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on View " . StringHelper::safe($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + $allow[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".view." . $fieldName . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + $allow[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $nameSingleCode . ".view." . $fieldName . "', 'com_" . $component . "')))"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Remove the field"; - $allow[] = $this->_t(3) . "\$form->removeField('" . $fieldName + $allow[] = Indent::_(3) . "\$form->removeField('" . $fieldName . "');"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(2) . "}"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Modify the form based on View " . StringHelper::safe($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + $allow[] = Indent::_(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".view." . $fieldName . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + $allow[] = Indent::_(3) . "|| (\$id == 0 && !\$user->authorise('" . $nameSingleCode . ".view." . $fieldName . "', 'com_" . $component . "')))"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Make the field hidded."; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName + $allow[] = Indent::_(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'type', 'hidden');"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " If there is no value continue."; - $allow[] = $this->_t(3) . "if (!(\$val = \$form->getValue('" + $allow[] = Indent::_(3) . "if (!(\$val = \$form->getValue('" . $fieldName . "')))"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + $allow[] = Indent::_(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + $allow[] = Indent::_(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Make sure"; - $allow[] = $this->_t(4) . "\$form->setValue('" . $fieldName + $allow[] = Indent::_(4) . "\$form->setValue('" . $fieldName . "', null, '');"; - $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(3) . "elseif (" . ucfirst($component) + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(3) . "elseif (" . ucfirst($component) . "Helper::checkArray(\$val))"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " We have to unset then (TODO)"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Hiddend field can not handel array value"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Even if we convert to json we get an error"; - $allow[] = $this->_t(4) . "\$form->removeField('" . $fieldName + $allow[] = Indent::_(4) . "\$form->removeField('" . $fieldName . "');"; - $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; } } @@ -20312,7 +20118,7 @@ class Interpretation extends Fields $component = $this->componentCodeName; // prepare custom permission script $customAllow = $this->getCustomScriptBuilder( - 'php_allowedit', $nameSingleCode, $this->_t(2) + 'php_allowedit', $nameSingleCode, Indent::_(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;" . PHP_EOL ); @@ -20333,12 +20139,12 @@ class Interpretation extends Fields $nameSingleCode, $this->permissionBuilder[$core['core.edit']] )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check specific edit permission then general edit permission."; - $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "\$user = JFactory::getUser();"; // load custom permission script $allow[] = $customAllow; - $allow[] = $this->_t(2) . "return \$user->authorise('" + $allow[] = Indent::_(2) . "return \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $nameSingleCode . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or \$user->authorise('" @@ -20346,15 +20152,15 @@ class Interpretation extends Fields } else { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check specific edit permission then general edit permission."; if (StringHelper::check($customAllow)) { - $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "\$user = JFactory::getUser();"; } // load custom permission script $allow[] = $customAllow; - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "return JFactory::getUser()->authorise('core.edit', 'com_" . $component . "." . $nameSingleCode . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or parent::allowEdit(\$data, \$key);"; @@ -20392,14 +20198,14 @@ class Interpretation extends Fields $otherView = $nameSingleCode; } // setup the category script - $allow[] = PHP_EOL . $this->_t(2) . "if (!empty(\$record->id))"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "if (\$record->published != -2)"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "return;"; - $allow[] = $this->_t(3) . "}"; - $allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(3) + $allow[] = PHP_EOL . Indent::_(2) . "if (!empty(\$record->id))"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "if (\$record->published != -2)"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = PHP_EOL . Indent::_(3) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(3) . "\$allow = \$user->authorise('core.delete', 'com_" . $component . "." . $otherView . ".category.' . (int) \$record->catid);"; @@ -20413,40 +20219,40 @@ class Interpretation extends Fields $otherView, $this->permissionBuilder[$core['core.delete']] )) { - $allow[] = PHP_EOL . $this->_t(3) . "if (\$allow)"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(3) . "if (\$allow)"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(4) . "return \$user->authorise('" + $allow[] = Indent::_(4) . "return \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; - $allow[] = $this->_t(3) . "}"; + $allow[] = Indent::_(3) . "}"; } else { - $allow[] = PHP_EOL . $this->_t(3) . "if (\$allow)"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(3) . "if (\$allow)"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(4) + $allow[] = Indent::_(4) . "return \$user->authorise('core.delete', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; - $allow[] = $this->_t(3) . "}"; + $allow[] = Indent::_(3) . "}"; } - $allow[] = $this->_t(3) . "return \$allow;"; - $allow[] = $this->_t(2) . "}"; - $allow[] = $this->_t(2) . "return false;"; + $allow[] = Indent::_(3) . "return \$allow;"; + $allow[] = Indent::_(2) . "}"; + $allow[] = Indent::_(2) . "return false;"; } else { // setup the default script - $allow[] = PHP_EOL . $this->_t(2) . "if (!empty(\$record->id))"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "if (\$record->published != -2)"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "return;"; - $allow[] = $this->_t(3) . "}"; + $allow[] = PHP_EOL . Indent::_(2) . "if (!empty(\$record->id))"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "if (\$record->published != -2)"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return;"; + $allow[] = Indent::_(3) . "}"; // check if the item has permissions. if ($coreLoad && (isset($core['core.delete']) @@ -20459,27 +20265,27 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.delete']] )) { - $allow[] = PHP_EOL . $this->_t(3) + $allow[] = PHP_EOL . Indent::_(3) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(3) . "return \$user->authorise('" + $allow[] = Indent::_(3) . "return \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$record->id);"; } else { - $allow[] = PHP_EOL . $this->_t(3) + $allow[] = PHP_EOL . Indent::_(3) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "return \$user->authorise('core.delete', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$record->id);"; } - $allow[] = $this->_t(2) . "}"; - $allow[] = $this->_t(2) . "return false;"; + $allow[] = Indent::_(2) . "}"; + $allow[] = Indent::_(2) . "return false;"; } return implode(PHP_EOL, $allow); @@ -20515,12 +20321,12 @@ class Interpretation extends Fields $otherViews = $nameListCode; $otherView = $nameSingleCode; } - $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) + $allow[] = PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; - $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) @@ -20533,38 +20339,38 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.state']] )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$recordId);"; } - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "if (!\$permission && !is_null(\$permission))"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "return false;"; - $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; // setup the category script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check against the category."; - $allow[] = $this->_t(2) . "if (!empty(\$record->catid))"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) + $allow[] = Indent::_(2) . "if (!empty(\$record->catid))"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "\$catpermission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $otherView . ".category.' . (int) \$record->catid);"; - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "if (!\$catpermission && !is_null(\$catpermission))"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "return false;"; - $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ArrayHelper::check( @@ -20575,29 +20381,29 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.state']] )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" + $allow[] = Indent::_(2) . "return \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "return parent::canEditState(\$record);"; } } else { // setup the default script - $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) + $allow[] = PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();"; + $allow[] = Indent::_(2) . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; - $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; - $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + $allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)"; + $allow[] = Indent::_(2) . "{"; + $allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) @@ -20610,23 +20416,23 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.edit.state']] )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$recordId);"; } - $allow[] = $this->_t(3) + $allow[] = Indent::_(3) . "if (!\$permission && !is_null(\$permission))"; - $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "return false;"; - $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(2) . "}"; + $allow[] = Indent::_(3) . "{"; + $allow[] = Indent::_(4) . "return false;"; + $allow[] = Indent::_(3) . "}"; + $allow[] = Indent::_(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ArrayHelper::check( @@ -20637,17 +20443,17 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.state']] )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" + $allow[] = Indent::_(2) . "return \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + $allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "return parent::canEditState(\$record);"; } } @@ -20678,13 +20484,13 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit']] )) { - $allow[] = PHP_EOL . $this->_t(2) + $allow[] = PHP_EOL . Indent::_(2) . "\$this->canEdit = \$this->canDo->get('" . $core['core.edit'] . "');"; } else { - $allow[] = PHP_EOL . $this->_t(2) + $allow[] = PHP_EOL . Indent::_(2) . "\$this->canEdit = \$this->canDo->get('core.edit');"; } // check if the item has permissions for edit state. @@ -20698,12 +20504,12 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit.state']] )) { - $allow[] = $this->_t(2) . "\$this->canState = \$this->canDo->get('" + $allow[] = Indent::_(2) . "\$this->canState = \$this->canDo->get('" . $core['core.edit.state'] . "');"; } else { - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "\$this->canState = \$this->canDo->get('core.edit.state');"; } // check if the item has permissions for create. @@ -20717,12 +20523,12 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.create']] )) { - $allow[] = $this->_t(2) . "\$this->canCreate = \$this->canDo->get('" + $allow[] = Indent::_(2) . "\$this->canCreate = \$this->canDo->get('" . $core['core.create'] . "');"; } else { - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "\$this->canCreate = \$this->canDo->get('core.create');"; } // check if the item has permissions for delete. @@ -20736,12 +20542,12 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.delete']] )) { - $allow[] = $this->_t(2) . "\$this->canDelete = \$this->canDo->get('" + $allow[] = Indent::_(2) . "\$this->canDelete = \$this->canDo->get('" . $core['core.delete'] . "');"; } else { - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "\$this->canDelete = \$this->canDo->get('core.delete');"; } // check if the item has permissions for batch. @@ -20755,13 +20561,13 @@ class Interpretation extends Fields $this->permissionBuilder['global']['global'][$core['core.delete']] )) { - $allow[] = $this->_t(2) . "\$this->canBatch = (\$this->canDo->get('" + $allow[] = Indent::_(2) . "\$this->canBatch = (\$this->canDo->get('" . $core['core.batch'] . "') && \$this->canDo->get('core.batch'));"; } else { - $allow[] = $this->_t(2) + $allow[] = Indent::_(2) . "\$this->canBatch = \$this->canDo->get('core.batch');"; } @@ -20778,34 +20584,34 @@ class Interpretation extends Fields // set label $label = 'Permissions in relation to this ' . $view; // set the access fieldset - $access = ""; - $access .= PHP_EOL . $this->_t(1) + $access .= PHP_EOL . Indent::_(1) . '
    '; - $access .= PHP_EOL . $this->_t(2) . ""; - $access .= PHP_EOL . $this->_t(2) . '_t(3) . 'name="asset_id"'; - $access .= PHP_EOL . $this->_t(3) . 'type="hidden"'; - $access .= PHP_EOL . $this->_t(3) . 'filter="unset"'; - $access .= PHP_EOL . $this->_t(2) . '/>'; - $access .= PHP_EOL . $this->_t(2) . ""; - $access .= PHP_EOL . $this->_t(2) . '_t(3) . 'name="rules"'; - $access .= PHP_EOL . $this->_t(3) . 'type="rules"'; - $access .= PHP_EOL . $this->_t(3) . 'label="' . $label . '"'; - $access .= PHP_EOL . $this->_t(3) . 'translate_label="false"'; - $access .= PHP_EOL . $this->_t(3) . 'filter="rules"'; - $access .= PHP_EOL . $this->_t(3) . 'validate="rules"'; - $access .= PHP_EOL . $this->_t(3) . 'class="inputbox"'; - $access .= PHP_EOL . $this->_t(3) . 'component="com_' . $component + $access .= PHP_EOL . Indent::_(2) . '_t(3) . 'section="' . $view . '"'; - $access .= PHP_EOL . $this->_t(2) . '/>'; - $access .= PHP_EOL . $this->_t(1) . '
    '; + $access .= PHP_EOL . Indent::_(3) . 'section="' . $view . '"'; + $access .= PHP_EOL . Indent::_(2) . '/>'; + $access .= PHP_EOL . Indent::_(1) . ''; } // return access field set @@ -20829,17 +20635,17 @@ class Interpretation extends Fields 'created_by' => true, 'modified_by' => true); // default filter fields $fields = "'a.id','id'"; - $fields .= "," . PHP_EOL . $this->_t(4) . "'a.published','published'"; + $fields .= "," . PHP_EOL . Indent::_(4) . "'a.published','published'"; if (isset($this->accessBuilder[$nameSingleCode]) && StringHelper::check( $this->accessBuilder[$nameSingleCode] )) { - $fields .= "," . PHP_EOL . $this->_t(4) . "'a.access','access'"; + $fields .= "," . PHP_EOL . Indent::_(4) . "'a.access','access'"; } - $fields .= "," . PHP_EOL . $this->_t(4) . "'a.ordering','ordering'"; - $fields .= "," . PHP_EOL . $this->_t(4) . "'a.created_by','created_by'"; - $fields .= "," . PHP_EOL . $this->_t(4) + $fields .= "," . PHP_EOL . Indent::_(4) . "'a.ordering','ordering'"; + $fields .= "," . PHP_EOL . Indent::_(4) . "'a.created_by','created_by'"; + $fields .= "," . PHP_EOL . Indent::_(4) . "'a.modified_by','modified_by'"; // add the rest of the set filters @@ -20893,13 +20699,13 @@ class Interpretation extends Fields // add the category stuff (may still remove these) TODO if ($filter['type'] === 'category') { - $field = "," . PHP_EOL . $this->_t(4) + $field = "," . PHP_EOL . Indent::_(4) . "'c.title','category_title'"; - $field .= "," . PHP_EOL . $this->_t(4) + $field .= "," . PHP_EOL . Indent::_(4) . "'c.id', 'category_id'"; if ($filter['code'] != 'category') { - $field .= "," . PHP_EOL . $this->_t(4) . "'a." + $field .= "," . PHP_EOL . Indent::_(4) . "'a." . $filter['code'] . "','" . $filter['code'] . "'"; } @@ -20919,14 +20725,14 @@ class Interpretation extends Fields $filter['custom']['text'] )) { - $field = "," . PHP_EOL . $this->_t(4) . "'" + $field = "," . PHP_EOL . Indent::_(4) . "'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" . $filter['code'] . "'"; } else { - $field = "," . PHP_EOL . $this->_t(4) . "'a." + $field = "," . PHP_EOL . Indent::_(4) . "'a." . $filter['code'] . "','" . $filter['code'] . "'"; } @@ -20953,15 +20759,15 @@ class Interpretation extends Fields 'published' => true, 'access' => true, 'created_by' => true, 'modified_by' => true); // set the defaults first - $stored = "//" . $this->setLine(__LINE__) . " Compile the store id."; - $stored .= PHP_EOL . $this->_t(2) + $stored = "//" . Line::_(__Line__, __Class__) . " Compile the store id."; + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.id');"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.search');"; // add this if not already added if (!isset($this->fieldsNames[$nameSingleCode]['published'])) { - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.published');"; } // add if view calls for it, and not already added @@ -20975,7 +20781,7 @@ class Interpretation extends Fields if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1) { - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.access');"; } else @@ -20985,18 +20791,18 @@ class Interpretation extends Fields $stored .= $this->getStoredIdCodeMulti('access', $Component); } } - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.ordering');"; // add this if not already added if (!isset($this->fieldsNames[$nameSingleCode]['created_by'])) { - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.created_by');"; } // add this if not already added if (!isset($this->fieldsNames[$nameSingleCode]['modified_by'])) { - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.modified_by');"; } // add the rest of the set filters @@ -21055,13 +20861,13 @@ class Interpretation extends Fields if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1) { - $stored = PHP_EOL . $this->_t(2) + $stored = PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter.category_id');"; if ($filter['code'] != 'category') { - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } @@ -21095,7 +20901,7 @@ class Interpretation extends Fields } else { - $stored = PHP_EOL . $this->_t(2) + $stored = PHP_EOL . Indent::_(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } @@ -21117,33 +20923,33 @@ class Interpretation extends Fields { // top bar selection can result in // an array due to multi selection - $stored = PHP_EOL . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $stored = PHP_EOL . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Check if the value is an array"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "\$_" . $key . " = \$this->getState('filter." . $key . "');"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "if (" . $Component . "Helper::checkArray(\$_" . $key . "))"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "{"; - $stored .= PHP_EOL . $this->_t(3) + $stored .= PHP_EOL . Indent::_(3) . "\$id .= ':' . implode(':', \$_" . $key . ");"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "}"; - $stored .= PHP_EOL . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $stored .= PHP_EOL . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Check if this is only an number or string"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "elseif (is_numeric(\$_" . $key . ")"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . " || " . $Component . "Helper::checkString(\$_" . $key . "))"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "{"; - $stored .= PHP_EOL . $this->_t(3) + $stored .= PHP_EOL . Indent::_(3) . "\$id .= ':' . \$_" . $key . ";"; - $stored .= PHP_EOL . $this->_t(2) + $stored .= PHP_EOL . Indent::_(2) . "}"; return $stored; @@ -21169,18 +20975,18 @@ class Interpretation extends Fields $view['settings']->name_single . ' readonly', 'U' ); // load to lang - $this->setLangContent( - $this->lang, $viewNameLang_readonly, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $viewNameLang_readonly, $view['settings']->name_single . ' :: Readonly' ); // build toolbar $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::title(JText:" + $toolBar .= PHP_EOL . Indent::_(2) . "JToolBarHelper::title(JText:" . ":_('" . $viewNameLang_readonly . "'), '" . $nameSingleCode . "');"; - $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::cancel('" + $toolBar .= PHP_EOL . Indent::_(2) . "JToolBarHelper::cancel('" . $nameSingleCode . ".cancel', 'JTOOLBAR_CLOSE');"; } else @@ -21195,32 +21001,31 @@ class Interpretation extends Fields $view['settings']->name_single . ' Edit', 'U' ); // load to lang - $this->setLangContent( - $this->lang, $viewNameLang_new, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $viewNameLang_new, 'A New ' . $view['settings']->name_single ); - $this->setLangContent( - $this->lang, $viewNameLang_edit, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $viewNameLang_edit, 'Editing the ' . $view['settings']->name_single ); // build toolbar $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL . $this->_t(2) + $toolBar .= PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();"; - $toolBar .= PHP_EOL . $this->_t(2) . "\$userId = \$user->id;"; - $toolBar .= PHP_EOL . $this->_t(2) + $toolBar .= PHP_EOL . Indent::_(2) . "\$userId = \$user->id;"; + $toolBar .= PHP_EOL . Indent::_(2) . "\$isNew = \$this->item->id == 0;"; - $toolBar .= PHP_EOL . PHP_EOL . $this->_t(2) + $toolBar .= PHP_EOL . PHP_EOL . Indent::_(2) . "JToolbarHelper::title( JText:" . ":_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');"; - $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Built the actions for new and existing records."; - $toolBar .= PHP_EOL . $this->_t(2) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkString(\$this->referral))"; - $toolBar .= PHP_EOL . $this->_t(2) . "{"; + $toolBar .= PHP_EOL . Indent::_(2) . "if (" + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$this->referral))"; + $toolBar .= PHP_EOL . Indent::_(2) . "{"; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ArrayHelper::check( @@ -21231,20 +21036,20 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.create']] )) { - $toolBar .= PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('" + $toolBar .= PHP_EOL . Indent::_(3) . "if (\$this->canDo->get('" . $core['core.create'] . "') && \$isNew)"; } else { - $toolBar .= PHP_EOL . $this->_t(3) + $toolBar .= PHP_EOL . Indent::_(3) . "if (\$this->canDo->get('core.create') && \$isNew)"; } - $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(3) . "{"; + $toolBar .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " We can create the record."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" + $toolBar .= PHP_EOL . Indent::_(4) . "JToolBarHelper::save('" . $nameSingleCode . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . $this->_t(3) . "}"; + $toolBar .= PHP_EOL . Indent::_(3) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ArrayHelper::check( @@ -21255,41 +21060,41 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit']] )) { - $toolBar .= PHP_EOL . $this->_t(3) + $toolBar .= PHP_EOL . Indent::_(3) . "elseif (\$this->canDo->get('" . $core['core.edit'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(3) + $toolBar .= PHP_EOL . Indent::_(3) . "elseif (\$this->canDo->get('core.edit'))"; } - $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(3) . "{"; + $toolBar .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " We can save the record."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" + $toolBar .= PHP_EOL . Indent::_(4) . "JToolBarHelper::save('" . $nameSingleCode . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . $this->_t(3) . "}"; - $toolBar .= PHP_EOL . $this->_t(3) . "if (\$isNew)"; - $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(3) . "}"; + $toolBar .= PHP_EOL . Indent::_(3) . "if (\$isNew)"; + $toolBar .= PHP_EOL . Indent::_(3) . "{"; + $toolBar .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Do not creat but cancel."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + $toolBar .= PHP_EOL . Indent::_(4) . "JToolBarHelper::cancel('" . $nameSingleCode . ".cancel', 'JTOOLBAR_CANCEL');"; - $toolBar .= PHP_EOL . $this->_t(3) . "}"; - $toolBar .= PHP_EOL . $this->_t(3) . "else"; - $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(3) . "}"; + $toolBar .= PHP_EOL . Indent::_(3) . "else"; + $toolBar .= PHP_EOL . Indent::_(3) . "{"; + $toolBar .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " We can close it."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + $toolBar .= PHP_EOL . Indent::_(4) . "JToolBarHelper::cancel('" . $nameSingleCode . ".cancel', 'JTOOLBAR_CLOSE');"; - $toolBar .= PHP_EOL . $this->_t(3) . "}"; - $toolBar .= PHP_EOL . $this->_t(2) . "}"; - $toolBar .= PHP_EOL . $this->_t(2) . "else"; - $toolBar .= PHP_EOL . $this->_t(2) . "{"; - $toolBar .= PHP_EOL . $this->_t(3) . "if (\$isNew)"; - $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(3) . "}"; + $toolBar .= PHP_EOL . Indent::_(2) . "}"; + $toolBar .= PHP_EOL . Indent::_(2) . "else"; + $toolBar .= PHP_EOL . Indent::_(2) . "{"; + $toolBar .= PHP_EOL . Indent::_(3) . "if (\$isNew)"; + $toolBar .= PHP_EOL . Indent::_(3) . "{"; + $toolBar .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " For new records, check the create permission."; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) @@ -21301,28 +21106,28 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.create']] )) { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(4) + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" + $toolBar .= PHP_EOL . Indent::_(4) . "{"; + $toolBar .= PHP_EOL . Indent::_(5) . "JToolBarHelper::apply('" . $nameSingleCode . ".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" + $toolBar .= PHP_EOL . Indent::_(5) . "JToolBarHelper::save('" . $nameSingleCode . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" + $toolBar .= PHP_EOL . Indent::_(5) . "JToolBarHelper::custom('" . $nameSingleCode . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; - $toolBar .= PHP_EOL . $this->_t(4) . "};"; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + $toolBar .= PHP_EOL . Indent::_(4) . "};"; + $toolBar .= PHP_EOL . Indent::_(4) . "JToolBarHelper::cancel('" . $nameSingleCode . ".cancel', 'JTOOLBAR_CANCEL');"; - $toolBar .= PHP_EOL . $this->_t(3) . "}"; - $toolBar .= PHP_EOL . $this->_t(3) . "else"; - $toolBar .= PHP_EOL . $this->_t(3) . "{"; + $toolBar .= PHP_EOL . Indent::_(3) . "}"; + $toolBar .= PHP_EOL . Indent::_(3) . "else"; + $toolBar .= PHP_EOL . Indent::_(3) . "{"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ArrayHelper::check( @@ -21333,24 +21138,24 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.edit']] )) { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->canDo->get('" . $core['core.edit'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(4) + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->canDo->get('core.edit'))"; } - $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(4) . "{"; + $toolBar .= PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " We can save the new record"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" + $toolBar .= PHP_EOL . Indent::_(5) . "JToolBarHelper::apply('" . $nameSingleCode . ".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" + $toolBar .= PHP_EOL . Indent::_(5) . "JToolBarHelper::save('" . $nameSingleCode . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " We can save this record, but check the create permission to see"; - $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__) . " if we can return to make a new one."; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) @@ -21362,20 +21167,20 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.create']] )) { - $toolBar .= PHP_EOL . $this->_t(5) . "if (\$this->canDo->get('" + $toolBar .= PHP_EOL . Indent::_(5) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(5) + $toolBar .= PHP_EOL . Indent::_(5) . "if (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL . $this->_t(5) . "{"; - $toolBar .= PHP_EOL . $this->_t(6) . "JToolBarHelper::custom('" + $toolBar .= PHP_EOL . Indent::_(5) . "{"; + $toolBar .= PHP_EOL . Indent::_(6) . "JToolBarHelper::custom('" . $nameSingleCode . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; - $toolBar .= PHP_EOL . $this->_t(5) . "}"; - $toolBar .= PHP_EOL . $this->_t(4) . "}"; + $toolBar .= PHP_EOL . Indent::_(5) . "}"; + $toolBar .= PHP_EOL . Indent::_(4) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ArrayHelper::check( @@ -21391,18 +21196,18 @@ class Interpretation extends Fields $this->historyBuilder[$nameSingleCode] )) { - $toolBar .= PHP_EOL . $this->_t(4) + $toolBar .= PHP_EOL . Indent::_(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; - $toolBar .= PHP_EOL . $this->_t(4) + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('" . $core['core.edit'] . "') && \$canVersion)"; - $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) + $toolBar .= PHP_EOL . Indent::_(4) . "{"; + $toolBar .= PHP_EOL . Indent::_(5) . "JToolbarHelper::versions('com_" . $this->componentCodeName . "." . $nameSingleCode . "', \$this->item->id);"; - $toolBar .= PHP_EOL . $this->_t(4) . "}"; + $toolBar .= PHP_EOL . Indent::_(4) . "}"; } } else @@ -21412,17 +21217,17 @@ class Interpretation extends Fields $this->historyBuilder[$nameSingleCode] )) { - $toolBar .= PHP_EOL . $this->_t(4) + $toolBar .= PHP_EOL . Indent::_(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; - $toolBar .= PHP_EOL . $this->_t(4) + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)"; - $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) + $toolBar .= PHP_EOL . Indent::_(4) . "{"; + $toolBar .= PHP_EOL . Indent::_(5) . "JToolbarHelper::versions('com_" . $this->componentCodeName . "." . $nameSingleCode . "', \$this->item->id);"; - $toolBar .= PHP_EOL . $this->_t(4) . "}"; + $toolBar .= PHP_EOL . Indent::_(4) . "}"; } } if ($coreLoad && isset($core['core.create']) @@ -21435,39 +21240,37 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.create']] )) { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(4) + $toolBar .= PHP_EOL . Indent::_(4) . "if (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" + $toolBar .= PHP_EOL . Indent::_(4) . "{"; + $toolBar .= PHP_EOL . Indent::_(5) . "JToolBarHelper::custom('" . $nameSingleCode . ".save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);"; - $toolBar .= PHP_EOL . $this->_t(4) . "}"; + $toolBar .= PHP_EOL . Indent::_(4) . "}"; // add custom buttons - $toolBar .= $this->setCustomButtons($view, 2, $this->_t(2)); - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + $toolBar .= $this->setCustomButtons($view, 2, Indent::_(2)); + $toolBar .= PHP_EOL . Indent::_(4) . "JToolBarHelper::cancel('" . $nameSingleCode . ".cancel', 'JTOOLBAR_CLOSE');"; - $toolBar .= PHP_EOL . $this->_t(3) . "}"; - $toolBar .= PHP_EOL . $this->_t(2) . "}"; - $toolBar .= PHP_EOL . $this->_t(2) . "JToolbarHelper::divider();"; - $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $toolBar .= PHP_EOL . Indent::_(3) . "}"; + $toolBar .= PHP_EOL . Indent::_(2) . "}"; + $toolBar .= PHP_EOL . Indent::_(2) . "JToolbarHelper::divider();"; + $toolBar .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " set help url for this view if found"; - $toolBar .= PHP_EOL . $this->_t(2) . "\$this->help_url = " - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::getHelpUrl('" . $nameSingleCode + $toolBar .= PHP_EOL . Indent::_(2) . "\$this->help_url = " + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::getHelpUrl('" . $nameSingleCode . "');"; - $toolBar .= PHP_EOL . $this->_t(2) . "if (" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkString(\$this->help_url))"; - $toolBar .= PHP_EOL . $this->_t(2) . "{"; - $toolBar .= PHP_EOL . $this->_t(3) . "JToolbarHelper::help('" + $toolBar .= PHP_EOL . Indent::_(2) . "if (" + . $this->fileContentStatic[Placefix::_h('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);"; - $toolBar .= PHP_EOL . $this->_t(2) . "}"; + $toolBar .= PHP_EOL . Indent::_(2) . "}"; } return $toolBar; @@ -21493,9 +21296,9 @@ class Interpretation extends Fields if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 2) { - $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" - . $this->setLine(__LINE__) . " Check if the form was submitted"; - $state .= PHP_EOL . $this->_t(2) . "\$formSubmited" + $state .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" + . Line::_(__Line__, __Class__) . " Check if the form was submitted"; + $state .= PHP_EOL . Indent::_(2) . "\$formSubmited" . " = \$app->input->post->get('form_submited');"; $new_filter = true; } @@ -21557,37 +21360,37 @@ class Interpretation extends Fields // add category stuff (may still remove these) TODO if (isset($filter['type']) && $filter['type'] === 'category') { - $state .= PHP_EOL . PHP_EOL . $this->_t(2) + $state .= PHP_EOL . PHP_EOL . Indent::_(2) . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; - $state .= PHP_EOL . $this->_t(2) + $state .= PHP_EOL . Indent::_(2) . "\$this->setState('filter.category', \$category);"; - $state .= PHP_EOL . PHP_EOL . $this->_t(2) + $state .= PHP_EOL . PHP_EOL . Indent::_(2) . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; - $state .= PHP_EOL . $this->_t(2) + $state .= PHP_EOL . Indent::_(2) . "\$this->setState('filter.category_id', \$categoryId);"; } // always add the default filter - $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] + $state .= PHP_EOL . PHP_EOL . Indent::_(2) . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "'" . $extra . ");"; if ($newFilter) { // add the new filter option - $state .= PHP_EOL . $this->_t(2) + $state .= PHP_EOL . Indent::_(2) . "if (\$formSubmited)"; - $state .= PHP_EOL . $this->_t(2) . "{"; - $state .= PHP_EOL . $this->_t(3) . "\$" . $filter['code'] + $state .= PHP_EOL . Indent::_(2) . "{"; + $state .= PHP_EOL . Indent::_(3) . "\$" . $filter['code'] . " = \$app->input->post->get('" . $filter['code'] . "');"; - $state .= PHP_EOL . $this->_t(3) + $state .= PHP_EOL . Indent::_(3) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; - $state .= PHP_EOL . $this->_t(2) . "}"; + $state .= PHP_EOL . Indent::_(2) . "}"; } else { // the old filter option - $state .= PHP_EOL . $this->_t(2) + $state .= PHP_EOL . Indent::_(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } @@ -21668,9 +21471,9 @@ class Interpretation extends Fields $donelist = array('ordering', 'published'); // set the default first $fields = "return array("; - $fields .= PHP_EOL . $this->_t(3) . "'a.ordering' => JText:" + $fields .= PHP_EOL . Indent::_(3) . "'a.ordering' => JText:" . ":_('JGRID_HEADING_ORDERING')"; - $fields .= "," . PHP_EOL . $this->_t(3) . "'a.published' => JText:" + $fields .= "," . PHP_EOL . Indent::_(3) . "'a.published' => JText:" . ":_('JSTATUS')"; // add the rest of the set filters @@ -21685,7 +21488,7 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= "," . PHP_EOL . $this->_t(3) + $fields .= "," . PHP_EOL . Indent::_(3) . "'category_title' => JText:" . ":_('" . $filter['lang'] . "')"; } @@ -21693,23 +21496,23 @@ class Interpretation extends Fields $filter['custom'] )) { - $fields .= "," . PHP_EOL . $this->_t(3) . "'" + $fields .= "," . PHP_EOL . Indent::_(3) . "'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; } else { - $fields .= "," . PHP_EOL . $this->_t(3) . "'a." + $fields .= "," . PHP_EOL . Indent::_(3) . "'a." . $filter['code'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; } } } } - $fields .= "," . PHP_EOL . $this->_t(3) . "'a.id' => JText:" + $fields .= "," . PHP_EOL . Indent::_(3) . "'a.id' => JText:" . ":_('JGRID_HEADING_ID')"; - $fields .= PHP_EOL . $this->_t(2) . ");"; + $fields .= PHP_EOL . Indent::_(2) . ");"; // return fields return $fields; @@ -21717,90 +21520,90 @@ class Interpretation extends Fields public function setCheckinCall() { - $call = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $call = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check in items"; - $call .= PHP_EOL . $this->_t(2) . "\$this->checkInNow();" . PHP_EOL; + $call .= PHP_EOL . Indent::_(2) . "\$this->checkInNow();" . PHP_EOL; return $call; } public function setAutoCheckin($view, $component) { - $checkin = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $checkin .= PHP_EOL . $this->_t(1) + $checkin = PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $checkin .= PHP_EOL . Indent::_(1) . " * Build an SQL query to checkin all items left checked out longer then a set time."; - $checkin .= PHP_EOL . $this->_t(1) . " *"; - $checkin .= PHP_EOL . $this->_t(1) . " * @return a bool"; - $checkin .= PHP_EOL . $this->_t(1) . " *"; - $checkin .= PHP_EOL . $this->_t(1) . " */"; - $checkin .= PHP_EOL . $this->_t(1) . "protected function checkInNow()"; - $checkin .= PHP_EOL . $this->_t(1) . "{"; - $checkin .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + $checkin .= PHP_EOL . Indent::_(1) . " *"; + $checkin .= PHP_EOL . Indent::_(1) . " * @return a bool"; + $checkin .= PHP_EOL . Indent::_(1) . " *"; + $checkin .= PHP_EOL . Indent::_(1) . " */"; + $checkin .= PHP_EOL . Indent::_(1) . "protected function checkInNow()"; + $checkin .= PHP_EOL . Indent::_(1) . "{"; + $checkin .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get set check in time"; - $checkin .= PHP_EOL . $this->_t(2) + $checkin .= PHP_EOL . Indent::_(2) . "\$time = JComponentHelper::getParams('com_" . $component . "')->get('check_in');"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(2) . "if (\$time)"; - $checkin .= PHP_EOL . $this->_t(2) . "{"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $checkin .= PHP_EOL . PHP_EOL . Indent::_(2) . "if (\$time)"; + $checkin .= PHP_EOL . Indent::_(2) . "{"; + $checkin .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Get a db connection."; - $checkin .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; - $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $checkin .= PHP_EOL . Indent::_(3) . "\$db = JFactory::getDbo();"; + $checkin .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Reset query."; - $checkin .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; - $checkin .= PHP_EOL . $this->_t(3) . "\$query->select('*');"; - $checkin .= PHP_EOL . $this->_t(3) + $checkin .= PHP_EOL . Indent::_(3) . "\$query = \$db->getQuery(true);"; + $checkin .= PHP_EOL . Indent::_(3) . "\$query->select('*');"; + $checkin .= PHP_EOL . Indent::_(3) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $view . "'));"; - $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + $checkin .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Only select items that are checked out."; - $checkin .= PHP_EOL . $this->_t(3) + $checkin .= PHP_EOL . Indent::_(3) . "\$query->where(\$db->quoteName('checked_out') . '!=0');"; - $this->_t(3) . "//" . $this->setLine(__LINE__) + Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Query only to see if we have a rows"; - $checkin .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query, 0, 1);"; - $checkin .= PHP_EOL . $this->_t(3) . "\$db->execute();"; - $checkin .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; - $checkin .= PHP_EOL . $this->_t(3) . "{"; - $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $checkin .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query, 0, 1);"; + $checkin .= PHP_EOL . Indent::_(3) . "\$db->execute();"; + $checkin .= PHP_EOL . Indent::_(3) . "if (\$db->getNumRows())"; + $checkin .= PHP_EOL . Indent::_(3) . "{"; + $checkin .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Get Yesterdays date."; - $checkin .= PHP_EOL . $this->_t(4) + $checkin .= PHP_EOL . Indent::_(4) . "\$date = JFactory::getDate()->modify(\$time)->toSql();"; - $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + $checkin .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " Reset query."; - $checkin .= PHP_EOL . $this->_t(4) . "\$query = \$db->getQuery(true);"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $checkin .= PHP_EOL . Indent::_(4) . "\$query = \$db->getQuery(true);"; + $checkin .= PHP_EOL . PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Fields to update."; - $checkin .= PHP_EOL . $this->_t(4) . "\$fields = array("; - $checkin .= PHP_EOL . $this->_t(5) + $checkin .= PHP_EOL . Indent::_(4) . "\$fields = array("; + $checkin .= PHP_EOL . Indent::_(5) . "\$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',"; - $checkin .= PHP_EOL . $this->_t(5) + $checkin .= PHP_EOL . Indent::_(5) . "\$db->quoteName('checked_out') . '=0'"; - $checkin .= PHP_EOL . $this->_t(4) . ");"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $checkin .= PHP_EOL . Indent::_(4) . ");"; + $checkin .= PHP_EOL . PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Conditions for which records should be updated."; - $checkin .= PHP_EOL . $this->_t(4) . "\$conditions = array("; - $checkin .= PHP_EOL . $this->_t(5) + $checkin .= PHP_EOL . Indent::_(4) . "\$conditions = array("; + $checkin .= PHP_EOL . Indent::_(5) . "\$db->quoteName('checked_out') . '!=0', "; - $checkin .= PHP_EOL . $this->_t(5) + $checkin .= PHP_EOL . Indent::_(5) . "\$db->quoteName('checked_out_time') . '<\''.\$date.'\''"; - $checkin .= PHP_EOL . $this->_t(4) . ");"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $checkin .= PHP_EOL . Indent::_(4) . ");"; + $checkin .= PHP_EOL . PHP_EOL . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Check table."; - $checkin .= PHP_EOL . $this->_t(4) + $checkin .= PHP_EOL . Indent::_(4) . "\$query->update(\$db->quoteName('#__" . $component . "_" . $view . "'))->set(\$fields)->where(\$conditions); "; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) + $checkin .= PHP_EOL . PHP_EOL . Indent::_(4) . "\$db->setQuery(\$query);"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "\$db->execute();"; - $checkin .= PHP_EOL . $this->_t(3) . "}"; - $checkin .= PHP_EOL . $this->_t(2) . "}"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(2) . "return false;"; - $checkin .= PHP_EOL . $this->_t(1) . "}"; + $checkin .= PHP_EOL . PHP_EOL . Indent::_(4) . "\$db->execute();"; + $checkin .= PHP_EOL . Indent::_(3) . "}"; + $checkin .= PHP_EOL . Indent::_(2) . "}"; + $checkin .= PHP_EOL . PHP_EOL . Indent::_(2) . "return false;"; + $checkin .= PHP_EOL . Indent::_(1) . "}"; return $checkin; } @@ -21838,58 +21641,57 @@ class Interpretation extends Fields $this->permissionBuilder[$core['core.access']] )) { - $fix_access = PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" - . $this->setLine(__LINE__) + $fix_access = PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " Remove items the user can't access."; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$item->id) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "if (!\$access)"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "{"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "unset(\$items[\$nr]);"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "continue;"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}" + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}" . PHP_EOL; } // add the tags if needed if (isset($this->tagsBuilder[$nameSingleCode])) { - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" - . $this->setLine( - __LINE__ + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" + . Line::_( + __LINE__,__CLASS__ ) . " Add the tags"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$item->tags = new JHelperTags;"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$item->tags->getTagIds("; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$item->id, 'com_" - . $this->fileContentStatic[$this->hhh . 'component' - . $this->hhh] . ".$nameSingleCode'"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . ");"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . $this->fileContentStatic[Placefix::_h('component')] . ".$nameSingleCode'"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . ");"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "if (\$item->tags->tags)"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "{"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$item->tags = implode(', ',"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "\$item->tags->getTagNames("; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(6) . "explode(',', \$item->tags->tags)"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . ")"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . ");"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . ")"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . ");"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "else"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "{"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$item->tags = '';"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + $fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}"; } // get the correct array if ($export || $all) @@ -21975,66 +21777,66 @@ class Interpretation extends Fields if ($item['type'] === 'usergroup' && !$export && $item['method'] != 6) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " decode " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " decode " . $item['name']; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$" . $item['name'] . "Names = array();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "\$" . $item['name'] . "Names[] = " . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$item->" . $item['name'] . " = implode(', ', \$" . $item['name'] . "Names);"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}"; } /* elseif ($item['type'] === 'usergroup' && $export) { - $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "//".$this->setLine(__LINE__)." decode ".$item['name']; - $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; - $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "if (".$Component."Helper::checkArray(\$".$item['name']."Array))"; - $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "{"; - $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(4) . "\$item->".$item['name']." = implode('|',\$".$item['name']."Array);"; - $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "}"; + $fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "//".Line::_(__Line__, __Class__)." decode ".$item['name']; + $fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; + $fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "if (".$Component."Helper::checkArray(\$".$item['name']."Array))"; + $fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "{"; + $fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(4) . "\$item->".$item['name']." = implode('|',\$".$item['name']."Array);"; + $fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "}"; } */ elseif ($item['translation'] && !$export && $item['method'] != 6) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " decode " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " decode " . $item['name']; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$" . $item['name'] . "Names = array();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "\$" . $item['name'] . "Names[] = JText:" . ":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$item->" . $item['name'] . " = implode(', ', \$" . $item['name'] . "Names);"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}"; } else { @@ -22049,10 +21851,10 @@ class Interpretation extends Fields $_placeholder_for_field = array('[[[field]]]' => "\$item->" . $item['name']); - $fix .= $this->setPlaceholders( - PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= CFactory::_('Placeholder')->update( + PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . implode( - PHP_EOL . $this->_t(1) . $tab . $this->_t( + PHP_EOL . Indent::_(1) . $tab . Indent::_( 3 ), $this->expertFieldModeling[$nameSingleCode][$item['name']]['get'] @@ -22064,68 +21866,68 @@ class Interpretation extends Fields $taber = ''; if ($item['method'] == 3) { - $taber = $this->_t(1); - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) + $taber = Indent::_(1); + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "if (\$basickey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "{"; } elseif ($item['method'] == 5) { - $taber = $this->_t(1); - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) + $taber = Indent::_(1); + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "if (\$mediumkey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "{"; } elseif ($item['method'] == 4) { - $taber = $this->_t(1); - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) + $taber = Indent::_(1); + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "if (\$whmcskey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "{"; } if ($item['method'] == 3 || $item['method'] == 4 || $item['method'] == 5) { - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " decrypt " . $item['name']; } else { - $fix .= PHP_EOL . $this->_t(1) . $tab . $taber - . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fix .= PHP_EOL . Indent::_(1) . $tab . $taber + . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " decode " . $item['name']; } - $fix .= PHP_EOL . $this->_t(1) . $tab . $taber - . $this->_t(3) . "\$item->" . $item['name'] + $fix .= PHP_EOL . Indent::_(1) . $tab . $taber + . Indent::_(3) . "\$item->" . $item['name'] . " = " . $decode . "(\$item->" . $item['name'] . ");"; if ($item['method'] == 3 || $item['method'] == 4 || $item['method'] == 5) { - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "}"; } } } @@ -22133,76 +21935,76 @@ class Interpretation extends Fields { if ($export && $item['type'] === 'repeatable') { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) - . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) + . "//" . Line::_(__Line__, __Class__) . " decode repeatable " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "\$bucket" . $item['name'] . " = array();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . "FieldName => \$" . $item['name'] . ")"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(6) . "\$bucket" . $item['name'] . "[] = \$" . $item['name'] . "FieldName . '<||VDM||>' . implode('<|VDM|>',\$" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) - . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) + . "//" . Line::_(__Line__, __Class__) . " make sure the bucket has values."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "if (" . $Component . "Helper::checkArray(\$bucket" . $item['name'] . "))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) - . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) + . "//" . Line::_(__Line__, __Class__) . " clear the repeatable field."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "unset(\$item->" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) - . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) + . "//" . Line::_(__Line__, __Class__) . " set repeatable field for export."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "\$item->" . $item['name'] . " = implode('<|||VDM|||>',\$bucket" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) - . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) + . "//" . Line::_(__Line__, __Class__) . " unset the bucket."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(5) . "unset(\$bucket" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}"; } elseif ($item['method'] == 1 && !$export) { // TODO we check if this works well. - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) - . "//" . $this->setLine(__LINE__) . " convert " + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) + . "//" . Line::_(__Line__, __Class__) . " convert " . $item['name']; if (isset($item['custom']['table'])) { @@ -22221,8 +22023,8 @@ class Interpretation extends Fields { $keyTableNAme = $item['custom']['table']; } - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "\$item->" . $item['name'] + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" @@ -22232,8 +22034,8 @@ class Interpretation extends Fields } else { - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "\$item->" . $item['name'] + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" @@ -22245,12 +22047,12 @@ class Interpretation extends Fields if (!$export) { // For those we have not cached yet. - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " convert " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(3) . "\$item->" . $item['name'] + $fix .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ");"; @@ -22265,8 +22067,8 @@ class Interpretation extends Fields { foreach ($this->selectionTranslationFixBuilder[$nameListCode] as $name => $values) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $name; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " convert " . $name; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; } } */ // load the relations after modeling @@ -22295,28 +22097,27 @@ class Interpretation extends Fields || $all) { // start the loop - $forEachStart = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t( + $forEachStart = PHP_EOL . PHP_EOL . Indent::_(1) . $tab . Indent::_( 1 - ) . "//" . $this->setLine(__LINE__) + ) . "//" . Line::_(__Line__, __Class__) . " Set values to display correctly."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "if (" . $Component . "Helper::checkArray(\$items))"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "{"; // do not add to export since it is already done if (!$export) { - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) - . "//" . $this->setLine(__LINE__) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) + . "//" . Line::_(__Line__, __Class__) . " Get the user object if not set."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "if (!isset(\$user) || !" - . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkObject(\$user))"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$user))"; + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "{"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$user = JFactory::getUser();"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "}"; } // the permissional acttion switch @@ -22356,11 +22157,11 @@ class Interpretation extends Fields // add the notes and get the global switch if ($hasPermissional) { - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t( + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_( 2 - ) . "//" . $this->setLine(__LINE__) + ) . "//" . Line::_(__Line__, __Class__) . " Get global permissional control activation. (default is inactive)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t( + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_( 2 ) . "\$strict_permission_per_field = JComponentHelper::getParams('com_" @@ -22369,20 +22170,20 @@ class Interpretation extends Fields . PHP_EOL; } } - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "foreach (\$items as \$nr => &\$item)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "{"; // add the access options $forEachStart .= $fix_access; // add the permissional removal of values the user has not right to view or access if ($hasPermissional) { - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) - . "//" . $this->setLine(__LINE__) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) + . "//" . Line::_(__Line__, __Class__) . " use permissional control if globally set."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "if (\$strict_permission_per_field)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "{"; foreach ( $this->permissionFields[$nameSingleCode] as $fieldName => @@ -22397,72 +22198,72 @@ class Interpretation extends Fields { case 'access': case 'view': - $forEachStart .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(4) . "//" . $this->setLine( - __LINE__ + $forEachStart .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(4) . "//" . Line::_( + __LINE__,__CLASS__ ) . " set " . $permission_option . " permissional control for " . $fieldName . " value."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(4) . "if (isset(\$item->" + $forEachStart .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(4) . "if (isset(\$item->" . $fieldName . ") && (!\$user->authorise('" . $nameSingleCode . "." . $permission_option . "." . $fieldName . "', 'com_" . $component . "." . $nameSingleCode . ".' . (int) \$item->id)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(5) . "|| !\$user->authorise('" + $forEachStart .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(5) . "|| !\$user->authorise('" . $nameSingleCode . "." . $permission_option . "." . $fieldName . "', 'com_" . $component . "')))"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(4) . "{"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(5) . "//" . $this->setLine( - __LINE__ + $forEachStart .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(4) . "{"; + $forEachStart .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(5) . "//" . Line::_( + __LINE__,__CLASS__ ) . " We JUST empty the value (do you have a better idea)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(5) . "\$item->" . $fieldName + $forEachStart .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(5) . "\$item->" . $fieldName . " = '';"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab - . $this->_t(4) . "}"; + $forEachStart .= PHP_EOL . Indent::_(1) . $tab + . Indent::_(4) . "}"; break; } } } - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}"; } // remove these values if export if ($export) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" - . $this->setLine(__LINE__) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " unset the values we don't want exported."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "unset(\$item->asset_id);"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "unset(\$item->checked_out);"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "unset(\$item->checked_out_time);"; } - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "}"; if ($export) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) . " Add headers to items array."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "//" + . Line::_(__Line__, __Class__) . " Add headers to items array."; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$headers = \$this->getExImPortHeaders();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "if (" . $Component . "Helper::checkObject(\$headers))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "array_unshift(\$items,\$headers);"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "}"; } } @@ -22479,16 +22280,16 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab - . $this->_t(1) . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab + . Indent::_(1) . "//" . Line::_(__Line__, __Class__) . " Get the " . $cryptionType . " encryption key."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "//" . $this->setLine(__LINE__) + $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "//" . Line::_(__Line__, __Class__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; } @@ -22507,9 +22308,9 @@ class Interpretation extends Fields $block ) { - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . implode( - PHP_EOL . $this->_t(1) . $tab . $this->_t(1), + PHP_EOL . Indent::_(1) . $tab . Indent::_(1), $block ); } @@ -22636,7 +22437,7 @@ class Interpretation extends Fields break; } // Trigger Event: jcb_ce_setClassHeader - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_setClassHeader', array(&$this->componentContext, &$context, &$codeName, &$headers) @@ -22645,7 +22446,7 @@ class Interpretation extends Fields if (ArrayHelper::check($headers)) { // return the headers - return $this->setPlaceholders(implode(PHP_EOL, $headers), $this->placeholders); + return CFactory::_('Placeholder')->update(implode(PHP_EOL, $headers), $this->placeholders); } return $default; @@ -22772,8 +22573,8 @@ class Interpretation extends Fields $filter_name_select, 'U' ); // and to translation - $this->setLangContent( - $this->lang, $filter_name_select_lang, $filter_name_select + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $filter_name_select_lang, $filter_name_select ); // add the header $headers[] @@ -22813,23 +22614,23 @@ class Interpretation extends Fields array_keys($field), array_values($field), $item['set'] ) ); - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . implode( - PHP_EOL . $this->_t(1) . $tab . $this->_t(3), $code + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . implode( + PHP_EOL . Indent::_(1) . $tab . Indent::_(3), $code ); } else { // concatenate - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " concatenate these fields"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " concatenate these fields"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$item->" . $item['code'] . ' = ' . implode( " . '" . str_replace("'", ''', $item['set']) . "' . ", $field ) . ';'; } - return $this->setPlaceholders($fix, $this->placeholders); + return CFactory::_('Placeholder')->update($fix, $this->placeholders); } public function setSelectionTranslationFix($views, $Component, $tab = '') @@ -22841,29 +22642,29 @@ class Interpretation extends Fields $this->selectionTranslationFixBuilder[$views] )) { - $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "//" . $this->setLine(__LINE__) + $fix .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab . Indent::_(1) + . "//" . Line::_(__Line__, __Class__) . " set selection value to a translatable value"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "if (" . $Component . "Helper::checkArray(\$items))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "foreach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "{"; foreach ( $this->selectionTranslationFixBuilder[$views] as $name => $values ) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" - . $this->setLine(__LINE__) . " convert " . $name; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//" + . Line::_(__Line__, __Class__) . " convert " . $name; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; } - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}" + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "}"; + $fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "}" . PHP_EOL; } @@ -22879,15 +22680,15 @@ class Interpretation extends Fields $this->selectionTranslationFixBuilder[$views] )) { - $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**"; + $fix .= PHP_EOL . Indent::_(1) . " * Method to convert selection values to translatable string."; - $fix .= PHP_EOL . $this->_t(1) . " *"; - $fix .= PHP_EOL . $this->_t(1) . " * @return translatable string"; - $fix .= PHP_EOL . $this->_t(1) . " */"; - $fix .= PHP_EOL . $this->_t(1) + $fix .= PHP_EOL . Indent::_(1) . " *"; + $fix .= PHP_EOL . Indent::_(1) . " * @return translatable string"; + $fix .= PHP_EOL . Indent::_(1) . " */"; + $fix .= PHP_EOL . Indent::_(1) . "public function selectionTranslation(\$value,\$name)"; - $fix .= PHP_EOL . $this->_t(1) . "{"; + $fix .= PHP_EOL . Indent::_(1) . "{"; foreach ( $this->selectionTranslationFixBuilder[$views] as $name => $values @@ -22895,13 +22696,13 @@ class Interpretation extends Fields { if (ArrayHelper::check($values)) { - $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $fix .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Array of " . $name . " language strings"; - $fix .= PHP_EOL . $this->_t(2) . "if (\$name === '" + $fix .= PHP_EOL . Indent::_(2) . "if (\$name === '" . $name . "')"; - $fix .= PHP_EOL . $this->_t(2) . "{"; - $fix .= PHP_EOL . $this->_t(3) . "\$" . $name + $fix .= PHP_EOL . Indent::_(2) . "{"; + $fix .= PHP_EOL . Indent::_(3) . "\$" . $name . "Array = array("; $counter = 0; foreach ($values as $value => $translang) @@ -22921,32 +22722,32 @@ class Interpretation extends Fields } if ($counter == 0) { - $fix .= PHP_EOL . $this->_t(4) . $key . " => '" + $fix .= PHP_EOL . Indent::_(4) . $key . " => '" . $translang . "'"; } else { - $fix .= "," . PHP_EOL . $this->_t(4) . $key + $fix .= "," . PHP_EOL . Indent::_(4) . $key . " => '" . $translang . "'"; } $counter++; } - $fix .= PHP_EOL . $this->_t(3) . ");"; - $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( - __LINE__ + $fix .= PHP_EOL . Indent::_(3) . ");"; + $fix .= PHP_EOL . Indent::_(3) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Now check if value is found in this array"; - $fix .= PHP_EOL . $this->_t(3) . "if (isset(\$" . $name + $fix .= PHP_EOL . Indent::_(3) . "if (isset(\$" . $name . "Array[\$value]) && " . $Component . "Helper::checkString(\$" . $name . "Array[\$value]))"; - $fix .= PHP_EOL . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(4) . "return \$" . $name + $fix .= PHP_EOL . Indent::_(3) . "{"; + $fix .= PHP_EOL . Indent::_(4) . "return \$" . $name . "Array[\$value];"; - $fix .= PHP_EOL . $this->_t(3) . "}"; - $fix .= PHP_EOL . $this->_t(2) . "}"; + $fix .= PHP_EOL . Indent::_(3) . "}"; + $fix .= PHP_EOL . Indent::_(2) . "}"; } } - $fix .= PHP_EOL . $this->_t(2) . "return \$value;"; - $fix .= PHP_EOL . $this->_t(1) . "}"; + $fix .= PHP_EOL . Indent::_(2) . "return \$value;"; + $fix .= PHP_EOL . Indent::_(1) . "}"; } return $fix; @@ -22956,14 +22757,14 @@ class Interpretation extends Fields { if (strlen($viewsCodeName) > 0) { - $router = PHP_EOL . $this->_t(2) . "case '" . $viewsCodeName . "':"; - $router .= PHP_EOL . $this->_t(3) + $router = PHP_EOL . Indent::_(2) . "case '" . $viewsCodeName . "':"; + $router .= PHP_EOL . Indent::_(3) . "\$id = explode(':', \$segments[\$count-1]);"; - $router .= PHP_EOL . $this->_t(3) . "\$vars['id'] = (int) \$id[0];"; - $router .= PHP_EOL . $this->_t(3) . "\$vars['view'] = '" + $router .= PHP_EOL . Indent::_(3) . "\$vars['id'] = (int) \$id[0];"; + $router .= PHP_EOL . Indent::_(3) . "\$vars['view'] = '" . $viewsCodeName . "';"; - $router .= PHP_EOL . $this->_t(2) . "break;"; + $router .= PHP_EOL . Indent::_(2) . "break;"; return $router; } @@ -23002,10 +22803,10 @@ class Interpretation extends Fields $this->permissionDashboard ); - return PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) - . " view access array" . PHP_EOL . $this->_t(2) - . "\$viewAccess = array(" . PHP_EOL . $this->_t(3) . implode( - "," . PHP_EOL . $this->_t(3), $this->permissionDashboard + return PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) + . " view access array" . PHP_EOL . Indent::_(2) + . "\$viewAccess = array(" . PHP_EOL . Indent::_(3) . implode( + "," . PHP_EOL . Indent::_(3), $this->permissionDashboard ) . ");"; } @@ -23067,7 +22868,7 @@ class Interpretation extends Fields $view['settings']->name_single, 'U' ) . '_ADD'; // add to lang - $this->setLangContent($this->lang, $langKey, $langName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langKey, $langName); $counter++; } if (isset($view['dashboard_list']) @@ -23104,7 +22905,7 @@ class Interpretation extends Fields $view['settings']->name_list, 'U' ); // add to lang - $this->setLangContent($this->lang, $langKey, $langName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langKey, $langName); $counter++; } // dashboard link to category on dashboard is build here @@ -23153,7 +22954,7 @@ class Interpretation extends Fields ) . '_' . StringHelper::safe( $catCode, 'U' ); - $this->setLangContent($this->lang, $langKey, $langName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langKey, $langName); // get image type $type = ComponentbuilderHelper::imageInfo( $view['settings']->icon_category @@ -23254,7 +23055,7 @@ class Interpretation extends Fields ); // return the methods - return PHP_EOL . PHP_EOL . $this->setPlaceholders( + return PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( $this->componentData->php_dashboard_methods, $this->placeholders ); @@ -23281,8 +23082,8 @@ class Interpretation extends Fields } // return the gets - return PHP_EOL . $this->_t(2) . implode( - PHP_EOL . $this->_t(2), $gets + return PHP_EOL . Indent::_(2) . implode( + PHP_EOL . Indent::_(2), $gets ); } @@ -23295,7 +23096,7 @@ class Interpretation extends Fields $display = array(); $mainAccordianName = 'cPanel'; $builder = array(); - $tab = $this->_t(1); + $tab = Indent::_(1); $loadTabs = false; // check if we have custom tabs if (isset($this->componentData->dashboard_tab) @@ -23307,21 +23108,21 @@ class Interpretation extends Fields foreach ($this->componentData->dashboard_tab as $data) { $builder[$data['name']][$data['header']] - = $this->setPlaceholders( + = CFactory::_('Placeholder')->update( $data['html'], $this->placeholders ); } // since we have custom tabs we must load the tab structure around the cpanel $display[] = '
    '; - $display[] = $this->_t(1) . '
    '; - $display[] = $this->_t(1) + $display[] = Indent::_(1) . '
    '; + $display[] = Indent::_(1) . " 'cpanel')); ?>"; - $display[] = PHP_EOL . $this->_t(2) + $display[] = PHP_EOL . Indent::_(2) . ""; - $display[] = $this->_t(2) . '
    '; + $display[] = Indent::_(2) . '
    '; // set the tab to insure correct spacing - $tab = $this->_t(3); + $tab = Indent::_(3); // change the name of the main tab $mainAccordianName = 'Control Panel'; $loadTabs = true; @@ -23332,49 +23133,49 @@ class Interpretation extends Fields } // set dashboard display $display[] = $tab . '
    '; - $display[] = $tab . $this->_t(1) + $display[] = $tab . Indent::_(1) . " 'main')); ?>"; - $display[] = $tab . $this->_t(2) + $display[] = $tab . Indent::_(2) . ""; - $display[] = $tab . $this->_t(3) + $display[] = $tab . Indent::_(3) . "loadTemplate('main');?>"; - $display[] = $tab . $this->_t(2) + $display[] = $tab . Indent::_(2) . ""; - $display[] = $tab . $this->_t(1) + $display[] = $tab . Indent::_(1) . ""; $display[] = $tab . "
    "; $display[] = $tab . '
    '; - $display[] = $tab . $this->_t(1) + $display[] = $tab . Indent::_(1) . " 'vdm')); ?>"; - $display[] = $tab . $this->_t(2) + $display[] = $tab . Indent::_(2) . "fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] + . $this->fileContentStatic[Placefix::_h('COMPANYNAME')] . "', 'vdm'); ?>"; - $display[] = $tab . $this->_t(3) + $display[] = $tab . Indent::_(3) . "loadTemplate('vdm');?>"; - $display[] = $tab . $this->_t(2) + $display[] = $tab . Indent::_(2) . ""; - $display[] = $tab . $this->_t(1) + $display[] = $tab . Indent::_(1) . ""; $display[] = $tab . "
    "; if ($loadTabs) { - $display[] = $this->_t(2) . "
    "; - $display[] = $this->_t(2) + $display[] = Indent::_(2) . "
    "; + $display[] = Indent::_(2) . ""; // load the new tabs foreach ($builder as $tabname => $accordians) { $alias = StringHelper::safe($tabname); - $display[] = PHP_EOL . $this->_t(2) + $display[] = PHP_EOL . Indent::_(2) . ""; - $display[] = $this->_t(2) . '
    '; + $display[] = Indent::_(2) . '
    '; $display[] = $tab . '
    '; - $display[] = $tab . $this->_t(1) + $display[] = $tab . Indent::_(1) . " '" . $alias . "_one')); ?>"; @@ -23388,14 +23189,14 @@ class Interpretation extends Fields $slidecounter ); $tempName = $alias . '_' . $ac_alias; - $display[] = $tab . $this->_t(2) + $display[] = $tab . Indent::_(2) . ""; - $display[] = $tab . $this->_t(3) + $display[] = $tab . Indent::_(3) . "loadTemplate('" . $tempName . "');?>"; - $display[] = $tab . $this->_t(2) + $display[] = $tab . Indent::_(2) . ""; $slidecounter++; // build the template file @@ -23403,30 +23204,28 @@ class Interpretation extends Fields $this->buildDynamique($target, 'template', $tempName); // set the file data $TARGET = StringHelper::safe( - $this->target, 'U' + CFactory::_('Config')->build_target, 'U' ); // SITE_TEMPLATE_BODY <<>> $this->fileContentDynamic[$this->componentCodeName . '_' - . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_BODY' - . $this->hhh] + . $tempName][Placefix::_h('CUSTOM_ADMIN_TEMPLATE_BODY')] = PHP_EOL . $html; // SITE_TEMPLATE_CODE_BODY <<>> $this->fileContentDynamic[$this->componentCodeName . '_' - . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_CODE_BODY' - . $this->hhh] + . $tempName][Placefix::_h('CUSTOM_ADMIN_TEMPLATE_CODE_BODY')] = ''; } - $display[] = $tab . $this->_t(1) + $display[] = $tab . Indent::_(1) . ""; $display[] = $tab . "
    "; - $display[] = $this->_t(2) . "
    "; - $display[] = $this->_t(2) + $display[] = Indent::_(2) . "
    "; + $display[] = Indent::_(2) . ""; } - $display[] = PHP_EOL . $this->_t(1) + $display[] = PHP_EOL . Indent::_(1) . ""; - $display[] = $this->_t(1) . "
    "; + $display[] = Indent::_(1) . "
    "; } $display[] = "
    "; @@ -23468,7 +23267,7 @@ class Interpretation extends Fields $langKey = $this->langPrefix . '_DASHBOARD_' . $menu['settings']->CODE; // add to lang - $this->setLangContent($this->lang, $langKey, $langName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langKey, $langName); // set icon if ($counter == 0) { @@ -23505,7 +23304,7 @@ class Interpretation extends Fields $langKey = $this->langPrefix . '_DASHBOARD_' . $menu['settings']->CODE; // add to lang - $this->setLangContent($this->lang, $langKey, $langName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langKey, $langName); // set icon $this->lastCustomDashboardIcon[$nr] = ", '" . $type . $menu['settings']->code . "'"; @@ -23548,7 +23347,7 @@ class Interpretation extends Fields $langName = $menu['name'] . '

    '; $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; // add to lang - $this->setLangContent($this->lang, $langKey, $langName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langKey, $langName); // if this is a link build the icon values with pipe if (isset($menu['link']) @@ -23604,7 +23403,7 @@ class Interpretation extends Fields $langName = $menu['name'] . '

    '; $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; // add to lang - $this->setLangContent($this->lang, $langKey, $langName); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langKey, $langName); // if this is a link build the icon values with pipe if (isset($menu['link']) @@ -23646,8 +23445,8 @@ class Interpretation extends Fields . "_DASHBOARD'), 'index.php?option=com_" . $codeName . "&view=" . $codeName . "', \$submenu === '" . $codeName . "');"; - $this->setLangContent( - $this->lang, $lang . '_DASHBOARD', 'Dashboard' + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DASHBOARD', 'Dashboard' ); } $catArray = array(); @@ -23685,22 +23484,22 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] )) { - $menus .= PHP_EOL . $this->_t(2) + $menus .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingleCode . ".submenu', 'com_" . $codeName . "'))"; - $menus .= PHP_EOL . $this->_t(2) . "{"; + $menus .= PHP_EOL . Indent::_(2) . "{"; // add tab to lines to follow - $tab = $this->_t(1); + $tab = Indent::_(1); } - $menus .= PHP_EOL . $this->_t(2) . $tab + $menus .= PHP_EOL . Indent::_(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameListCode . "', \$submenu === '" . $nameListCode . "');"; - $this->setLangContent( - $this->lang, $lang . "_" . $nameUpper, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . "_" . $nameUpper, $view['settings']->name_list ); // check if category has another name @@ -23740,7 +23539,7 @@ class Interpretation extends Fields $_menu = "categories"; } // now load the menus - $menus .= PHP_EOL . $this->_t(2) . $tab + $menus .= PHP_EOL . Indent::_(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $this->categoryBuilder[$nameListCode]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=" @@ -23760,35 +23559,35 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] )) { - $menus .= PHP_EOL . $this->_t(2) . "}"; + $menus .= PHP_EOL . Indent::_(2) . "}"; } } // set the Joomla custom fields options if (isset($view['joomla_fields']) && $view['joomla_fields'] == 1) { - $menus .= PHP_EOL . $this->_t(2) + $menus .= PHP_EOL . Indent::_(2) . "if (JComponentHelper::isEnabled('com_fields'))"; - $menus .= PHP_EOL . $this->_t(2) . "{"; - $menus .= PHP_EOL . $this->_t(3) + $menus .= PHP_EOL . Indent::_(2) . "{"; + $menus .= PHP_EOL . Indent::_(3) . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "_FIELDS'), 'index.php?option=com_fields&context=com_" . $codeName . "." . $nameSingleCode . "', \$submenu === 'fields.fields');"; - $menus .= PHP_EOL . $this->_t(3) + $menus .= PHP_EOL . Indent::_(3) . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "_FIELDS_GROUPS'), 'index.php?option=com_fields&view=groups&context=com_" . $codeName . "." . $nameSingleCode . "', \$submenu === 'fields.groups');"; - $menus .= PHP_EOL . $this->_t(2) . "}"; - $this->setLangContent( - $this->lang, $lang . "_" . $nameUpper . "_FIELDS", + $menus .= PHP_EOL . Indent::_(2) . "}"; + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . "_" . $nameUpper . "_FIELDS", $view['settings']->name_list . ' Fields' ); - $this->setLangContent( - $this->lang, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . "_" . $nameUpper . "_FIELDS_GROUPS", $view['settings']->name_list . ' Field Groups' ); @@ -23900,28 +23699,28 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] )) { - $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $custom .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Access control (" . $core['core.access'] . " && " . $nameSingle . ".submenu)."; - $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" + $custom .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $custom .= PHP_EOL . $this->_t(2) . "{"; + $custom .= PHP_EOL . Indent::_(2) . "{"; // add tab to lines to follow - $tab = $this->_t(1); + $tab = Indent::_(1); } else { - $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( - __LINE__ + $custom .= PHP_EOL . Indent::_(2) . "//" . Line::_( + __LINE__,__CLASS__ ) . " Access control (" . $nameSingle . ".submenu)."; - $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" + $custom .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $custom .= PHP_EOL . $this->_t(2) . "{"; + $custom .= PHP_EOL . Indent::_(2) . "{"; // add tab to lines to follow - $tab = $this->_t(1); + $tab = Indent::_(1); } if (isset($menu['link']) && StringHelper::check( @@ -23929,29 +23728,29 @@ class Interpretation extends Fields )) { - $this->setLangContent( - $this->lang, $lang . '_' . $nameUpper, $name + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_' . $nameUpper, $name ); // add custom menu - $custom .= PHP_EOL . $this->_t(2) . $tab + $custom .= PHP_EOL . Indent::_(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; } else { - $this->setLangContent( - $this->lang, $lang . '_' . $nameUpper, $name + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_' . $nameUpper, $name ); // add custom menu - $custom .= PHP_EOL . $this->_t(2) . $tab + $custom .= PHP_EOL . Indent::_(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; } // check if the item has permissions. - $custom .= PHP_EOL . $this->_t(2) . "}"; + $custom .= PHP_EOL . Indent::_(2) . "}"; return $custom; } @@ -23979,51 +23778,51 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] )) { - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) + $this->lastCustomSubMenu[$nr] .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "{"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . Indent::_(2) . "{"; // add tab to lines to follow - $tab = $this->_t(1); + $tab = Indent::_(1); } else { - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) + $this->lastCustomSubMenu[$nr] .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "{"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . Indent::_(2) . "{"; // add tab to lines to follow - $tab = $this->_t(1); + $tab = Indent::_(1); } if (isset($menu['link']) && StringHelper::check( $menu['link'] )) { - $this->setLangContent( - $this->lang, $lang . '_' . $nameUpper, $name + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_' . $nameUpper, $name ); // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab + $this->lastCustomSubMenu[$nr] .= PHP_EOL . Indent::_(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; } else { - $this->setLangContent( - $this->lang, $lang . '_' . $nameUpper, $name + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_' . $nameUpper, $name ); // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab + $this->lastCustomSubMenu[$nr] .= PHP_EOL . Indent::_(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; } // check if the item has permissions. - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "}"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . Indent::_(2) . "}"; } return false; @@ -24072,13 +23871,13 @@ class Interpretation extends Fields // add the prefix if ($addPrefix == 1) { - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang, $prefix . $this->componentData->name ); } else { - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang, $this->componentData->name ); } @@ -24095,10 +23894,10 @@ class Interpretation extends Fields $nameUpper = StringHelper::safe( $view['settings']->name_list, 'U' ); - $menus .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_' . $nameUpper, $view['settings']->name_list ); @@ -24138,12 +23937,12 @@ class Interpretation extends Fields if (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && $view['adminview'] == $menu['before']) { - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_' . $menu['settings']->CODE, $menu['settings']->name ); // add custom menu - $customMenu .= PHP_EOL . $this->_t(3) + $customMenu .= PHP_EOL . Indent::_(3) . '' . $lang . '_' . $menu['settings']->CODE . ''; @@ -24151,12 +23950,12 @@ class Interpretation extends Fields elseif (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && empty($menu['before'])) { - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_' . $menu['settings']->CODE, $menu['settings']->name ); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) + $this->lastCustomMainMenu[$nr] = PHP_EOL . Indent::_(3) . '' . $lang . '_' . $menu['settings']->CODE . ''; @@ -24185,7 +23984,7 @@ class Interpretation extends Fields $nameUpper = StringHelper::safe( $menu['name'], 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_' . $nameUpper, $menu['name'] ); // sanitize url @@ -24213,7 +24012,7 @@ class Interpretation extends Fields $menu['link'], ENT_XML1, 'UTF-8' ); // add custom menu - $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; } @@ -24225,11 +24024,11 @@ class Interpretation extends Fields $nameUpper = StringHelper::safe( $menu['name_code'], 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_' . $nameUpper, $menu['name'] ); // add custom menu - $customMenu .= PHP_EOL . $this->_t(3) + $customMenu .= PHP_EOL . Indent::_(3) . '' . $lang . '_' . $nameUpper . ''; @@ -24247,7 +24046,7 @@ class Interpretation extends Fields $nameUpper = StringHelper::safe( $menu['name'], 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_' . $nameUpper, $menu['name'] ); // sanitize url @@ -24275,7 +24074,7 @@ class Interpretation extends Fields $menu['link'], ENT_XML1, 'UTF-8' ); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) + $this->lastCustomMainMenu[$nr] = PHP_EOL . Indent::_(3) . '' . $lang . '_' . $nameUpper . ''; } @@ -24287,11 +24086,11 @@ class Interpretation extends Fields $nameUpper = StringHelper::safe( $menu['name_code'], 'U' ); - $this->setLangContent( + CFactory::_('Language')->set( 'adminsys', $lang . '_' . $nameUpper, $menu['name'] ); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) + $this->lastCustomMainMenu[$nr] = PHP_EOL . Indent::_(3) . '' . $lang . '_' . $nameUpper . ''; @@ -24330,31 +24129,29 @@ class Interpretation extends Fields $nameListCode = 'configs'; // set place holders $placeholders = array(); - $placeholders[$this->hhh . 'component' . $this->hhh] + $placeholders[Placefix::_h('component')] = $this->componentCodeName; - $placeholders[$this->hhh . 'Component' . $this->hhh] + $placeholders[Placefix::_h('Component')] = StringHelper::safe( $this->componentData->name_code, 'F' ); - $placeholders[$this->hhh . 'COMPONENT' . $this->hhh] + $placeholders[Placefix::_h('COMPONENT')] = StringHelper::safe( $this->componentData->name_code, 'U' ); - $placeholders[$this->hhh . 'view' . $this->hhh] + $placeholders[Placefix::_h('view')] = $nameSingleCode; - $placeholders[$this->hhh . 'views' . $this->hhh] + $placeholders[Placefix::_h('views')] = $nameListCode; - $placeholders[$this->bbb . 'component' . $this->ddd] + $placeholders[Placefix::_('component')] = $this->componentCodeName; - $placeholders[$this->bbb . 'Component' . $this->ddd] - = $placeholders[$this->hhh . 'Component' - . $this->hhh]; - $placeholders[$this->bbb . 'COMPONENT' . $this->ddd] - = $placeholders[$this->hhh . 'COMPONENT' - . $this->hhh]; - $placeholders[$this->bbb . 'view' . $this->ddd] + $placeholders[Placefix::_('Component')] + = $placeholders[Placefix::_h('Component')]; + $placeholders[Placefix::_('COMPONENT')] + = $placeholders[Placefix::_h('COMPONENT')]; + $placeholders[Placefix::_('view')] = $nameSingleCode; - $placeholders[$this->bbb . 'views' . $this->ddd] + $placeholders[Placefix::_('views')] = $nameListCode; // load the global placeholders if (ArrayHelper::check( @@ -24374,7 +24171,7 @@ class Interpretation extends Fields // set the custom table key $dbkey = 'g'; // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, @@ -24401,13 +24198,13 @@ class Interpretation extends Fields = $xmlField; // set global params to db on install $fieldName = StringHelper::safe( - $this->setPlaceholders( + CFactory::_('Placeholder')->update( GetHelper::between( $xmlField, 'name="', '"' ), $placeholders ) ); - $fieldDefault = $this->setPlaceholders( + $fieldDefault = CFactory::_('Placeholder')->update( GetHelper::between( $xmlField, 'default="', '"' ), $placeholders @@ -24451,7 +24248,7 @@ class Interpretation extends Fields elseif (2 == $timer) // this is after the admin views are build { // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, @@ -24470,7 +24267,7 @@ class Interpretation extends Fields $this->setCustomControlConfigFieldsets($lang); } // Trigger Event: jcb_ce_onAfterSetConfigFieldsets - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->extensionsParams, @@ -24654,19 +24451,19 @@ class Interpretation extends Fields if (ArrayHelper::check($bucket)) { // setup lang - $this->setLangContent( - $this->lang, $lang . '_' . $tabUpper, $tab + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_' . $tabUpper, $tab ); // start field set - $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="' + $this->configFieldSets[] = Indent::_(1) . "configFieldSets[] = Indent::_(2) . 'name="' . $tabCode . '"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'label="' . $lang . '_' . $tabUpper . '">'; // set the fields $this->configFieldSets[] = implode("", $bucket); // close field set - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; } // remove after loading unset($this->configFieldSetsCustomField[$tab]); @@ -24683,36 +24480,36 @@ class Interpretation extends Fields )) { // start building field set for config - $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="group_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(1) . "configFieldSets[] = Indent::_(2) . 'name="group_config"'; + $this->configFieldSets[] = Indent::_(2) . 'label="' . $lang . '_GROUPS_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'description="' . $lang . '_GROUPS_DESC">'; // setup lang - $this->setLangContent( - $this->lang, $lang . '_GROUPS_LABEL', "Target Groups" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_GROUPS_LABEL', "Target Groups" ); - $this->setLangContent( - $this->lang, $lang . '_GROUPS_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_GROUPS_DESC', "The Parameters for the targeted groups are set here." ); - $this->setLangContent( - $this->lang, $lang . '_TARGET_GROUP_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_TARGET_GROUP_DESC', "Set the group/s being targeted by this user type." ); foreach ($this->setGroupControl as $selector => $label) { - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="usergroup"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $label + $this->configFieldSets[] = Indent::_(3) . 'type="usergroup"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $label . '"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_TARGET_GROUP_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'multiple="true"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(3) . 'multiple="true"'; + $this->configFieldSets[] = Indent::_(2) . "/>"; // set params defaults $this->extensionsParams[] = '"' . $selector . '":["2"]'; } @@ -24728,7 +24525,7 @@ class Interpretation extends Fields unset($this->configFieldSetsCustomField['Target Groups']); } // close that fieldse - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; } } @@ -24744,82 +24541,82 @@ class Interpretation extends Fields // start building field set for config $this->configFieldSets[] = 'configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'addrulepath="/administrator/components/com_' . $component . '/models/rules"'; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'addfieldpath="/administrator/components/com_' . $component . '/models/fields"'; - $this->configFieldSets[] = $this->_t(2) . 'name="global_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'name="global_config"'; + $this->configFieldSets[] = Indent::_(2) . 'label="' . $lang . '_GLOBAL_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'description="' . $lang . '_GLOBAL_DESC">'; // setup lang - $this->setLangContent($this->lang, $lang . '_GLOBAL_LABEL', "Global"); - $this->setLangContent( - $this->lang, $lang . '_GLOBAL_DESC', "The Global Parameters" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_GLOBAL_LABEL', "Global"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_GLOBAL_DESC', "The Global Parameters" ); // add auto checin if required if ($this->addCheckin) { - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="check_in"'; - $this->configFieldSets[] = $this->_t(3) . 'type="list"'; - $this->configFieldSets[] = $this->_t(3) . 'default="0"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . 'name="check_in"'; + $this->configFieldSets[] = Indent::_(3) . 'type="list"'; + $this->configFieldSets[] = Indent::_(3) . 'default="0"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_CHECK_TIMER_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_CHECK_TIMER_DESC">'; - $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-5 hours">' + $this->configFieldSets[] = Indent::_(3) . 'configFieldSets[] = Indent::_(4) . 'value="-5 hours">' . $lang . '_CHECK_TIMER_OPTION_ONE'; - $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-12 hours">' + $this->configFieldSets[] = Indent::_(3) . 'configFieldSets[] = Indent::_(4) . 'value="-12 hours">' . $lang . '_CHECK_TIMER_OPTION_TWO'; - $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-1 day">' . $lang + $this->configFieldSets[] = Indent::_(3) . 'configFieldSets[] = Indent::_(4) . 'value="-1 day">' . $lang . '_CHECK_TIMER_OPTION_THREE'; - $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-2 day">' . $lang + $this->configFieldSets[] = Indent::_(3) . 'configFieldSets[] = Indent::_(4) . 'value="-2 day">' . $lang . '_CHECK_TIMER_OPTION_FOUR'; - $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-1 week">' . $lang + $this->configFieldSets[] = Indent::_(3) . 'configFieldSets[] = Indent::_(4) . 'value="-1 week">' . $lang . '_CHECK_TIMER_OPTION_FIVE'; - $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="0">' . $lang + $this->configFieldSets[] = Indent::_(3) . 'configFieldSets[] = Indent::_(4) . 'value="0">' . $lang . '_CHECK_TIMER_OPTION_SIX'; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; + $this->configFieldSets[] = Indent::_(2) . ''; // setup lang - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_LABEL', "Check in timer" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_LABEL', "Check in timer" ); - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_DESC', "Set the intervals for the auto checkin fuction of tables that checks out the items to an user." ); - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_OPTION_ONE', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_OPTION_ONE', "Every five hours" ); - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_OPTION_TWO', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_OPTION_TWO', "Every twelve hours" ); - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day" ); - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_OPTION_FOUR', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_OPTION_FOUR', "Every second day" ); - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week" ); - $this->setLangContent( - $this->lang, $lang . '_CHECK_TIMER_OPTION_SIX', "Never" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHECK_TIMER_OPTION_SIX', "Never" ); // load the Global checkin defautls $this->extensionsParams[] = '"check_in":"-1 day"'; @@ -24827,33 +24624,33 @@ class Interpretation extends Fields // set history control if ($this->setTagHistory) { - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="save_history"'; - $this->configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . 'name="save_history"'; + $this->configFieldSets[] = Indent::_(3) . 'type="radio"'; + $this->configFieldSets[] = Indent::_(3) . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = $this->_t(3) . 'default="1"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'default="1"'; + $this->configFieldSets[] = Indent::_(3) . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'; - $this->configFieldSets[] = $this->_t(3) . ">"; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ">"; + $this->configFieldSets[] = Indent::_(3) . ''; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ''; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="history_limit"'; - $this->configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'filter="integer"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . ""; + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . 'name="history_limit"'; + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'filter="integer"'; + $this->configFieldSets[] = Indent::_(3) . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'default="10"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(3) . 'default="10"'; + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . ''; // load the Global checkin defautls $this->extensionsParams[] @@ -24871,49 +24668,49 @@ class Interpretation extends Fields unset($this->configFieldSetsCustomField['Global']); } // set the author details - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = Indent::_(3) . 'type="spacer"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_AUTHOR"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_AUTHOR_NAME_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_AUTHOR_NAME_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorName + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . $autorName . '"'; - $this->configFieldSets[] = $this->_t(3) . 'readonly="true"'; - $this->configFieldSets[] = $this->_t(3) . 'class="readonly"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="email"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'readonly="true"'; + $this->configFieldSets[] = Indent::_(3) . 'class="readonly"'; + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = Indent::_(3) . 'type="email"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_AUTHOR_EMAIL_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_AUTHOR_EMAIL_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorEmail + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . $autorEmail . '"'; - $this->configFieldSets[] = $this->_t(3) . 'readonly="true"'; - $this->configFieldSets[] = $this->_t(3) . 'class="readonly"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(3) . 'readonly="true"'; + $this->configFieldSets[] = Indent::_(3) . 'class="readonly"'; + $this->configFieldSets[] = Indent::_(2) . "/>"; // setup lang - $this->setLangContent($this->lang, $lang . '_AUTHOR', "Author Info"); - $this->setLangContent( - $this->lang, $lang . '_AUTHOR_NAME_LABEL', "Author Name" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_AUTHOR', "Author Info"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_AUTHOR_NAME_LABEL', "Author Name" ); - $this->setLangContent( - $this->lang, $lang . '_AUTHOR_NAME_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_AUTHOR_NAME_DESC', "The name of the author of this component." ); - $this->setLangContent( - $this->lang, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email" ); - $this->setLangContent( - $this->lang, $lang . '_AUTHOR_EMAIL_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_AUTHOR_EMAIL_DESC', "The email address of the author of this component." ); // set if contributors were added @@ -24946,103 +24743,103 @@ class Interpretation extends Fields $contributor['website'], ENT_XML1, 'UTF-8' ); // StringHelper::html($contributor['website']); // load to the $fieldsets - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ''; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; - $this->configFieldSets[] = $this->_t(3) . 'class="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="spacer"'; + $this->configFieldSets[] = Indent::_(3) . 'class="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_' . $COUNTER . '"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_TITLE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_TITLE_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbTitle + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . $cbTitle . '"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_NAME_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_NAME_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbName + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . $cbName . '"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="email"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="email"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_EMAIL_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_EMAIL_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbEmail + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . $cbEmail . '"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="url"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="url"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_LINK_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_LINK_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . $cbWebsite . '"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' + $this->configFieldSets[] = Indent::_(3) . 'type="list"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . (int) $contributor['use'] . '"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_USE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_USE_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' + $this->configFieldSets[] = Indent::_(3) . 'type="list"'; + $this->configFieldSets[] = Indent::_(3) . 'default="' . (int) $contributor['show'] . '"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_SHOW_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_SHOW_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = Indent::_(2) . ""; // add the contributor - $this->theContributors .= PHP_EOL . $this->_t(1) . "@" - . strtolower($contributor['title']) . $this->_t(2) + $this->theContributors .= PHP_EOL . Indent::_(1) . "@" + . strtolower($contributor['title']) . Indent::_(2) . $contributor['name'] . ' <' . $contributor['website'] . '>'; // setup lang $Counter = StringHelper::safe($counter, 'Ww'); - $this->setLangContent( - $this->lang, $langCont . '_' . $COUNTER, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_' . $COUNTER, "Contributor " . $Counter ); // load the Global checkin defautls @@ -25078,92 +24875,92 @@ class Interpretation extends Fields { $COUNTER = StringHelper::safe($counter, 'U'); - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ''; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; - $this->configFieldSets[] = $this->_t(3) . 'class="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="spacer"'; + $this->configFieldSets[] = Indent::_(3) . 'class="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_' . $COUNTER . '"'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_TITLE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_TITLE_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default=""'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default=""'; + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_NAME_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_NAME_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default=""'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default=""'; + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="email"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="email"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_EMAIL_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_EMAIL_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default=""'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default=""'; + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="url"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="url"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_LINK_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_LINK_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default=""'; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default=""'; + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; - $this->configFieldSets[] = $this->_t(3) . 'default="0"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="list"'; + $this->configFieldSets[] = Indent::_(3) . 'default="0"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_USE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_USE_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; - $this->configFieldSets[] = $this->_t(3) . 'default="0"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + $this->configFieldSets[] = Indent::_(3) . 'type="list"'; + $this->configFieldSets[] = Indent::_(3) . 'default="0"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $langCont . '_SHOW_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $langCont . '_SHOW_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = Indent::_(2) . ""; // setup lang $Counter = StringHelper::safe($counter, 'Ww'); - $this->setLangContent( - $this->lang, $langCont . '_' . $COUNTER, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_' . $COUNTER, "Contributor " . $Counter ); } @@ -25172,68 +24969,68 @@ class Interpretation extends Fields || $this->componentData->emptycontributors == 1) { // setup lang - $this->setLangContent( - $this->lang, $langCont . '_TITLE_LABEL', "Contributor Job Title" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_TITLE_LABEL', "Contributor Job Title" ); - $this->setLangContent( - $this->lang, $langCont . '_TITLE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_TITLE_DESC', "The job title that best describes the contributor's relationship to this component." ); - $this->setLangContent( - $this->lang, $langCont . '_NAME_LABEL', "Contributor Name" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_NAME_LABEL', "Contributor Name" ); - $this->setLangContent( - $this->lang, $langCont . '_NAME_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_NAME_DESC', "The name of this contributor." ); - $this->setLangContent( - $this->lang, $langCont . '_EMAIL_LABEL', "Contributor Email" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_EMAIL_LABEL', "Contributor Email" ); - $this->setLangContent( - $this->lang, $langCont . '_EMAIL_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_EMAIL_DESC', "The email of this contributor." ); - $this->setLangContent( - $this->lang, $langCont . '_LINK_LABEL', "Contributor Website" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_LINK_LABEL', "Contributor Website" ); - $this->setLangContent( - $this->lang, $langCont . '_LINK_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_LINK_DESC', "The link to this contributor's website." ); - $this->setLangContent($this->lang, $langCont . '_USE_LABEL', "Use"); - $this->setLangContent( - $this->lang, $langCont . '_USE_DESC', + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langCont . '_USE_LABEL', "Use"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_USE_DESC', "How should we link to this contributor." ); - $this->setLangContent($this->lang, $langCont . '_USE_NONE', "None"); - $this->setLangContent( - $this->lang, $langCont . '_USE_EMAIL', "Email" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langCont . '_USE_NONE', "None"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_USE_EMAIL', "Email" ); - $this->setLangContent( - $this->lang, $langCont . '_USE_WWW', "Website" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_USE_WWW', "Website" ); - $this->setLangContent( - $this->lang, $langCont . '_SHOW_LABEL', "Show" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_SHOW_LABEL', "Show" ); - $this->setLangContent( - $this->lang, $langCont . '_SHOW_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_SHOW_DESC', "Select where you want this contributor's details to show in the component." ); - $this->setLangContent( - $this->lang, $langCont . '_SHOW_NONE', "Hide" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_SHOW_NONE', "Hide" ); - $this->setLangContent( - $this->lang, $langCont . '_SHOW_BACK', "Back-end" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_SHOW_BACK', "Back-end" ); - $this->setLangContent( - $this->lang, $langCont . '_SHOW_FRONT', "Front-end" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_SHOW_FRONT', "Front-end" ); - $this->setLangContent( - $this->lang, $langCont . '_SHOW_ALL', "Both Front & Back-end" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $langCont . '_SHOW_ALL', "Both Front & Back-end" ); } // close that fieldset - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; } public function setUikitConfigFieldsets($lang) @@ -25243,41 +25040,41 @@ class Interpretation extends Fields // main lang prefix $lang = $lang . ''; // start building field set for uikit functions - $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="uikit_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(1) . "configFieldSets[] = Indent::_(2) . 'name="uikit_config"'; + $this->configFieldSets[] = Indent::_(2) . 'label="' . $lang . '_UIKIT_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'description="' . $lang . '_UIKIT_DESC">'; // set tab lang if (1 == $this->uikit) { - $this->setLangContent( - $this->lang, $lang . '_UIKIT_LABEL', "Uikit2 Settings" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_LABEL', "Uikit2 Settings" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework for developing fast and powerful web interfaces. For more info visit
    https://getuikit.com/v2/" ); } elseif (2 == $this->uikit) { - $this->setLangContent( - $this->lang, $lang . '_UIKIT_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_LABEL', "Uikit2 and Uikit3 Settings" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework for developing fast and powerful web interfaces. For more info visit version 2 or version 3" ); } elseif (3 == $this->uikit) { - $this->setLangContent( - $this->lang, $lang . '_UIKIT_LABEL', "Uikit3 Settings" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_LABEL', "Uikit3 Settings" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework for developing fast and powerful web interfaces. For more info visit https://getuikit.com/" ); } @@ -25286,171 +25083,171 @@ for developing fast and powerful web interfaces. For more info visit uikit) { // set field lang - $this->setLangContent( - $this->lang, $lang . '_UIKIT_VERSION_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_VERSION_LABEL', "Uikit Versions" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_VERSION_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_VERSION_DESC', "Select what version you would like to use" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_V2', "Version 2" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_V2', "Version 2" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_V3', "Version 3" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_V3', "Version 3" ); // set the field - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'type="radio"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_UIKIT_VERSION_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_UIKIT_VERSION_DESC"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = $this->_t(3) . 'default="2">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . '"'; - $this->configFieldSets[] = $this->_t(3) . '"'; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = Indent::_(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_version":"2"'; } // set field lang - $this->setLangContent( - $this->lang, $lang . '_UIKIT_LOAD_LABEL', "Loading Options" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_LOAD_LABEL', "Loading Options" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_LOAD_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_LOAD_DESC', "Set the uikit loading option." ); - $this->setLangContent($this->lang, $lang . '_AUTO_LOAD', "Auto"); - $this->setLangContent($this->lang, $lang . '_FORCE_LOAD', "Force"); - $this->setLangContent($this->lang, $lang . '_DONT_LOAD', "Not"); - $this->setLangContent( - $this->lang, $lang . '_ONLY_EXTRA', "Only Extra" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_AUTO_LOAD', "Auto"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_FORCE_LOAD', "Force"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_DONT_LOAD', "Not"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ONLY_EXTRA', "Only Extra" ); // set the field - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'type="radio"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_UIKIT_LOAD_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_UIKIT_LOAD_DESC"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = $this->_t(3) . 'default="">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . '"'; - $this->configFieldSets[] = $this->_t(3) . '"'; if (2 == $this->uikit || 1 == $this->uikit) { - $this->configFieldSets[] = $this->_t(3) . '"'; } - $this->configFieldSets[] = $this->_t(3) . '"'; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = Indent::_(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_load":"1"'; // set field lang - $this->setLangContent( - $this->lang, $lang . '_UIKIT_MIN_LABEL', "Load Minified" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_MIN_LABEL', "Load Minified" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_MIN_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_MIN_DESC', "Should the minified version of uikit files be loaded?" ); - $this->setLangContent($this->lang, $lang . '_YES', "Yes"); - $this->setLangContent($this->lang, $lang . '_NO', "No"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_YES', "Yes"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_NO', "No"); // set the field - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = Indent::_(3) . 'type="radio"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_UIKIT_MIN_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_UIKIT_MIN_DESC"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = $this->_t(3) . 'default="">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . '"'; - $this->configFieldSets[] = $this->_t(3) . '"'; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = Indent::_(3) . '"'; + $this->configFieldSets[] = Indent::_(3) . '"'; + $this->configFieldSets[] = Indent::_(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_min":""'; if (2 == $this->uikit || 1 == $this->uikit) { // set field lang - $this->setLangContent( - $this->lang, $lang . '_UIKIT_STYLE_LABEL', "css Style" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_STYLE_LABEL', "css Style" ); - $this->setLangContent( - $this->lang, $lang . '_UIKIT_STYLE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_UIKIT_STYLE_DESC', "Set the css style that should be used." ); - $this->setLangContent( - $this->lang, $lang . '_FLAT_LOAD', "Flat" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_FLAT_LOAD', "Flat" ); - $this->setLangContent( - $this->lang, $lang . '_ALMOST_FLAT_LOAD', "Almost Flat" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ALMOST_FLAT_LOAD', "Almost Flat" ); - $this->setLangContent( - $this->lang, $lang . '_GRADIANT_LOAD', "Gradient" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_GRADIANT_LOAD', "Gradient" ); // set the field - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'type="radio"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_UIKIT_STYLE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_UIKIT_STYLE_DESC"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'class="btn-group btn-group-yesno"'; if (2 == $this->uikit) { - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'showon="uikit_version:2"'; } - $this->configFieldSets[] = $this->_t(3) . 'default="">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . '"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . '"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . '"'; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = Indent::_(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_style":""'; } @@ -25466,7 +25263,7 @@ for developing fast and powerful web interfaces. For more info visit configFieldSetsCustomField['Uikit Settings']); } // close that fieldset - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; } } @@ -25478,15 +25275,15 @@ for developing fast and powerful web interfaces. For more info visit setLangContent( - $this->lang, $lang . '_MAIL_CONFIGURATION', "Mail Configuration" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAIL_CONFIGURATION', "Mail Configuration" ); - $this->setLangContent($this->lang, $lang . '_DKIM', "DKIM"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_DKIM', "DKIM"); // start building field set for email helper functions - $this->configFieldSets[] = PHP_EOL . $this->_t(1) . "configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = PHP_EOL . Indent::_(1) . "configFieldSets[] = Indent::_(2) . "name=\"mail_configuration_custom_config\""; - $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "label=\"" . $lang . "_MAIL_CONFIGURATION\">"; // add custom Mail Configurations if (isset($this->configFieldSetsCustomField['Mail Configuration']) @@ -25502,459 +25299,459 @@ for developing fast and powerful web interfaces. For more info visit setLangContent( - $this->lang, $lang . '_MAILONLINE_LABEL', "Mailer Status" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAILONLINE_LABEL', "Mailer Status" ); - $this->setLangContent( - $this->lang, $lang . '_MAILONLINE_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAILONLINE_DESCRIPTION', "Warning this will stop all emails from going out." ); - $this->setLangContent($this->lang, $lang . '_ON', "On"); - $this->setLangContent($this->lang, $lang . '_OFF', "Off"); - $this->setLangContent( - $this->lang, $lang . '_MAILER_LABEL', "Mailer" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_ON', "On"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_OFF', "Off"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAILER_LABEL', "Mailer" ); - $this->setLangContent( - $this->lang, $lang . '_MAILER_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAILER_DESCRIPTION', "Select what mailer you would like to use to send emails." ); - $this->setLangContent($this->lang, $lang . '_GLOBAL', "Global"); - $this->setLangContent( - $this->lang, $lang . '_PHP_MAIL', "PHP Mail" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_GLOBAL', "Global"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_PHP_MAIL', "PHP Mail" ); - $this->setLangContent( - $this->lang, $lang . '_SENDMAIL', "Sendmail" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SENDMAIL', "Sendmail" ); - $this->setLangContent($this->lang, $lang . '_SMTP', "SMTP"); - $this->setLangContent( - $this->lang, $lang . '_EMAILFROM_LABEL', " From Email" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_SMTP', "SMTP"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_EMAILFROM_LABEL', " From Email" ); - $this->setLangContent( - $this->lang, $lang . '_EMAILFROM_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_EMAILFROM_DESCRIPTION', "The global email address that will be used to send system email." ); - $this->setLangContent( - $this->lang, $lang . '_EMAILFROM_HINT', "Email Address Here" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_EMAILFROM_HINT', "Email Address Here" ); - $this->setLangContent( - $this->lang, $lang . '_FROMNAME_LABEL', "From Name" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_FROMNAME_LABEL', "From Name" ); - $this->setLangContent( - $this->lang, $lang . '_FROMNAME_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_FROMNAME_DESCRIPTION', "Text displayed in the header "From:" field when sending a site email. Usually the site name." ); - $this->setLangContent( - $this->lang, $lang . '_FROMNAME_HINT', "From Name Here" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_FROMNAME_HINT', "From Name Here" ); - $this->setLangContent( - $this->lang, $lang . '_EMAILREPLY_LABEL', " Reply to Email" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_EMAILREPLY_LABEL', " Reply to Email" ); - $this->setLangContent( - $this->lang, $lang . '_EMAILREPLY_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_EMAILREPLY_DESCRIPTION', "The global email address that will be used to set as the reply email. (leave blank for none)" ); - $this->setLangContent( - $this->lang, $lang . '_EMAILREPLY_HINT', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_EMAILREPLY_HINT', "Email Address Here" ); - $this->setLangContent( - $this->lang, $lang . '_REPLYNAME_LABEL', "Reply to Name" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_REPLYNAME_LABEL', "Reply to Name" ); - $this->setLangContent( - $this->lang, $lang . '_REPLYNAME_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_REPLYNAME_DESCRIPTION', "Text displayed in the header "Reply To:" field when replying to the site email. Usually the the person that receives the response. (leave blank for none)" ); - $this->setLangContent( - $this->lang, $lang . '_REPLYNAME_HINT', "Reply Name Here" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_REPLYNAME_HINT', "Reply Name Here" ); - $this->setLangContent( - $this->lang, $lang . '_SENDMAIL_LABEL', "Sendmail Path" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SENDMAIL_LABEL', "Sendmail Path" ); - $this->setLangContent( - $this->lang, $lang . '_SENDMAIL_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SENDMAIL_DESCRIPTION', "Enter the path to the sendmail program directory on your host server." ); - $this->setLangContent( - $this->lang, $lang . '_SENDMAIL_HINT', "/usr/sbin/sendmail" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SENDMAIL_HINT', "/usr/sbin/sendmail" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPAUTH_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPAUTH_LABEL', "SMTP Authentication" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPAUTH_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPAUTH_DESCRIPTION', "Select yes if your SMTP host requires SMTP Authentication." ); - $this->setLangContent($this->lang, $lang . '_YES', "Yes"); - $this->setLangContent($this->lang, $lang . '_NO', "No"); - $this->setLangContent( - $this->lang, $lang . '_SMTPSECURE_LABEL', "SMTP Security" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_YES', "Yes"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_NO', "No"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPSECURE_LABEL', "SMTP Security" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPSECURE_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPSECURE_DESCRIPTION', "Select the security model that your SMTP server uses." ); - $this->setLangContent($this->lang, $lang . '_NONE', "None"); - $this->setLangContent($this->lang, $lang . '_SSL', "SSL"); - $this->setLangContent($this->lang, $lang . '_TLS', "TLS"); - $this->setLangContent( - $this->lang, $lang . '_SMTPPORT_LABEL', "SMTP Port" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_NONE', "None"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_SSL', "SSL"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_TLS', "TLS"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPPORT_LABEL', "SMTP Port" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPPORT_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPPORT_DESCRIPTION', "Enter the port number of your SMTP server. Use 25 for most unsecured servers and 465 for most secure servers." ); - $this->setLangContent( - $this->lang, $lang . '_SMTPPORT_HINT', "25" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPPORT_HINT', "25" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPUSER_LABEL', "SMTP Username" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPUSER_LABEL', "SMTP Username" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPUSER_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPUSER_DESCRIPTION', "Enter the username for access to the SMTP host." ); - $this->setLangContent( - $this->lang, $lang . '_SMTPUSER_HINT', "email@demo.com" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPUSER_HINT', "email@demo.com" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPPASS_LABEL', "SMTP Password" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPPASS_LABEL', "SMTP Password" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPPASS_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPPASS_DESCRIPTION', "Enter the password for access to the SMTP host." ); - $this->setLangContent( - $this->lang, $lang . '_SMTPHOST_LABEL', "SMTP Host" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPHOST_LABEL', "SMTP Host" ); - $this->setLangContent( - $this->lang, $lang . '_SMTPHOST_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPHOST_DESCRIPTION', "Enter the name of the SMTP host." ); - $this->setLangContent( - $this->lang, $lang . '_SMTPHOST_HINT', "localhost" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SMTPHOST_HINT', "localhost" ); // set the mailer fields - $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"mailonline\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"radio\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"mailonline\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_MAILONLINE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_MAILONLINE_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"btn-group btn-group-yesno\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"1\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "default=\"1\">"; + $this->configFieldSets[] = Indent::_(3) . ""; + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"list\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"mailer\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"list\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"mailer\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_MAILER_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_MAILER_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"list_class\""; - $this->configFieldSets[] = $this->_t(3) . "multiple=\"false\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"WORD\""; - $this->configFieldSets[] = $this->_t(3) . "required=\"true\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"global\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "multiple=\"false\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"WORD\""; + $this->configFieldSets[] = Indent::_(3) . "required=\"true\""; + $this->configFieldSets[] = Indent::_(3) . "default=\"global\">"; + $this->configFieldSets[] = Indent::_(3) . ""; + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"emailfrom\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"emailfrom\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_EMAILFROM_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_EMAILFROM_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "validate=\"email\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "validate=\"email\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add email address here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_EMAILFROM_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"fromname\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"fromname\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_FROMNAME_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_FROMNAME_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add some name here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_FROMNAME_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"replyto\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"replyto\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_EMAILREPLY_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_EMAILREPLY_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "validate=\"email\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "validate=\"email\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add email address here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_EMAILREPLY_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"replytoname\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_REPLYNAME_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_REPLYNAME_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add some name here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_REPLYNAME_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"sendmail\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"sendmail\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_SENDMAIL_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_SENDMAIL_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "required=\"false\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"PATH\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "required=\"false\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"PATH\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add path to you local sendmail here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_SENDMAIL_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:sendmail\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"smtpauth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"radio\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"smtpauth\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_SMTPAUTH_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_SMTPAUTH_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"btn-group btn-group-yesno\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"0\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "default=\"0\""; + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"list\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"smtpsecure\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"list\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"smtpsecure\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_SMTPSECURE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_SMTPSECURE_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"list_class\""; - $this->configFieldSets[] = $this->_t(3) . "multiple=\"false\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"WORD\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"none\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "multiple=\"false\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"WORD\""; + $this->configFieldSets[] = Indent::_(3) . "default=\"none\""; + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"smtpport\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"smtpport\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_SMTPPORT_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"25\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "default=\"25\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_SMTPPORT_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add the port number of your SMTP server here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_SMTPPORT_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"smtpuser\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"smtpuser\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_SMTPUSER_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_SMTPUSER_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add the username for SMTP server here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_SMTPUSER_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"password\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"smtppass\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"password\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"smtppass\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_SMTPPASS_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_SMTPPASS_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"raw\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add the password for SMTP server here.\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"smtphost\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"smtphost\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_SMTPHOST_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "default=\"localhost\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_SMTPHOST_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add the name of the SMTP host here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_SMTPHOST_HINT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"mailer:smtp\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . "/>"; } // close that fieldset - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; // start dkim field set - $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(1) . "configFieldSets[] = Indent::_(2) . "name=\"dkim_custom_config\""; - $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "label=\"" . $lang . "_DKIM\">"; // add custom DKIM fields if (isset($this->configFieldSetsCustomField['DKIM']) @@ -25969,74 +25766,74 @@ for developing fast and powerful web interfaces. For more info visit setLangContent( - $this->lang, $lang . '_DKIM_LABEL', "Enable DKIM" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_LABEL', "Enable DKIM" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_DESCRIPTION', "Set this option to Yes if you want to sign your emails using DKIM." ); - $this->setLangContent($this->lang, $lang . '_YES', "Yes"); - $this->setLangContent($this->lang, $lang . '_NO', "No"); - $this->setLangContent( - $this->lang, $lang . '_DKIM_DOMAIN_LABEL', "Domain" + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_YES', "Yes"); + CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $lang . '_NO', "No"); + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_DOMAIN_LABEL', "Domain" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_DOMAIN_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_DOMAIN_DESCRIPTION', "Set the domain. Eg. domain.com" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_DOMAIN_HINT', "domain.com" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_DOMAIN_HINT', "domain.com" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_SELECTOR_LABEL', "Selector" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_SELECTOR_LABEL', "Selector" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_SELECTOR_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_SELECTOR_DESCRIPTION', "Set your DKIM/DNS selector." ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_SELECTOR_HINT', "vdm" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_SELECTOR_HINT', "vdm" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_PASSPHRASE_LABEL', "Passphrase" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_PASSPHRASE_LABEL', "Passphrase" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_PASSPHRASE_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_PASSPHRASE_DESCRIPTION', "Enter your passphrase here." ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_IDENTITY_LABEL', "Identity" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_IDENTITY_LABEL', "Identity" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_IDENTITY_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_IDENTITY_DESCRIPTION', "Set DKIM identity. This can be in the format of an email address 'you@yourdomain.com' typically used as the source of the email." ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_IDENTITY_HINT', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_IDENTITY_HINT', "you@yourdomain.com" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_PRIVATE_KEY_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_PRIVATE_KEY_LABEL', "Private key" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_PRIVATE_KEY_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_PRIVATE_KEY_DESCRIPTION', "set private key" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_PUBLIC_KEY_LABEL', "Public key" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_PUBLIC_KEY_LABEL', "Public key" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_PUBLIC_KEY_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_PUBLIC_KEY_DESCRIPTION', "set public key" ); - $this->setLangContent( - $this->lang, $lang . '_NOTE_DKIM_USE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_NOTE_DKIM_USE_LABEL', "Server Configuration" ); - $this->setLangContent( - $this->lang, $lang . '_NOTE_DKIM_USE_DESCRIPTION', "

    Using the below details, you need to configure your DNS by adding a TXT record on your domain:

    + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_NOTE_DKIM_USE_DESCRIPTION', "

    Using the below details, you need to configure your DNS by adding a TXT record on your domain:

    " ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_KEY_LABEL', "Key" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_KEY_LABEL', "Key" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_KEY_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_KEY_DESCRIPTION', "This is the KEY to use in the DNS record." ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_KEY_HINT', "vdm._domainkey" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_KEY_HINT', "vdm._domainkey" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_VALUE_LABEL', "Value" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_VALUE_LABEL', "Value" ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_VALUE_DESCRIPTION', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_VALUE_DESCRIPTION', "This is the TXT value to use in the DNS. Replace the PUBLICKEY with your public key." ); - $this->setLangContent( - $this->lang, $lang . '_DKIM_VALUE_HINT', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_DKIM_VALUE_HINT', "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY" ); - $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"radio\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"btn-group btn-group-yesno\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"0\""; - $this->configFieldSets[] = $this->_t(3) . "required=\"true\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "default=\"0\""; + $this->configFieldSets[] = Indent::_(3) . "required=\"true\">"; + $this->configFieldSets[] = Indent::_(3) . ""; + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_domain\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_DOMAIN_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_DOMAIN_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add DKIM Domain here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_DKIM_DOMAIN_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = Indent::_(3) . "onchange=\"vdm_dkim();\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_selector\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_SELECTOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"vdm\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "default=\"vdm\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_SELECTOR_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add DKIM/DNS selector here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_DKIM_SELECTOR_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = Indent::_(3) . "onchange=\"vdm_dkim();\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"password\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"password\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_passphrase\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_PASSPHRASE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"raw\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add passphrase here.\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_identity\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_IDENTITY_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"60\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_IDENTITY_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"raw\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add DKIM Identity here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_DKIM_IDENTITY_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"textarea\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"textarea\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_private_key\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_PRIVATE_KEY_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "rows=\"15\""; - $this->configFieldSets[] = $this->_t(3) . "cols=\"5\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "rows=\"15\""; + $this->configFieldSets[] = Indent::_(3) . "cols=\"5\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"input-xxlarge span12\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"textarea\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"textarea\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_public_key\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_PUBLIC_KEY_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "rows=\"5\""; - $this->configFieldSets[] = $this->_t(3) . "cols=\"5\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "rows=\"5\""; + $this->configFieldSets[] = Indent::_(3) . "cols=\"5\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"input-xxlarge span12\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = Indent::_(3) . "onchange=\"vdm_dkim();\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_key\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_key\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_KEY_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"40\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"40\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"150\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_KEY_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add KEY here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_DKIM_KEY_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_value\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"dkim_value\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_DKIM_VALUE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"80\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"350\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" + $this->configFieldSets[] = Indent::_(3) . "size=\"80\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"350\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_DKIM_VALUE_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"STRING\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add TXT record here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_DKIM_VALUE_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = Indent::_(2) . "/>"; } // close that fieldset - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; } } @@ -26291,403 +26088,403 @@ function vdm_dkim() { { if ($this->googlechart) { - $this->configFieldSets[] = PHP_EOL . $this->_t(1) . "configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = PHP_EOL . Indent::_(1) . "configFieldSets[] = Indent::_(2) . "name=\"googlechart_config\""; - $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "label=\"" . $lang . "_CHART_SETTINGS_LABEL\""; - $this->configFieldSets[] = $this->_t(2) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "description=\"" . $lang . "_CHART_SETTINGS_DESC\">"; - $this->configFieldSets[] = $this->_t(2); - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2); + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_chartbackground\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#F7F7FA\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#F7F7FA\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTBACKGROUND_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_mainwidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_MAINWIDTH_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_MAINWIDTH_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add area width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_MAINWIDTH_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_chartareatop\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTAREATOP_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTAREATOP_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_CHARTAREATOP_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_chartarealeft\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTAREALEFT_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTAREALEFT_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_CHARTAREALEFT_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_chartareawidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_legendtextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_legendtextstylefontsize\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_vaxistextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_haxistextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"admin_haxistitletextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2); - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . "/>"; + $this->configFieldSets[] = Indent::_(2); + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2); - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_chartbackground\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#F7F7FA\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#F7F7FA\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTBACKGROUND_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_mainwidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_mainwidth\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_MAINWIDTH_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_MAINWIDTH_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add area width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_MAINWIDTH_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_chartareatop\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTAREATOP_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTAREATOP_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_CHARTAREATOP_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_chartarealeft\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTAREALEFT_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTAREALEFT_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_CHARTAREALEFT_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_chartareawidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_legendtextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"text\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_legendtextstylefontsize\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; - $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "size=\"20\""; + $this->configFieldSets[] = Indent::_(3) . "maxlength=\"50\""; + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; - $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . "class=\"text_area\""; + $this->configFieldSets[] = Indent::_(3) . "filter=\"INT\""; + $this->configFieldSets[] = Indent::_(3) . "message=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "hint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_vaxistextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_haxistextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(2) . "configFieldSets[] = Indent::_(3) . "type=\"color\""; + $this->configFieldSets[] = Indent::_(3) . "name=\"site_haxistitletextstylefontcolor\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + $this->configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(2) . "/>"; // add custom Encryption Settings fields if (isset($this->configFieldSetsCustomField['Chart Settings']) @@ -26701,124 +26498,124 @@ function vdm_dkim() { unset($this->configFieldSetsCustomField['Chart Settings']); } - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; // set params defaults $this->extensionsParams[] = '"admin_chartbackground":"#F7F7FA","admin_mainwidth":"1000","admin_chartareatop":"20","admin_chartarealeft":"20","admin_chartareawidth":"170","admin_legendtextstylefontcolor":"10","admin_legendtextstylefontsize":"20","admin_vaxistextstylefontcolor":"#63B1F2","admin_haxistextstylefontcolor":"#63B1F2","admin_haxistitletextstylefontcolor":"#63B1F2","site_chartbackground":"#F7F7FA","site_mainwidth":"1000","site_chartareatop":"20","site_chartarealeft":"20","site_chartareawidth":"170","site_legendtextstylefontcolor":"10","site_legendtextstylefontsize":"20","site_vaxistextstylefontcolor":"#63B1F2","site_haxistextstylefontcolor":"#63B1F2","site_haxistitletextstylefontcolor":"#63B1F2"'; // set field lang - $this->setLangContent( - $this->lang, $lang . '_CHART_SETTINGS_LABEL', "Chart Settings" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHART_SETTINGS_LABEL', "Chart Settings" ); - $this->setLangContent( - $this->lang, $lang . '_CHART_SETTINGS_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHART_SETTINGS_DESC', "The Google Chart Display Settings Are Made Here." ); - $this->setLangContent( - $this->lang, $lang . '_ADMIN_CHART_NOTE_LABEL', "Admin Settings" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ADMIN_CHART_NOTE_LABEL', "Admin Settings" ); - $this->setLangContent( - $this->lang, $lang . '_ADMIN_CHART_NOTE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ADMIN_CHART_NOTE_DESC', "The following settings are used on the back-end of the site called (admin)." ); - $this->setLangContent( - $this->lang, $lang . '_SITE_CHART_NOTE_LABEL', "Site Settings" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SITE_CHART_NOTE_LABEL', "Site Settings" ); - $this->setLangContent( - $this->lang, $lang . '_SITE_CHART_NOTE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_SITE_CHART_NOTE_DESC', "The following settings are used on the front-end of the site called (site)." ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREALEFT_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREALEFT_DESC', "Set in pixels the spacing from the left of the chart area to the beginning of the chart it self. Please don't add the px sign" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREALEFT_HINT', "170" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREALEFT_HINT', "170" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREALEFT_LABEL', "Left Spacing" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREALEFT_LABEL', "Left Spacing" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREATOP_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREATOP_DESC', "Set in pixels the spacing from the top of the chart area to the beginning of the chart it self. Please don't add the px sign" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREATOP_HINT', "20" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREATOP_HINT', "20" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREATOP_LABEL', "Top Spacing" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREATOP_LABEL', "Top Spacing" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREAWIDTH_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREAWIDTH_DESC', "Set in % the width of the chart it self inside the chart area. Please don't add the % sign" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREAWIDTH_HINT', "60" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREAWIDTH_HINT', "60" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTAREAWIDTH_LABEL', "Chart Width" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTAREAWIDTH_LABEL', "Chart Width" ); - $this->setLangContent( - $this->lang, $lang . '_CHARTBACKGROUND_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTBACKGROUND_DESC', "Select the chart background color here." ); - $this->setLangContent( - $this->lang, $lang . '_CHARTBACKGROUND_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_CHARTBACKGROUND_LABEL', "Chart Background" ); - $this->setLangContent( - $this->lang, $lang . '_HAXISTEXTSTYLEFONTCOLOR_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_HAXISTEXTSTYLEFONTCOLOR_DESC', "Select the horizontal axis font color." ); - $this->setLangContent( - $this->lang, $lang . '_HAXISTEXTSTYLEFONTCOLOR_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_HAXISTEXTSTYLEFONTCOLOR_LABEL', "hAxis Font Color" ); - $this->setLangContent( - $this->lang, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_DESC', "Select the horizontal axis title's font color." ); - $this->setLangContent( - $this->lang, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL', "hAxis Title Font Color" ); - $this->setLangContent( - $this->lang, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_DESC', "Select the legend font color." ); - $this->setLangContent( - $this->lang, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_LABEL', "Legend Font Color" ); - $this->setLangContent( - $this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_DESC', "Set in pixels the font size of the legend" ); - $this->setLangContent( - $this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_HINT', "10" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_HINT', "10" ); - $this->setLangContent( - $this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_LEGENDTEXTSTYLEFONTSIZE_LABEL', "Legend Font Size" ); - $this->setLangContent( - $this->lang, $lang . '_MAINWIDTH_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAINWIDTH_DESC', "Set the width of the entire chart area" ); - $this->setLangContent( - $this->lang, $lang . '_MAINWIDTH_HINT', "1000" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAINWIDTH_HINT', "1000" ); - $this->setLangContent( - $this->lang, $lang . '_MAINWIDTH_LABEL', "Chart Area Width" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MAINWIDTH_LABEL', "Chart Area Width" ); - $this->setLangContent( - $this->lang, $lang . '_VAXISTEXTSTYLEFONTCOLOR_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_VAXISTEXTSTYLEFONTCOLOR_DESC', "Select the vertical axis font color." ); - $this->setLangContent( - $this->lang, $lang . '_VAXISTEXTSTYLEFONTCOLOR_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_VAXISTEXTSTYLEFONTCOLOR_LABEL', "vAxis Font Color" ); } @@ -26843,12 +26640,12 @@ function vdm_dkim() { { $dynamicAddFields[] = "Encryption Settings"; // start building field set for encryption functions - $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(1) . "configFieldSets[] = Indent::_(2) . 'name="encryption_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'label="' . $lang . '_ENCRYPTION_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + $this->configFieldSets[] = Indent::_(2) . 'description="' . $lang . '_ENCRYPTION_DESC">'; // set tab lang @@ -26860,12 +26657,12 @@ function vdm_dkim() { && $this->componentData->add_license && $this->componentData->license_type == 3) { - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_LABEL', "License & Encryption Settings" ); - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_DESC', "The license & encryption keys are set here." ); // add the next dynamic option @@ -26879,12 +26676,12 @@ function vdm_dkim() { && $this->componentData->add_license && $this->componentData->license_type == 2) { - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_LABEL', "Update & Encryption Settings" ); - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_DESC', "The update & encryption keys are set here." ); // add the next dynamic option @@ -26893,11 +26690,11 @@ function vdm_dkim() { elseif ($this->componentData->add_license && $this->componentData->license_type == 3) { - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_LABEL', "License Settings" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_LABEL', "License Settings" ); - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_DESC', "The license key is set here." ); // add the next dynamic option @@ -26906,11 +26703,11 @@ function vdm_dkim() { elseif ($this->componentData->add_license && $this->componentData->license_type == 2) { - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_LABEL', "Update Settings" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_LABEL', "Update Settings" ); - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_DESC', "The update key is set here." ); // add the next dynamic option @@ -26918,12 +26715,12 @@ function vdm_dkim() { } else { - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_LABEL', "Encryption Settings" ); - $this->setLangContent( - $this->lang, $lang . '_ENCRYPTION_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_ENCRYPTION_DESC', "The encryption key for the field encryption is set here." ); } @@ -26931,77 +26728,77 @@ function vdm_dkim() { if (isset($this->basicEncryption) && $this->basicEncryption) { // set field lang - $this->setLangContent( - $this->lang, $lang . '_BASIC_KEY_LABEL', "Basic Key" + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_BASIC_KEY_LABEL', "Basic Key" ); - $this->setLangContent( - $this->lang, $lang . '_BASIC_KEY_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_BASIC_KEY_DESC', "Set the basic local key here." ); - $this->setLangContent( - $this->lang, $lang . '_BASIC_KEY_NOTE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_BASIC_KEY_NOTE_LABEL', "Basic Encryption" ); - $this->setLangContent( - $this->lang, $lang . '_BASIC_KEY_NOTE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_BASIC_KEY_NOTE_DESC', "When using the basic encryption please use set a 32 character passphrase.
    Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!" ); // set the field - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ''; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_BASIC_KEY_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_BASIC_KEY_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default=""'; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default=""'; + $this->configFieldSets[] = Indent::_(2) . "/>"; } if (isset($this->mediumEncryption) && $this->mediumEncryption) { // set field lang - $this->setLangContent( - $this->lang, $lang . '_MEDIUM_KEY_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MEDIUM_KEY_LABEL', "Medium Key (Path)" ); - $this->setLangContent( - $this->lang, $lang . '_MEDIUM_KEY_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MEDIUM_KEY_DESC', "Set the full path to where the key file must be stored. Make sure it is behind the root folder of your website, so that it is not public accessible." ); - $this->setLangContent( - $this->lang, $lang . '_MEDIUM_KEY_NOTE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MEDIUM_KEY_NOTE_LABEL', "Medium Encryption" ); - $this->setLangContent( - $this->lang, $lang . '_MEDIUM_KEY_NOTE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MEDIUM_KEY_NOTE_DESC', "When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
    Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!" ); // set the field - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ''; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_MEDIUM_KEY_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_MEDIUM_KEY_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="160"'; - $this->configFieldSets[] = $this->_t(3) . 'filter="PATH"'; - $this->configFieldSets[] = $this->_t(3) + $this->configFieldSets[] = Indent::_(3) . 'size="160"'; + $this->configFieldSets[] = Indent::_(3) . 'filter="PATH"'; + $this->configFieldSets[] = Indent::_(3) . 'hint="/home/user/hiddenfolder123/"'; - $this->configFieldSets[] = $this->_t(3) . 'default=""'; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(3) . 'default=""'; + $this->configFieldSets[] = Indent::_(2) . "/>"; // set some error message if the path does not exist - $this->setLangContent( - $this->lang, $lang . '_MEDIUM_KEY_PATH_ERROR', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_MEDIUM_KEY_PATH_ERROR', "Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component." ); } @@ -27012,12 +26809,12 @@ function vdm_dkim() { if ($this->componentData->add_license && $this->componentData->license_type == 3) { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_LABEL', $this->componentData->companyname . " License Key" ); - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_DESC', "Add the license key you recieved from " . $this->componentData->companyname . " here." ); @@ -27025,24 +26822,24 @@ function vdm_dkim() { elseif ($this->componentData->add_license && $this->componentData->license_type == 2) { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_LABEL', $this->componentData->companyname . " Update Key" ); - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_DESC', "Add the update key you recieved from " . $this->componentData->companyname . " here." ); } else { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_LABEL', $this->componentData->companyname . " Key" ); - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_DESC', "Add the key you recieved from " . $this->componentData->companyname . " here." ); @@ -27050,16 +26847,16 @@ function vdm_dkim() { // ajust the notice based on license if ($this->componentData->license_type == 3) { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " License Key" ); } elseif ($this->componentData->license_type == 2) { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " Update Key" ); @@ -27068,16 +26865,16 @@ function vdm_dkim() { { if (isset($this->whmcsEncryption) && $this->whmcsEncryption) { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " Field Encryption Key" ); } else { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " Key" ); } @@ -27085,8 +26882,8 @@ function vdm_dkim() { // add the description based on global settings if (isset($this->whmcsEncryption) && $this->whmcsEncryption) { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_NOTE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_DESC', "You need to get this key from
    " @@ -27098,8 +26895,8 @@ function vdm_dkim() { } else { - $this->setLangContent( - $this->lang, $lang . '_WHMCS_KEY_NOTE_DESC', + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_DESC', "You need to get this key from " @@ -27107,20 +26904,20 @@ function vdm_dkim() { ); } // set the fields - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . ''; - $this->configFieldSets[] = $this->_t(2) + $this->configFieldSets[] = Indent::_(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + $this->configFieldSets[] = Indent::_(3) . 'type="text"'; + $this->configFieldSets[] = Indent::_(3) . 'label="' . $lang . '_WHMCS_KEY_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' + $this->configFieldSets[] = Indent::_(3) . 'description="' . $lang . '_WHMCS_KEY_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default=""'; - $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = Indent::_(3) . 'size="60"'; + $this->configFieldSets[] = Indent::_(3) . 'default=""'; + $this->configFieldSets[] = Indent::_(2) . "/>"; } // load the dynamic field sets foreach ($dynamicAddFields as $dynamicAddField) @@ -27138,7 +26935,7 @@ function vdm_dkim() { } } // close that fieldset - $this->configFieldSets[] = $this->_t(1) . ""; + $this->configFieldSets[] = Indent::_(1) . ""; } } @@ -27152,19 +26949,19 @@ function vdm_dkim() { $otherViews = $this->catCodeBuilder[$nameSingleCode]['views']; if ($otherViews == $nameListCode) { - $component .= PHP_EOL . $this->_t(1) + $component .= PHP_EOL . Indent::_(1) . '
    '; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(1) . "
    "; + $component .= PHP_EOL . Indent::_(1) . ""; } } @@ -27175,30 +26972,30 @@ function vdm_dkim() { { $component = ''; // set all the core field permissions - $component .= PHP_EOL . $this->_t(1) . '
    '; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(1) . '
    '; + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(1) . '
    '; - $component .= PHP_EOL . $this->_t(1) . '
    '; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(1) . '
    '; + $component .= PHP_EOL . Indent::_(1) . '
    '; + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(2) + $component .= PHP_EOL . Indent::_(2) . ''; - $component .= PHP_EOL . $this->_t(1) . '
    '; + $component .= PHP_EOL . Indent::_(1) . '
    '; return $component; } @@ -27213,18 +27010,18 @@ function vdm_dkim() { $this->permissionViews = array(); // Trigger Event: jcb_ce_onBeforeBuildAccessSections - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildAccessSections', array(&$this->componentContext, &$this) ); $this->componentHead[] = '
    '; - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; if ($this->addEximport) { @@ -27233,12 +27030,12 @@ function vdm_dkim() { $exportDesc = $this->langPrefix . '_' . StringHelper::safe('Export Data', 'U') . '_DESC'; - $this->setLangContent('bothadmin', $exportTitle, 'Export Data'); - $this->setLangContent( + CFactory::_('Language')->set('bothadmin', $exportTitle, 'Export Data'); + CFactory::_('Language')->set( 'bothadmin', $exportDesc, ' Allows users in this group to export data.' ); - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; // the size needs increase @@ -27248,12 +27045,12 @@ function vdm_dkim() { $importDesc = $this->langPrefix . '_' . StringHelper::safe('Import Data', 'U') . '_DESC'; - $this->setLangContent('bothadmin', $importTitle, 'Import Data'); - $this->setLangContent( + CFactory::_('Language')->set('bothadmin', $importTitle, 'Import Data'); + CFactory::_('Language')->set( 'bothadmin', $importDesc, ' Allows users in this group to import data.' ); - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; // the size needs increase @@ -27264,12 +27061,12 @@ function vdm_dkim() { . StringHelper::safe('Use Batch', 'U'); $batchDesc = $this->langPrefix . '_' . StringHelper::safe('Use Batch', 'U') . '_DESC'; - $this->setLangContent('bothadmin', $batchTitle, 'Use Batch'); - $this->setLangContent( + CFactory::_('Language')->set('bothadmin', $batchTitle, 'Use Batch'); + CFactory::_('Language')->set( 'bothadmin', $batchDesc, ' Allows users in this group to use batch copy/update method.' ); - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; // version permission @@ -27278,29 +27075,29 @@ function vdm_dkim() { $importDesc = $this->langPrefix . '_' . StringHelper::safe('Edit Versions', 'U') . '_DESC'; - $this->setLangContent('bothadmin', $importTitle, 'Edit Version'); - $this->setLangContent( + CFactory::_('Language')->set('bothadmin', $importTitle, 'Edit Version'); + CFactory::_('Language')->set( 'bothadmin', $importDesc, ' Allows users in this group to edit versions.' ); - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; // set the defaults - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; // set the Joomla fields if ($this->setJoomlaFields) { - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ' '; // the size needs increase $this->accessSize++; @@ -27311,12 +27108,12 @@ function vdm_dkim() { $created_byDesc = $this->langPrefix . '_' . StringHelper::safe('Edit Created By', 'U') . '_DESC'; - $this->setLangContent('bothadmin', $created_byTitle, 'Edit Created By'); - $this->setLangContent( + CFactory::_('Language')->set('bothadmin', $created_byTitle, 'Edit Created By'); + CFactory::_('Language')->set( 'bothadmin', $created_byDesc, ' Allows users in this group to edit created by.' ); - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; // new custom created date permissions @@ -27325,12 +27122,12 @@ function vdm_dkim() { $createdDesc = $this->langPrefix . '_' . StringHelper::safe('Edit Created Date', 'U') . '_DESC'; - $this->setLangContent('bothadmin', $createdTitle, 'Edit Created Date'); - $this->setLangContent( + CFactory::_('Language')->set('bothadmin', $createdTitle, 'Edit Created Date'); + CFactory::_('Language')->set( 'bothadmin', $createdDesc, ' Allows users in this group to edit created date.' ); - $this->componentHead[] = $this->_t(2) + $this->componentHead[] = Indent::_(2) . ''; @@ -27361,16 +27158,16 @@ function vdm_dkim() { $sortKey = StringHelper::safe( $customAdminName . ' Access' ); - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $customAdminTitle, $customAdminName . ' Access' ); - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $customAdminDesc, ' Allows the users in this group to access ' . StringHelper::safe($customAdminName, 'w') . '.' ); - $this->componentGlobal[$sortKey] = $this->_t(2) + $this->componentGlobal[$sortKey] = Indent::_(2) . ''; @@ -27447,16 +27244,16 @@ function vdm_dkim() { ); if (isset($site_view['access']) && $site_view['access'] == 1) { - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $siteTitle, $siteName . ' (Site) Access' ); - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $siteDesc, ' Allows the users in this group to access site ' . StringHelper::safe($siteName, 'w') . '.' ); - $this->componentGlobal[$sortKey] = $this->_t(2) + $this->componentGlobal[$sortKey] = Indent::_(2) . ''; // the size needs increase @@ -27502,7 +27299,7 @@ function vdm_dkim() { && $_customTab['permission'] == 1) { $this->componentGlobal[$_customTab['sortKey']] - = $this->_t(2) . ''; foreach ($actions as $action) { - $componentViews[] = $this->_t(2) . $action; + $componentViews[] = Indent::_(2) . $action; } - $componentViews[] = $this->_t(1) . "
    "; + $componentViews[] = Indent::_(1) . ""; } } /// now build the section @@ -27675,7 +27472,7 @@ function vdm_dkim() { ksort($this->componentGlobal, SORT_STRING); // add global to the compnent section $component .= PHP_EOL . implode(PHP_EOL, $this->componentGlobal) - . PHP_EOL . $this->_t(1) . ""; + . PHP_EOL . Indent::_(1) . ""; // add views to the component section $component .= PHP_EOL . implode(PHP_EOL, $componentViews); // be sure to reset again. (memory) @@ -27689,7 +27486,7 @@ function vdm_dkim() { // since we have less than 30 actions // we do not need the fix for this component $this->addAssetsTableFix = 0; - Config::set('add_assets_table_fix', $this->addAssetsTableFix); + CFactory::_('Config')->set('add_assets_table_fix', $this->addAssetsTableFix); } else { @@ -27735,17 +27532,17 @@ function vdm_dkim() { $sortButtonKey = StringHelper::safe( $nameView . ' ' . $customButtonName . ' Button Access' ); - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $customButtonTitle, $nameView . ' ' . $customButtonName . ' Button Access' ); - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $customButtonDesc, ' Allows the users in this group to access the ' . StringHelper::safe($customButtonName, 'w') . ' button.' ); - $this->componentGlobal[$sortButtonKey] = $this->_t(2) + $this->componentGlobal[$sortButtonKey] = Indent::_(2) . ''; @@ -28087,7 +27884,7 @@ function vdm_dkim() { elseif ($permission['implementation'] == 2) { // relation to whole component - $this->componentGlobal[$sortKey] = $this->_t(2) + $this->componentGlobal[$sortKey] = Indent::_(2) . ''; // the size needs increase @@ -28137,7 +27934,7 @@ function vdm_dkim() { // load permission to action $this->permissionBuilder[$action][$nameView] = $nameView; // relation to whole component - $this->componentGlobal[$sortKey] = $this->_t(2) + $this->componentGlobal[$sortKey] = Indent::_(2) . ''; // the size needs increase @@ -28179,10 +27976,10 @@ function vdm_dkim() { } } // set to language file - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $title, $permission['title'] ); - $this->setLangContent( + CFactory::_('Language')->set( 'bothadmin', $title . '_DESC', $permission['description'] ); } @@ -28203,15 +28000,12 @@ function vdm_dkim() { public function getModCode(&$module) { // get component helper string - $Helper = $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . 'Helper'; - $component = $this->fileContentStatic[$this->hhh . 'component' - . $this->hhh]; + $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; + $component = $this->fileContentStatic[Placefix::_h('component')]; $_helper = ''; // get libraries code - $libraries = array($this->bbb . 'MOD_LIBRARIES' - . $this->ddd => $this->getModLibCode($module)); - $code = $this->setPlaceholders($module->mod_code, $libraries); + $libraries = array(Placefix::_('MOD_LIBRARIES') => $this->getModLibCode($module)); + $code = CFactory::_('Placeholder')->update($module->mod_code, $libraries); // check if component helper class should be added if (strpos($code, $Helper . '::') !== false && strpos( @@ -28220,14 +28014,14 @@ function vdm_dkim() { . ".php" ) === false) { - $_helper = '//' . $this->setLine(__LINE__) + $_helper = '//' . Line::_(__Line__, __Class__) . ' Include the component helper functions only once'; $_helper .= PHP_EOL . "JLoader::register('" . $Helper . "', JPATH_ADMINISTRATOR . '/components/com_" . $component . "/helpers/" . $component . ".php');"; } - return $this->setPlaceholders($_helper . PHP_EOL . $code . PHP_EOL, $this->fileContentStatic); + return CFactory::_('Placeholder')->update($_helper . PHP_EOL . $code . PHP_EOL, $this->fileContentStatic); } public function getModDefault(&$module, &$key) @@ -28249,13 +28043,13 @@ function vdm_dkim() { ); // return the default content for the model default area - return $this->setPlaceholders($default, $this->fileContentStatic); + return CFactory::_('Placeholder')->update($default, $this->fileContentStatic); } public function getModHelperCode(&$module) { return - $this->setPlaceholders($module->class_helper_header . PHP_EOL . + CFactory::_('Placeholder')->update($module->class_helper_header . PHP_EOL . $module->class_helper_type . $module->class_helper_name . PHP_EOL . '{' . PHP_EOL . $module->class_helper_code . PHP_EOL . @@ -28270,7 +28064,7 @@ function vdm_dkim() { $this->libManager[$module->key][$module->code_name] )) { - $setter .= '//' . $this->setLine(__LINE__) + $setter .= '//' . Line::_(__Line__, __Class__) . 'get the document object'; $setter .= PHP_EOL . '$document = JFactory::getDocument();'; foreach ( @@ -28302,7 +28096,7 @@ function vdm_dkim() { // check if we have string if (StringHelper::check($setter)) { - return $this->setPlaceholders( $this->setPlaceholders( + return CFactory::_('Placeholder')->update( CFactory::_('Placeholder')->update( str_replace( '$this->document->', '$document->', implode( @@ -28348,7 +28142,7 @@ function vdm_dkim() { if ($add_scripts_field && $module->add_scripts_field) { // get the custom script field - $xmlFields .= PHP_EOL . $this->_t(2) + $xmlFields .= PHP_EOL . Indent::_(2) . ""; // don't add it again $add_scripts_field = false; @@ -28376,25 +28170,26 @@ function vdm_dkim() { // switch to add the language xml $addLang = array(); // now build the language files - if (isset($this->langContent[$module->key])) + if (CFactory::_('Language')->exist($module->key)) { + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget($module->key); // Trigger Event: jcb_ce_onBeforeBuildModuleLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildModuleLang', array(&$this->componentContext, &$module, - &$this->langContent[$module->key], - &$module->lang_prefix, &$module->official_name) + &$langContent, &$module->lang_prefix, &$module->official_name) ); // get other languages - $values = array_unique($this->langContent[$module->key]); + $values = array_unique($langContent); // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); // start the modules language bucket (must rest every time) $this->languages['modules'] = array(); - $this->languages['modules'][Config::get('lang_tag', 'en-GB')] = array(); - $this->languages['modules'][Config::get('lang_tag', 'en-GB')]['all'] - = $this->langContent[$module->key]; - unset($this->langContent[$module->key]); + $this->languages['modules'][CFactory::_('Config')->get('lang_tag', 'en-GB')] = array(); + $this->languages['modules'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['all'] + = $langContent; + CFactory::_('Language')->setTarget($module->key, null); // update insert the current lang in to DB $this->setLangPlaceholders($values, $module->id, 'modules'); // remove old unused language strings @@ -28402,12 +28197,14 @@ function vdm_dkim() { $total = count($values); unset($values); // Trigger Event: jcb_ce_onBeforeBuildModuleLangFiles - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildModuleLangFiles', array(&$this->componentContext, &$module, &$this->languages['modules'], &$this->langTag) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_tag = $this->langTag; // now we insert the values into the files if (ArrayHelper::check($this->languages['modules'])) { @@ -28473,64 +28270,64 @@ function vdm_dkim() { // should the scriptfile be added if ($module->add_install_script) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . 'script.php'; } // should the sql install be added if ($module->add_sql) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(3) . 'sql/mysql/install.sql'; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // should the sql uninstall be added if ($module->add_sql_uninstall) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(3) . 'sql/mysql/uninstall.sql'; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // should the language xml be added if (ArrayHelper::check($addLang)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . ''; // load all the language files to xml foreach ($addLang as $addTag) { - $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.' . $module->file_name . '.ini'; - $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.' . $module->file_name . '.sys.ini'; } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // add the module files - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . 'file_name . '">' . $module->file_name . '.php'; // add other files found @@ -28541,7 +28338,7 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($file, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $file + $xml .= PHP_EOL . Indent::_(2) . '' . $file . ''; } } @@ -28549,12 +28346,12 @@ function vdm_dkim() { // add language folder if (ArrayHelper::check($addLang)) { - $xml .= PHP_EOL . $this->_t(2) . 'language'; + $xml .= PHP_EOL . Indent::_(2) . 'language'; } // add sql folder if ($module->add_sql || $module->add_sql_uninstall) { - $xml .= PHP_EOL . $this->_t(2) . 'sql'; + $xml .= PHP_EOL . Indent::_(2) . 'sql'; } // add other files found if (ArrayHelper::check($folders)) @@ -28564,39 +28361,39 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($folder, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $folder + $xml .= PHP_EOL . Indent::_(2) . '' . $folder . ''; } } } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; // now add the Config Params if needed if (ArrayHelper::check($config_fields)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; // only add if part of the component field types path is required if ($add_component_path) { // add path to module rules and custom fields - $xml .= PHP_EOL . $this->_t(1) . '_t(2) + $xml .= PHP_EOL . Indent::_(1) . '_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/models/fields"'; - $xml .= PHP_EOL . $this->_t(1) . '>'; + $xml .= PHP_EOL . Indent::_(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // add the fields foreach ($module->config_fields as $field_name => $fieldsets) { - $xml .= PHP_EOL . $this->_t(1) . ''; foreach ($fieldsets as $fieldset => $fields) { @@ -28649,30 +28446,30 @@ function vdm_dkim() { || isset($module->add_field_path[$field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
    add_rule_path[$field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addrulepath="' . $module->add_rule_path[$field_name . $fieldset] . '"'; } if (isset($module->add_field_path[$field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addfieldpath="' . $module->add_field_path[$field_name . $fieldset] . '"'; } - $xml .= PHP_EOL . $this->_t(1) . '>'; + $xml .= PHP_EOL . Indent::_(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
    '; } // load the fields @@ -28681,24 +28478,24 @@ function vdm_dkim() { $xml .= $config_fields[$field_name . $fieldset]; unset($config_fields[$field_name . $fieldset]); } - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . Indent::_(1) . '
    '; } - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . Indent::_(1) . ''; } - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . Indent::_(1) . '
    '; } // set update server if found if ($module->add_update_server) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . '' . $module->update_server_url . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } return $xml; @@ -28707,7 +28504,7 @@ function vdm_dkim() { public function getPluginMainClass(&$plugin) { return - $this->setPlaceholders(PHP_EOL . $plugin->head . PHP_EOL . + CFactory::_('Placeholder')->update(PHP_EOL . $plugin->head . PHP_EOL . $plugin->comment . PHP_EOL . 'class ' . $plugin->class_name . ' extends ' . $plugin->extends . PHP_EOL . '{' . PHP_EOL . @@ -28761,25 +28558,27 @@ function vdm_dkim() { // switch to add the language xml $addLang = array(); // now build the language files - if (isset($this->langContent[$plugin->key])) + if (CFactory::_('Language')->exist($plugin->key)) { + // for plugin event TODO change event api signatures + $langContent = CFactory::_('Language')->getTarget($plugin->key); // Trigger Event: jcb_ce_onBeforeBuildPluginLang - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildPluginLang', array(&$this->componentContext, &$plugin, - &$this->langContent[$plugin->key], + &$langContent, &$plugin->lang_prefix, &$plugin->official_name) ); // get other languages - $values = array_unique($this->langContent[$plugin->key]); + $values = array_unique($langContent); // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); // start the plugins language bucket (must rest every time) $this->languages['plugins'] = array(); - $this->languages['plugins'][Config::get('lang_tag', 'en-GB')] = array(); - $this->languages['plugins'][Config::get('lang_tag', 'en-GB')]['all'] - = $this->langContent[$plugin->key]; - unset($this->langContent[$plugin->key]); + $this->languages['plugins'][CFactory::_('Config')->get('lang_tag', 'en-GB')] = array(); + $this->languages['plugins'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['all'] + = $langContent; + CFactory::_('Language')->setTarget($plugin->key, null); // update insert the current lang in to DB $this->setLangPlaceholders($values, $plugin->id, 'plugins'); // remove old unused language strings @@ -28787,12 +28586,14 @@ function vdm_dkim() { $total = count($values); unset($values); // Trigger Event: jcb_ce_onBeforeBuildPluginLangFiles - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildPluginLangFiles', array(&$this->componentContext, &$plugin, &$this->languages['plugins'], &$this->langTag) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_tag = $this->langTag; // now we insert the values into the files if (ArrayHelper::check($this->languages['plugins'])) { @@ -28863,67 +28664,67 @@ function vdm_dkim() { // should the scriptfile be added if ($plugin->add_install_script) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) + $xml .= PHP_EOL . Indent::_(1) . 'script.php'; } // should the sql install be added if ($plugin->add_sql) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(3) . 'sql/mysql/install.sql'; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // should the sql uninstall be added if ($plugin->add_sql_uninstall) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(3) . 'sql/mysql/uninstall.sql'; - $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // should the language xml be added if (ArrayHelper::check($addLang)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; // load all the language files to xml foreach ($addLang as $addTag) { - $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower( $plugin->code_name ) . '.ini'; - $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower( $plugin->code_name ) . '.sys.ini'; } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // add the plugin files - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . 'file_name . '">' . $plugin->file_name . '.php'; // add other files found @@ -28934,7 +28735,7 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($file, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $file + $xml .= PHP_EOL . Indent::_(2) . '' . $file . ''; } } @@ -28942,12 +28743,12 @@ function vdm_dkim() { // add language folder if (ArrayHelper::check($addLang)) { - $xml .= PHP_EOL . $this->_t(2) . 'language'; + $xml .= PHP_EOL . Indent::_(2) . 'language'; } // add sql folder if ($plugin->add_sql || $plugin->add_sql_uninstall) { - $xml .= PHP_EOL . $this->_t(2) . 'sql'; + $xml .= PHP_EOL . Indent::_(2) . 'sql'; } // add other files found if (ArrayHelper::check($folders)) @@ -28957,39 +28758,39 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($folder, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $folder + $xml .= PHP_EOL . Indent::_(2) . '' . $folder . ''; } } } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; // now add the Config Params if needed if (ArrayHelper::check($config_fields)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; // only add if part of the component field types path is required if ($add_component_path) { // add path to plugin rules and custom fields - $xml .= PHP_EOL . $this->_t(1) . '_t(2) + $xml .= PHP_EOL . Indent::_(1) . '_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/models/fields"'; - $xml .= PHP_EOL . $this->_t(1) . '>'; + $xml .= PHP_EOL . Indent::_(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } // add the fields foreach ($plugin->config_fields as $field_name => $fieldsets) { - $xml .= PHP_EOL . $this->_t(1) . ''; foreach ($fieldsets as $fieldset => $fields) { @@ -29024,30 +28825,30 @@ function vdm_dkim() { if (isset($plugin->add_rule_path[$field_name . $fieldset]) || isset($plugin->add_field_path[$field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
    add_rule_path[$field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addrulepath="' . $plugin->add_rule_path[$field_name . $fieldset] . '"'; } if (isset($plugin->add_field_path[$field_name . $fieldset])) { - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(2) . 'addfieldpath="' . $plugin->add_field_path[$field_name . $fieldset] . '"'; } - $xml .= PHP_EOL . $this->_t(1) . '>'; + $xml .= PHP_EOL . Indent::_(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
    '; } // load the fields @@ -29056,24 +28857,24 @@ function vdm_dkim() { $xml .= $config_fields[$field_name . $fieldset]; unset($config_fields[$field_name . $fieldset]); } - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . Indent::_(1) . '
    '; } - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . Indent::_(1) . ''; } - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . Indent::_(1) . '
    '; } // set update server if found if ($plugin->add_update_server) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) + $xml .= PHP_EOL . Indent::_(1) . ''; + $xml .= PHP_EOL . Indent::_(2) . '' . $plugin->update_server_url . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . Indent::_(1) . ''; } return $xml; @@ -29121,7 +28922,7 @@ function vdm_dkim() { } $code[] = '}' . PHP_EOL . PHP_EOL; - return $this->setPlaceholders(implode(PHP_EOL, $code), $this->fileContentStatic); + return CFactory::_('Placeholder')->update(implode(PHP_EOL, $code), $this->fileContentStatic); } public function setPowersAutoloader($namespace, $loadSite) @@ -29129,7 +28930,7 @@ function vdm_dkim() { if (($size = ArrayHelper::check($namespace)) > 0) { // check if we are using a plugin - $use_plugin = isset($this->fileContentStatic[$this->hhh . 'PLUGIN_POWER_AUTOLOADER' . $this->hhh]); + $use_plugin = isset($this->fileContentStatic[Placefix::_h('PLUGIN_POWER_AUTOLOADER')]); // build the methods $autoloadNotSiteMethod = array(); $autoloadMethod = array(); @@ -29143,20 +28944,20 @@ function vdm_dkim() { elseif (!$loadSite) { // we add code to prevent this plugin from triggering on the site area - $autoloadNotSiteMethod[] = PHP_EOL . $this->_t(2) . '//' - . $this->setLine(__LINE__) . ' do not run the autoloader in the site area'; - $autoloadNotSiteMethod[] = $this->_t(2) . 'if ($this->app->isClient(\'site\'))'; - $autoloadNotSiteMethod[] = $this->_t(2) . '{'; - $autoloadNotSiteMethod[] = $this->_t(3) . 'return;'; - $autoloadNotSiteMethod[] = $this->_t(2) . '}' . PHP_EOL; + $autoloadNotSiteMethod[] = PHP_EOL . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' do not run the autoloader in the site area'; + $autoloadNotSiteMethod[] = Indent::_(2) . 'if ($this->app->isClient(\'site\'))'; + $autoloadNotSiteMethod[] = Indent::_(2) . '{'; + $autoloadNotSiteMethod[] = Indent::_(3) . 'return;'; + $autoloadNotSiteMethod[] = Indent::_(2) . '}' . PHP_EOL; } // we start building the spl_autoload_register function call - $autoloadMethod[] = $this->_t($tab_space) . '//' - . $this->setLine(__LINE__) . ' register this component namespace'; - $autoloadMethod[] = $this->_t($tab_space) . 'spl_autoload_register(function ($class) {'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '//' - . $this->setLine(__LINE__) . ' project-specific base directories and namespace prefix'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '$search = array('; + $autoloadMethod[] = Indent::_($tab_space) . '//' + . Line::_(__Line__, __Class__) . ' register this component namespace'; + $autoloadMethod[] = Indent::_($tab_space) . 'spl_autoload_register(function ($class) {'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$search = array('; // ==== IMPORTANT NOTICE ===== // make sure the name space values are sorted from the longest string to the shortest // so that the search do not mistakenly match a shorter namespace before a longer one @@ -29178,78 +28979,78 @@ function vdm_dkim() { // don't add the ending comma on last value if ($size == $counter) { - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'" . Config::get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . "'" . CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "'"; } else { - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . "'" . Config::get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . "'" . CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers') . "/$base_dir' => '" . implode('\\\\', $prefix) . "',"; } $counter++; } - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . ');'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '// Start the search and load if found'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '$found = false;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '$found_base_dir = "";'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '$found_len = 0;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . 'foreach ($search as $base_dir => $prefix)'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '{'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . '//' - . $this->setLine(__LINE__) . ' does the class use the namespace prefix?'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . '$len = strlen($prefix);'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . 'if (strncmp($prefix, $class, $len) === 0)'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . '{'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(3) . '//' - . $this->setLine(__LINE__) . ' we have a match so load the values'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(3) . '$found = true;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(3) . '$found_base_dir = $base_dir;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(3) . '$found_len = $len;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(3) . '//' - . $this->setLine(__LINE__) . ' done here'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(3) . 'break;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . '}'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '}'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '//' - . $this->setLine(__LINE__) . ' check if we found a match'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . 'if (!$found)'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '{'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . '//' - . $this->setLine(__LINE__) . ' no, move to the next registered autoloader'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . 'return;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '}'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '//' - . $this->setLine(__LINE__) . ' get the relative class name'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '$relative_class = substr($class, $found_len);'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '//' - . $this->setLine(__LINE__) . ' replace the namespace prefix with the base directory, replace namespace'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '// separators with directory separators in the relative class name, append'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '// with .php'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '//' - . $this->setLine(__LINE__) . ' if the file exists, require it'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . 'if (file_exists($file))'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '{'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(2) . 'require $file;'; - $autoloadMethod[] = $this->_t($tab_space) . $this->_t(1) . '}'; - $autoloadMethod[] = $this->_t($tab_space) . '});'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . ');'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// Start the search and load if found'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found = false;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found_base_dir = "";'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$found_len = 0;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'foreach ($search as $base_dir => $prefix)'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' does the class use the namespace prefix?'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '$len = strlen($prefix);'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'if (strncmp($prefix, $class, $len) === 0)'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' we have a match so load the values'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found = true;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found_base_dir = $base_dir;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '$found_len = $len;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . '//' + . Line::_(__Line__, __Class__) . ' done here'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(3) . 'break;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' check if we found a match'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'if (!$found)'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . '//' + . Line::_(__Line__, __Class__) . ' no, move to the next registered autoloader'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'return;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' get the relative class name'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '$relative_class = substr($class, $found_len);'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' replace the namespace prefix with the base directory, replace namespace'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// separators with directory separators in the relative class name, append'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '// with .php'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . "\$file = JPATH_ROOT . '/' . \$found_base_dir . '/src' . str_replace('\\\\', '/', \$relative_class) . '.php';"; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '//' + . Line::_(__Line__, __Class__) . ' if the file exists, require it'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . 'if (file_exists($file))'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '{'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(2) . 'require $file;'; + $autoloadMethod[] = Indent::_($tab_space) . Indent::_(1) . '}'; + $autoloadMethod[] = Indent::_($tab_space) . '});'; // create the method string $autoloader = implode(PHP_EOL, $autoloadNotSiteMethod) . implode(PHP_EOL, $autoloadMethod); // check if we are using a plugin if ($use_plugin) { - $this->fileContentStatic[$this->hhh . 'PLUGIN_POWER_AUTOLOADER' . $this->hhh] = PHP_EOL . $autoloader; + $this->fileContentStatic[Placefix::_h('PLUGIN_POWER_AUTOLOADER')] = PHP_EOL . $autoloader; } else { // load to events placeholders - $this->fileContentStatic[$this->hhh . 'ADMIN_POWER_HELPER' . $this->hhh] .= $autoloader; + $this->fileContentStatic[Placefix::_h('ADMIN_POWER_HELPER')] .= $autoloader; // load to site if needed if ($loadSite) { - $this->fileContentStatic[$this->hhh . 'SITE_POWER_HELPER' . $this->hhh] .= $autoloader; + $this->fileContentStatic[Placefix::_h('SITE_POWER_HELPER')] .= $autoloader; } } // to add to custom files - $this->fileContentStatic[$this->hhh . 'CUSTOM_POWER_AUTOLOADER' . $this->hhh] .= PHP_EOL . implode(PHP_EOL, $autoloadMethod); + $this->fileContentStatic[Placefix::_h('CUSTOM_POWER_AUTOLOADER')] .= PHP_EOL . implode(PHP_EOL, $autoloadMethod); } } @@ -29283,8 +29084,8 @@ function vdm_dkim() { &$file_name ) { - // only log messages for none Config::get('lang_tag', 'en-GB') translations - if (Config::get('lang_tag', 'en-GB') !== $tag) + // only log messages for none CFactory::_('Config')->get('lang_tag', 'en-GB') translations + if (CFactory::_('Config')->get('lang_tag', 'en-GB') !== $tag) { $langStringNr = count($languageStrings); $langStringSum = MathHelper::bc( @@ -29297,7 +29098,7 @@ function vdm_dkim() { . $tag . ' translated)' : '(strings ' . $tag . ' translated)'; // force load if debug lines are added - if (!Config::get('debug_line_nr', false)) + if (!CFactory::_('Config')->get('debug_line_nr', false)) { // check if we should install this translation if ($percentage < $this->percentageLanguageAdd) @@ -29305,7 +29106,7 @@ function vdm_dkim() { // dont add $this->langNot[$file_name] = '' . $total . '(total ' - . Config::get('lang_tag', 'en-GB') . ' strings) only ' + . CFactory::_('Config')->get('lang_tag', 'en-GB') . ' strings) only ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; @@ -29315,7 +29116,7 @@ function vdm_dkim() { // show if it was added as well $this->langSet[$file_name] = '' . $total . '(total ' - . Config::get('lang_tag', 'en-GB') . ' strings) and ' + . CFactory::_('Config')->get('lang_tag', 'en-GB') . ' strings) and ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index c92c44c3e..212fd1a47 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -19,14 +19,18 @@ use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; -use VDM\Joomla\Componentbuilder\Extension\InstallScript; -use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; /** * Infusion class */ class Infusion extends Interpretation { + + public $langFiles = array(); public $removeSiteFolder = false; public $removeSiteEditFolder = true; @@ -34,10 +38,10 @@ class Infusion extends Interpretation /** * Constructor */ - public function __construct($config = array()) + public function __construct() { // first we run the perent constructor - if (parent::__construct($config)) + if (parent::__construct()) { // infuse the data into the structure return $this->buildFileContent(); @@ -46,24 +50,6 @@ class Infusion extends Interpretation return false; } - /** - * Set the line number in comments - * - * @param int $nr The line number - * - * @return void - * - */ - private function setLine($nr) - { - if (Config::get('debug_line_nr', false)) - { - return ' [Infusion ' . $nr . ']'; - } - - return ''; - } - /** * Build the content for the structure * @@ -78,87 +64,87 @@ class Infusion extends Interpretation $this->componentData->admin_views )) { + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFilesContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // COMPONENT - $this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] - = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh]; + $this->fileContentStatic[Placefix::_h('COMPONENT')] + = CFactory::_('Placeholder')->active[Placefix::_h('COMPONENT')]; // Component - $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] - = $this->placeholders[$this->hhh . 'Component' . $this->hhh]; + $this->fileContentStatic[Placefix::_h('Component')] + = CFactory::_('Placeholder')->active[Placefix::_h('Component')]; // component - $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] - = $this->placeholders[$this->hhh . 'component' . $this->hhh]; + $this->fileContentStatic[Placefix::_h('component')] + = CFactory::_('Placeholder')->active[Placefix::_h('component')]; // COMPANYNAME - $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] + $this->fileContentStatic[Placefix::_h('COMPANYNAME')] = trim( JFilterOutput::cleanText($this->componentData->companyname) ); // CREATIONDATE - $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] + $this->fileContentStatic[Placefix::_h('CREATIONDATE')] = JFactory::getDate($this->componentData->created)->format( 'jS F, Y' ); - $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh + $this->fileContentStatic[Placefix::_h('CREATIONDATE') . 'GLOBAL'] - = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' - . $this->hhh]; + = $this->fileContentStatic[Placefix::_h('CREATIONDATE')]; // BUILDDATE - $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] + $this->fileContentStatic[Placefix::_h('BUILDDATE')] = JFactory::getDate()->format('jS F, Y'); - $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh + $this->fileContentStatic[Placefix::_h('BUILDDATE') . 'GLOBAL'] - = $this->fileContentStatic[$this->hhh . 'BUILDDATE' - . $this->hhh]; + = $this->fileContentStatic[Placefix::_h('BUILDDATE')]; // AUTHOR - $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] = trim( + $this->fileContentStatic[Placefix::_h('AUTHOR')] = trim( JFilterOutput::cleanText($this->componentData->author) ); // AUTHOREMAIL - $this->fileContentStatic[$this->hhh . 'AUTHOREMAIL' . $this->hhh] + $this->fileContentStatic[Placefix::_h('AUTHOREMAIL')] = trim($this->componentData->email); // AUTHORWEBSITE - $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] + $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] = trim($this->componentData->website); // COPYRIGHT - $this->fileContentStatic[$this->hhh . 'COPYRIGHT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('COPYRIGHT')] = trim($this->componentData->copyright); // LICENSE - $this->fileContentStatic[$this->hhh . 'LICENSE' . $this->hhh] + $this->fileContentStatic[Placefix::_h('LICENSE')] = trim($this->componentData->license); // VERSION - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] + $this->fileContentStatic[Placefix::_h('VERSION')] = trim($this->componentData->component_version); // set the actual global version - $this->fileContentStatic[$this->hhh . 'ACTUALVERSION' . $this->hhh] - = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; + $this->fileContentStatic[Placefix::_h('ACTUALVERSION')] + = $this->fileContentStatic[Placefix::_h('VERSION')]; // do some Tweaks to the version based on selected options if (strpos( - $this->fileContentStatic[$this->hhh . 'VERSION' - . $this->hhh], '.' + $this->fileContentStatic[Placefix::_h('VERSION')], '.' ) !== false) { $versionArray = explode( - '.', $this->fileContentStatic[$this->hhh . 'VERSION' - . $this->hhh] + '.', $this->fileContentStatic[Placefix::_h('VERSION')] ); } // load only first two values @@ -168,7 +154,7 @@ class Infusion extends Interpretation ) && $this->componentData->mvc_versiondate == 2) { - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] + $this->fileContentStatic[Placefix::_h('VERSION')] = $versionArray[0] . '.' . $versionArray[1] . '.x'; } // load only the first value @@ -178,27 +164,26 @@ class Infusion extends Interpretation ) && $this->componentData->mvc_versiondate == 3) { - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] + $this->fileContentStatic[Placefix::_h('VERSION')] = $versionArray[0] . '.x.x'; } unset($versionArray); // set the global version in case - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh + $this->fileContentStatic[Placefix::_h('VERSION') . 'GLOBAL'] - = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; + = $this->fileContentStatic[Placefix::_h('VERSION')]; // set the joomla target xml version - $this->fileContentStatic[$this->hhh . 'XMLVERSION' . $this->hhh] - = $this->joomlaVersions[Config::get('version', 3)]['xml_version']; + $this->fileContentStatic[Placefix::_h('XMLVERSION')] + = $this->joomlaVersions[CFactory::_('Config')->joomla_version]['xml_version']; // Component_name - $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] + $this->fileContentStatic[Placefix::_h('Component_name')] = JFilterOutput::cleanText($this->componentData->name); // SHORT_DISCRIPTION - $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SHORT_DESCRIPTION')] = trim( JFilterOutput::cleanText( $this->componentData->short_description @@ -206,159 +191,136 @@ class Infusion extends Interpretation ); // DESCRIPTION - $this->fileContentStatic[$this->hhh . 'DESCRIPTION' . $this->hhh] + $this->fileContentStatic[Placefix::_h('DESCRIPTION')] = trim($this->componentData->description); // COMP_IMAGE_TYPE - $this->fileContentStatic[$this->hhh . 'COMP_IMAGE_TYPE' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('COMP_IMAGE_TYPE')] = $this->setComponentImageType($this->componentData->image); // ACCESS_SECTIONS - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] = $this->setAccessSections(); // CONFIG_FIELDSETS - $keepLang = $this->lang; - $this->lang = 'admin'; + $keepLang = CFactory::_('Config')->lang_target; + CFactory::_('Config')->lang_target = 'admin'; // start loading the category tree scripts - $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('CATEGORY_CLASS_TREES')] = ''; // run the field sets for first time $this->setConfigFieldsets(1); - $this->lang = $keepLang; + CFactory::_('Config')->lang_target = $keepLang; // ADMINJS - $this->fileContentStatic[$this->hhh . 'ADMINJS' . $this->hhh] - = $this->setPlaceholders( - $this->customScriptBuilder['component_js'], $this->placeholders + $this->fileContentStatic[Placefix::_h('ADMINJS')] + = CFactory::_('Placeholder')->update( + $this->customScriptBuilder['component_js'], CFactory::_('Placeholder')->active ); // SITEJS - $this->fileContentStatic[$this->hhh . 'SITEJS' . $this->hhh] - = $this->setPlaceholders( - $this->customScriptBuilder['component_js'], $this->placeholders + $this->fileContentStatic[Placefix::_h('SITEJS')] + = CFactory::_('Placeholder')->update( + $this->customScriptBuilder['component_js'], CFactory::_('Placeholder')->active ); // ADMINCSS - $this->fileContentStatic[$this->hhh . 'ADMINCSS' . $this->hhh] - = $this->setPlaceholders( + $this->fileContentStatic[Placefix::_h('ADMINCSS')] + = CFactory::_('Placeholder')->update( $this->customScriptBuilder['component_css_admin'], - $this->placeholders + CFactory::_('Placeholder')->active ); // SITECSS - $this->fileContentStatic[$this->hhh . 'SITECSS' . $this->hhh] - = $this->setPlaceholders( + $this->fileContentStatic[Placefix::_h('SITECSS')] + = CFactory::_('Placeholder')->update( $this->customScriptBuilder['component_css_site'], - $this->placeholders + CFactory::_('Placeholder')->active ); // CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[$this->hhh . 'CUSTOM_HELPER_SCRIPT' - . $this->hhh] - = $this->setPlaceholders( + $this->fileContentStatic[Placefix::_h('CUSTOM_HELPER_SCRIPT')] + = CFactory::_('Placeholder')->update( $this->customScriptBuilder['component_php_helper_admin'], - $this->placeholders + CFactory::_('Placeholder')->active ); // BOTH_CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[$this->hhh . 'BOTH_CUSTOM_HELPER_SCRIPT' - . $this->hhh] - = $this->setPlaceholders( + $this->fileContentStatic[Placefix::_h('BOTH_CUSTOM_HELPER_SCRIPT')] + = CFactory::_('Placeholder')->update( $this->customScriptBuilder['component_php_helper_both'], - $this->placeholders + CFactory::_('Placeholder')->active ); // ADMIN_GLOBAL_EVENT_HELPER - if (!isset($this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' - . $this->hhh])) + if (!isset($this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')])) { - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' - . $this->hhh] = ''; + $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')] = ''; } - if (!isset($this->fileContentStatic[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh])) + if (!isset($this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')])) { - $this->fileContentStatic[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = ''; + $this->fileContentStatic[Placefix::_h('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[$this->hhh . 'ADMIN_GLOBAL_EVENT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')] .= PHP_EOL . PHP_EOL . '// Trigger the Global Admin Event'; - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' - . $this->hhh] - .= PHP_EOL . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')] + .= PHP_EOL . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::globalEvent($document);'; // ADMIN_GLOBAL_EVENT_HELPER - $this->fileContentStatic[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $this->fileContentStatic[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) + $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[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) . '**/'; - $this->fileContentStatic[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) + $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[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) . '{'; - $this->fileContentStatic[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->setPlaceholders( + $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( $this->customScriptBuilder['component_php_admin_event'], - $this->placeholders + CFactory::_('Placeholder')->active ); - $this->fileContentStatic[$this->hhh - . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) . '}'; + $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] + .= PHP_EOL . Indent::_(1) . '}'; } // now load the readme file if needed if ($this->componentData->addreadme == 1) { - $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' - . $this->hhh] - .= PHP_EOL . $this->_t(3) + $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FILES')] + .= PHP_EOL . Indent::_(3) . "README.txt"; } // HELPER_CREATEUSER - $this->fileContentStatic[$this->hhh . 'HELPER_CREATEUSER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_CREATEUSER')] = $this->setCreateUserHelperMethod( $this->componentData->creatuserhelper ); // HELP - $this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELP')] = $this->noHelp(); // HELP_SITE - $this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELP_SITE')] = $this->noHelp(); // build route parse switch - $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')] = ''; // build route views - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] = ''; // add the helper emailer if set - $this->fileContentStatic[$this->hhh . 'HELPER_EMAIL' . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_EMAIL')] = $this->addEmailHelper(); // load the global placeholders @@ -380,8 +342,8 @@ class Infusion extends Interpretation foreach ($this->componentData->admin_views as $view) { // set the target - $this->target = 'admin'; - $this->lang = 'admin'; + CFactory::_('Config')->build_target = 'admin'; + CFactory::_('Config')->lang_target = 'admin'; // set local names $nameSingleCode = $view['settings']->name_single_code; @@ -397,9 +359,9 @@ class Infusion extends Interpretation ) && $view['edit_create_site_view'] > 0) { - $site_edit_view_array[] = $this->_t(4) . "'" + $site_edit_view_array[] = Indent::_(4) . "'" . $nameSingleCode . "'"; - $this->lang = 'both'; + CFactory::_('Config')->lang_target = 'both'; // insure site view does not get removed $this->removeSiteEditFolder = false; } @@ -411,7 +373,7 @@ class Infusion extends Interpretation ); // set view array - $viewarray[] = $this->_t(4) . "'" + $viewarray[] = Indent::_(4) . "'" . $nameSingleCode . "' => '" . $nameListCode . "'"; // set the view names @@ -420,14 +382,16 @@ class Infusion extends Interpretation { // set license per view if needed $this->setLockLicensePer( - $nameSingleCode, $this->target + $nameSingleCode, CFactory::_('Config')->build_target ); $this->setLockLicensePer( - $nameListCode, $this->target + $nameListCode, CFactory::_('Config')->build_target ); + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -436,53 +400,48 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$nameSingleCode], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // FIELDSETS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'FIELDSETS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('FIELDSETS')] = $this->setFieldSet( - $view, Config::get('component_code_name'), + $view, CFactory::_('Config')->component_code_name, $nameSingleCode, $nameListCode ); // ACCESSCONTROL <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'ACCESSCONTROL' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ACCESSCONTROL')] = $this->setFieldSetAccessControl( $nameSingleCode ); // LINKEDVIEWITEMS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWITEMS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWITEMS')] = ''; // ADDTOOLBAR <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'ADDTOOLBAR' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADDTOOLBAR')] = $this->setAddToolBar($view); // set the script for this view $this->buildTheViewScript($view); // VIEW_SCRIPT - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'VIEW_SCRIPT' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEW_SCRIPT')] = $this->setViewScript( $nameSingleCode, 'fileScript' ); // EDITBODYSCRIPT - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'EDITBODYSCRIPT' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODYSCRIPT')] = $this->setViewScript( $nameSingleCode, 'footerScript' ); // AJAXTOKE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'AJAXTOKE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('AJAXTOKE')] = $this->setAjaxToke( $nameSingleCode ); @@ -494,8 +453,7 @@ class Infusion extends Interpretation false )) { - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('DOCUMENT_CUSTOM_PHP')] = str_replace( '$document->', '$this->document->', $phpDocument ); @@ -504,124 +462,105 @@ class Infusion extends Interpretation } else { - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('DOCUMENT_CUSTOM_PHP')] = ''; } // LINKEDVIEWTABLESCRIPTS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWTABLESCRIPTS')] = ''; // VALIDATEFIX <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'VALIDATIONFIX' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VALIDATIONFIX')] = $this->setValidationFix( $nameSingleCode, - $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('Component')] ); // EDITBODY <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'EDITBODY' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODY')] = $this->setEditBody($view); // EDITBODYFADEIN <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'EDITBODYFADEIN' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODYFADEIN')] = $this->setFadeInEfect($view); // JTABLECONSTRUCTOR <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JTABLECONSTRUCTOR' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JTABLECONSTRUCTOR')] = $this->setJtableConstructor( $nameSingleCode ); // JTABLEALIASCATEGORY <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JTABLEALIASCATEGORY' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JTABLEALIASCATEGORY')] = $this->setJtableAliasCategory( $nameSingleCode ); // METHOD_GET_ITEM <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'METHOD_GET_ITEM' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('METHOD_GET_ITEM')] = $this->setMethodGetItem( $nameSingleCode ); // LINKEDVIEWGLOBAL <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWGLOBAL' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')] = ''; // LINKEDVIEWMETHODS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'LINKEDVIEWMETHODS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWMETHODS')] = ''; // JMODELADMIN_BEFORE_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_BEFORE_DELETE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_DELETE')] = $this->getCustomScriptBuilder( 'php_before_delete', $nameSingleCode, PHP_EOL ); // JMODELADMIN_AFTER_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_AFTER_DELETE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_DELETE')] = $this->getCustomScriptBuilder( 'php_after_delete', $nameSingleCode, PHP_EOL . PHP_EOL ); // JMODELADMIN_BEFORE_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_BEFORE_PUBLISH' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_PUBLISH')] = $this->getCustomScriptBuilder( 'php_before_publish', $nameSingleCode, PHP_EOL ); // JMODELADMIN_AFTER_DELETE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_AFTER_PUBLISH' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_PUBLISH')] = $this->getCustomScriptBuilder( 'php_after_publish', $nameSingleCode, PHP_EOL . PHP_EOL ); // CHECKBOX_SAVE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'CHECKBOX_SAVE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('CHECKBOX_SAVE')] = $this->setCheckboxSave( $nameSingleCode ); // METHOD_ITEM_SAVE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'METHOD_ITEM_SAVE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('METHOD_ITEM_SAVE')] = $this->setMethodItemSave( $nameSingleCode ); // POSTSAVEHOOK <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'POSTSAVEHOOK' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('POSTSAVEHOOK')] = $this->getCustomScriptBuilder( 'php_postsavehook', $nameSingleCode, PHP_EOL, null, - true, PHP_EOL . $this->_t(2) . "return;", - PHP_EOL . PHP_EOL . $this->_t(2) . "return;" + true, PHP_EOL . Indent::_(2) . "return;", + PHP_EOL . PHP_EOL . Indent::_(2) . "return;" ); // VIEWCSS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'VIEWCSS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWCSS')] = $this->getCustomScriptBuilder( 'css_view', $nameSingleCode, '', null, true @@ -634,44 +573,37 @@ class Infusion extends Interpretation ) && $view['edit_create_site_view'] > 0) { - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'SITE_VIEWCSS' . $this->hhh] - = $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'VIEWCSS' . $this->hhh]; + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_VIEWCSS')] + = $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWCSS')]; // check if we should add a create menu if ($view['edit_create_site_view'] == 2) { // SITE_MENU_XML <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'SITE_MENU_XML' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_MENU_XML')] = $this->setAdminViewMenu( $nameSingleCode, $view ); } // SITE_ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'SITE_ADMIN_VIEW_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_CONTROLLER_HEADER')] = $this->setFileHeader( 'site.admin.view.controller', $nameSingleCode ); // SITE_ADMIN_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'SITE_ADMIN_VIEW_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_MODEL_HEADER')] = $this->setFileHeader( 'site.admin.view.model', $nameSingleCode ); // SITE_ADMIN_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'SITE_ADMIN_VIEW_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_HTML_HEADER')] = $this->setFileHeader( 'site.admin.view.html', $nameSingleCode ); // SITE_ADMIN_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'SITE_ADMIN_VIEW_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_HEADER')] = $this->setFileHeader( 'site.admin.view', $nameSingleCode @@ -679,40 +611,37 @@ class Infusion extends Interpretation } // TABLAYOUTFIELDSARRAY <<>> add the tab layout fields array to the model - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'TABLAYOUTFIELDSARRAY' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('TABLAYOUTFIELDSARRAY')] = $this->getTabLayoutFieldsArray( $nameSingleCode ); // ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'ADMIN_VIEW_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_CONTROLLER_HEADER')] = $this->setFileHeader( 'admin.view.controller', $nameSingleCode ); // ADMIN_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'ADMIN_VIEW_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_MODEL_HEADER')] = $this->setFileHeader( 'admin.view.model', $nameSingleCode ); // ADMIN_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'ADMIN_VIEW_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_HTML_HEADER')] = $this->setFileHeader( 'admin.view.html', $nameSingleCode ); // ADMIN_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'ADMIN_VIEW_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_HEADER')] = $this->setFileHeader( 'admin.view', $nameSingleCode ); + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -721,20 +650,23 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$nameSingleCode], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; } // set the views names if (isset($view['settings']->name_list) && $view['settings']->name_list != 'null') { - $this->lang = 'admin'; + CFactory::_('Config')->lang_target = 'admin'; // ICOMOON <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ICOMOON' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ICOMOON')] = $view['icomoon']; + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildAdminListViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -743,6 +675,8 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$nameListCode], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // set the export/import option if (isset($view['port']) && $view['port'] @@ -771,145 +705,121 @@ class Infusion extends Interpretation if (isset($view['checkin']) && $view['checkin'] == 1) { // AUTOCHECKIN <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'AUTOCHECKIN' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('AUTOCHECKIN')] = $this->setAutoCheckin( $nameSingleCode, - Config::get('component_code_name') + CFactory::_('Config')->component_code_name ); // CHECKINCALL <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'CHECKINCALL' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('CHECKINCALL')] = $this->setCheckinCall(); } else { // AUTOCHECKIN <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'AUTOCHECKIN' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('AUTOCHECKIN')] = ''; // CHECKINCALL <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'CHECKINCALL' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('CHECKINCALL')] = ''; } // admin list file contnet - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_JAVASCRIPT_FILE' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_JAVASCRIPT_FILE')] = $this->setViewScript( $nameListCode, 'list_fileScript' ); // ADMIN_CUSTOM_BUTTONS_LIST - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_CUSTOM_BUTTONS_LIST' . $this->hhh] - = $this->setCustomButtons($view, 3, $this->_t(1)); - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_CUSTOM_BUTTONS_LIST')] + = $this->setCustomButtons($view, 3, Indent::_(1)); + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST')] = $this->setFunctionOnlyButtons( $nameListCode ); // GET_ITEMS_METHOD_STRING_FIX <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'GET_ITEMS_METHOD_STRING_FIX' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('GET_ITEMS_METHOD_STRING_FIX')] = $this->setGetItemsMethodStringFix( $nameSingleCode, $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('Component')] ); // GET_ITEMS_METHOD_AFTER_ALL <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'GET_ITEMS_METHOD_AFTER_ALL' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('GET_ITEMS_METHOD_AFTER_ALL')] = $this->getCustomScriptBuilder( 'php_getitems_after_all', $nameSingleCode, PHP_EOL ); // SELECTIONTRANSLATIONFIX <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'SELECTIONTRANSLATIONFIX' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIX')] = $this->setSelectionTranslationFix( $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('Component')] ); // SELECTIONTRANSLATIONFIXFUNC <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'SELECTIONTRANSLATIONFIXFUNC' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIXFUNC')] = $this->setSelectionTranslationFixFunc( $nameListCode, - $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('Component')] ); // FILTER_FIELDS <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'FILTER_FIELDS' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('FILTER_FIELDS')] = $this->setFilterFieldsArray( $nameSingleCode, $nameListCode ); // STOREDID <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'STOREDID' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('STOREDID')] = $this->setStoredId( $nameSingleCode, $nameListCode ); // POPULATESTATE <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'POPULATESTATE' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('POPULATESTATE')] = $this->setPopulateState( $nameSingleCode, $nameListCode ); // SORTFIELDS <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'SORTFIELDS' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('SORTFIELDS')] = $this->setSortFields( $nameListCode ); // CATEGORY_VIEWS if (!isset( - $this->fileContentStatic[$this->hhh - . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] )) { - $this->fileContentStatic[$this->hhh - . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] = ''; } - $this->fileContentStatic[$this->hhh - . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')] .= $this->setRouterCategoryViews( $nameSingleCode, $nameListCode ); // FILTERFIELDDISPLAYHELPER <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'FILTERFIELDDISPLAYHELPER' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('FILTERFIELDDISPLAYHELPER')] = $this->setFilterFieldSidebarDisplayHelper( $nameSingleCode, $nameListCode ); // BATCHDISPLAYHELPER <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'BATCHDISPLAYHELPER' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('BATCHDISPLAYHELPER')] = $this->setBatchDisplayHelper( $nameSingleCode, $nameListCode ); // FILTERFUNCTIONS <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'FILTERFUNCTIONS' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('FILTERFUNCTIONS')] = $this->setFilterFieldHelper( $nameSingleCode, $nameListCode @@ -917,8 +827,7 @@ class Infusion extends Interpretation // FIELDFILTERSETS <<>> $this->fileContentDynamic['filter_' - . $nameListCode][$this->hhh - . 'FIELDFILTERSETS' . $this->hhh] + . $nameListCode][Placefix::_h('FIELDFILTERSETS')] = $this->setFieldFilterSet( $nameSingleCode, $nameListCode @@ -926,109 +835,96 @@ class Infusion extends Interpretation // FIELDLISTSETS <<>> $this->fileContentDynamic['filter_' - . $nameListCode][$this->hhh - . 'FIELDLISTSETS' . $this->hhh] + . $nameListCode][Placefix::_h('FIELDLISTSETS')] = $this->setFieldFilterListSet( $nameSingleCode, $nameListCode ); // LISTQUERY <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'LISTQUERY' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTQUERY')] = $this->setListQuery( $nameSingleCode, $nameListCode ); // MODELEXPORTMETHOD <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'MODELEXPORTMETHOD' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('MODELEXPORTMETHOD')] = $this->setGetItemsModelMethod( $nameSingleCode, $nameListCode ); // MODELEXIMPORTMETHOD <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'CONTROLLEREXIMPORTMETHOD' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('CONTROLLEREXIMPORTMETHOD')] = $this->setControllerEximportMethod( $nameSingleCode, $nameListCode ); // EXPORTBUTTON <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'EXPORTBUTTON' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('EXPORTBUTTON')] = $this->setExportButton( $nameSingleCode, $nameListCode ); // IMPORTBUTTON <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'IMPORTBUTTON' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('IMPORTBUTTON')] = $this->setImportButton( $nameSingleCode, $nameListCode ); // VIEWS_DEFAULT_BODY <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'VIEWS_DEFAULT_BODY' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_DEFAULT_BODY')] = $this->setDefaultViewsBody( $nameSingleCode, $nameListCode ); // LISTHEAD <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'LISTHEAD' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTHEAD')] = $this->setListHead( $nameSingleCode, $nameListCode ); // LISTBODY <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'LISTBODY' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTBODY')] = $this->setListBody( $nameSingleCode, $nameListCode ); // LISTCOLNR <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'LISTCOLNR' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('LISTCOLNR')] = $this->setListColnr( $nameListCode ); // JVIEWLISTCANDO <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'JVIEWLISTCANDO' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('JVIEWLISTCANDO')] = $this->setJviewListCanDo( $nameSingleCode, $nameListCode ); // VIEWSCSS <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'VIEWSCSS' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWSCSS')] = $this->getCustomScriptBuilder( 'css_views', $nameSingleCode, '', null, true ); // ADMIN_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_DIPLAY_METHOD' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_DIPLAY_METHOD')] = $this->setAdminViewDisplayMethod( $nameListCode ); // VIEWS_FOOTER_SCRIPT <<>> - $scriptNote = PHP_EOL . '//' . $this->setLine(__LINE__) + $scriptNote = PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' ' . $nameListCode . ' footer script'; if (($footerScript = $this->getCustomScriptBuilder( @@ -1039,7 +935,7 @@ class Infusion extends Interpretation && StringHelper::check($footerScript)) { // only minfy if no php is added to the footer script - if (Config::get('minify', 0) + if (CFactory::_('Config')->get('minify', 0) && strpos($footerScript, 'fileContentDynamic[$nameListCode][$this->hhh - . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_FOOTER_SCRIPT')] = PHP_EOL . '"; // clear some memory @@ -1058,39 +953,36 @@ class Infusion extends Interpretation } else { - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_FOOTER_SCRIPT')] = ''; } // ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_VIEWS_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_CONTROLLER_HEADER')] = $this->setFileHeader( 'admin.views.controller', $nameListCode ); // ADMIN_VIEWS_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_VIEWS_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_MODEL_HEADER')] = $this->setFileHeader( 'admin.views.model', $nameListCode ); // ADMIN_VIEWS_HTML_HEADER <<>> add the header details for the views - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_VIEWS_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_HTML_HEADER')] = $this->setFileHeader( 'admin.views.html', $nameListCode ); // ADMIN_VIEWS_HEADER <<>> add the header details for the views - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'ADMIN_VIEWS_HEADER' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_HEADER')] = $this->setFileHeader( 'admin.views', $nameListCode ); + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildAdminListViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildAdminListViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -1099,62 +991,55 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$nameListCode], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; } // set u fields used in batch - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'UNIQUEFIELDS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('UNIQUEFIELDS')] = $this->setUniqueFields( $nameSingleCode ); // TITLEALIASFIX <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'TITLEALIASFIX' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('TITLEALIASFIX')] = $this->setAliasTitleFix( $nameSingleCode ); // GENERATENEWTITLE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'GENERATENEWTITLE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('GENERATENEWTITLE')] = $this->setGenerateNewTitle( $nameSingleCode ); // GENERATENEWALIAS <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'GENERATENEWALIAS' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('GENERATENEWALIAS')] = $this->setGenerateNewAlias( $nameSingleCode ); // MODEL_BATCH_COPY <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'MODEL_BATCH_COPY' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('MODEL_BATCH_COPY')] = $this->setBatchCopy($nameSingleCode); // MODEL_BATCH_MOVE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'MODEL_BATCH_MOVE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('MODEL_BATCH_MOVE')] = $this->setBatchMove($nameSingleCode); // BATCH_ONCLICK_CANCEL_SCRIPT <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'BATCH_ONCLICK_CANCEL_SCRIPT' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('BATCH_ONCLICK_CANCEL_SCRIPT')] = ''; // TODO <-- must still be build // JCONTROLLERFORM_ALLOWADD <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JCONTROLLERFORM_ALLOWADD' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_ALLOWADD')] = $this->setJcontrollerAllowAdd( $nameSingleCode, $nameListCode ); // JCONTROLLERFORM_BEFORECANCEL <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JCONTROLLERFORM_BEFORECANCEL' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_BEFORECANCEL')] = $this->getCustomScriptBuilder( 'php_before_cancel', $nameSingleCode, PHP_EOL, null, null, @@ -1162,8 +1047,7 @@ class Infusion extends Interpretation ); // JCONTROLLERFORM_AFTERCANCEL <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JCONTROLLERFORM_AFTERCANCEL' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_AFTERCANCEL')] = $this->getCustomScriptBuilder( 'php_after_cancel', $nameSingleCode, PHP_EOL, null, null, @@ -1171,40 +1055,35 @@ class Infusion extends Interpretation ); // JCONTROLLERFORM_ALLOWEDIT <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JCONTROLLERFORM_ALLOWEDIT' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_ALLOWEDIT')] = $this->setJcontrollerAllowEdit( $nameSingleCode, $nameListCode ); // JMODELADMIN_GETFORM <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_GETFORM' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_GETFORM')] = $this->setJmodelAdminGetForm( $nameSingleCode, $nameListCode ); // JMODELADMIN_ALLOWEDIT <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_ALLOWEDIT' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_ALLOWEDIT')] = $this->setJmodelAdminAllowEdit( $nameSingleCode, $nameListCode ); // JMODELADMIN_CANDELETE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_CANDELETE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_CANDELETE')] = $this->setJmodelAdminCanDelete( $nameSingleCode, $nameListCode ); // JMODELADMIN_CANEDITSTATE <<>> - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'JMODELADMIN_CANEDITSTATE' . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_CANEDITSTATE')] = $this->setJmodelAdminCanEditState( $nameSingleCode, $nameListCode @@ -1212,30 +1091,25 @@ class Infusion extends Interpretation // set custom admin view Toolbare buttons // CUSTOM_ADMIN_DYNAMIC_BUTTONS <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('CUSTOM_ADMIN_DYNAMIC_BUTTONS')] = $this->setCustomAdminDynamicButton( $nameListCode ); // CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER <<>> - $this->fileContentDynamic[$nameListCode][$this->hhh - . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER' . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER')] = $this->setCustomAdminDynamicButtonController( $nameListCode ); // set helper router if (!isset( - $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] )) { - $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] = ''; } - $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] .= $this->setRouterHelp( $nameSingleCode, $nameListCode @@ -1248,13 +1122,11 @@ class Infusion extends Interpretation && $view['edit_create_site_view'] > 0) { // add needed router stuff for front edit views - $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')] .= $this->routerParseSwitch( $nameSingleCode, null, false ); - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] .= $this->routerBuildViews( $nameSingleCode ); @@ -1262,16 +1134,13 @@ class Infusion extends Interpretation // ACCESS_SECTIONS if (!isset( - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] )) { - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] = ''; } - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] .= $this->setAccessSectionsCategory( $nameSingleCode, $nameListCode @@ -1280,13 +1149,14 @@ class Infusion extends Interpretation if (isset($view['joomla_fields']) && $view['joomla_fields'] == 1) { - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')] .= $this->setAccessSectionsJoomlaFields(); } + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildAdminViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildAdminViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -1295,6 +1165,8 @@ class Infusion extends Interpretation &$this->fileContentDynamic, &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; } // setup the layouts @@ -1306,75 +1178,70 @@ class Infusion extends Interpretation $this->componentData->custom_admin_views )) { - $this->target = 'custom_admin'; - $this->lang = 'admin'; + CFactory::_('Config')->build_target = 'custom_admin'; + CFactory::_('Config')->lang_target = 'admin'; // start dynamic build foreach ($this->componentData->custom_admin_views as $view) { // for single views - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SView' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SView')] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'sview' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sview')] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SVIEW' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SVIEW')] = $view['settings']->CODE; // for list views - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SViews' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SViews')] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'sviews' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sviews')] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SVIEWS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SVIEWS')] = $view['settings']->CODE; // add to lang array - $this->setLangContent( - $this->lang, - Config::get('lang_prefix') . '_' . $view['settings']->CODE, + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, + CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE, $view['settings']->name ); - $this->setLangContent( - $this->lang, - Config::get('lang_prefix') . '_' . $view['settings']->CODE + CFactory::_('Language')->set( + CFactory::_('Config')->lang_target, + CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description ); // ICOMOON <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'ICOMOON' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('ICOMOON')] = $view['icomoon']; // set placeholders - $this->placeholders[$this->hhh . 'SView' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SView')] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sview' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('sview')] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SVIEW')] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SView' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SView')] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sview' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('sview')] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SVIEW')] = $view['settings']->CODE; - $this->placeholders[$this->hhh . 'SViews' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SViews')] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sviews' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('sviews')] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SVIEWS')] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SViews' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SViews')] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sviews' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('sviews')] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SVIEWS')] = $view['settings']->CODE; + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -1382,10 +1249,12 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // set license per view if needed $this->setLockLicensePer( - $view['settings']->code, $this->target + $view['settings']->code, CFactory::_('Config')->build_target ); // check if this custom admin view is the default view @@ -1393,135 +1262,116 @@ class Infusion extends Interpretation && $this->dynamicDashboard === $view['settings']->code) { // HIDEMAINMENU <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'HIDEMAINMENU' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('HIDEMAINMENU')] = ''; } else { // HIDEMAINMENU <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'HIDEMAINMENU' . $this->hhh] - = PHP_EOL . $this->_t(2) . '//' . $this->setLine( - __LINE__ + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('HIDEMAINMENU')] + = PHP_EOL . Indent::_(2) . '//' . Line::_( + __LINE__,__CLASS__ ) . " hide the main menu" - . PHP_EOL . $this->_t(2) + . PHP_EOL . Indent::_(2) . "\$this->app->input->set('hidemainmenu', true);"; } if ($view['settings']->main_get->gettype == 1) { // CUSTOM_ADMIN_BEFORE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_BEFORE_GET_ITEM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEM')] = $this->getCustomScriptBuilder( - $this->target . '_php_before_getitem', + CFactory::_('Config')->build_target . '_php_before_getitem', $view['settings']->code, '', null, true ); // CUSTOM_ADMIN_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_GET_ITEM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_ITEM')] = $this->setCustomViewGetItem( $view['settings']->main_get, - $view['settings']->code, $this->_t(2) + $view['settings']->code, Indent::_(2) ); // CUSTOM_ADMIN_AFTER_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_AFTER_GET_ITEM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEM')] = $this->getCustomScriptBuilder( - $this->target . '_php_after_getitem', + CFactory::_('Config')->build_target . '_php_after_getitem', $view['settings']->code, '', null, true ); } elseif ($view['settings']->main_get->gettype == 2) { // CUSTOM_ADMIN_GET_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_GET_LIST_QUERY' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_LIST_QUERY')] = $this->setCustomViewListQuery( $view['settings']->main_get, $view['settings']->code ); // CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY')] = $this->getCustomScriptBuilder( - $this->target . '_php_getlistquery', + CFactory::_('Config')->build_target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true ); // CUSTOM_ADMIN_BEFORE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_BEFORE_GET_ITEMS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEMS')] = $this->getCustomScriptBuilder( - $this->target . '_php_before_getitems', + CFactory::_('Config')->build_target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true ); // CUSTOM_ADMIN_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_GET_ITEMS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_ITEMS')] = $this->setCustomViewGetItems( $view['settings']->main_get, $view['settings']->code ); // CUSTOM_ADMIN_AFTER_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_AFTER_GET_ITEMS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEMS')] = $this->getCustomScriptBuilder( - $this->target . '_php_after_getitems', + CFactory::_('Config')->build_target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true ); } // CUSTOM_ADMIN_CUSTOM_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_METHODS')] = $this->setCustomViewCustomItemMethods( $view['settings']->main_get, $view['settings']->code ); - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_METHODS')] .= $this->setCustomViewCustomMethods( $view, $view['settings']->code ); // CUSTOM_ADMIN_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_DIPLAY_METHOD' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_DIPLAY_METHOD')] = $this->setCustomViewDisplayMethod($view); // set document details $this->setPrepareDocument($view); // CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS')] = $this->setCustomViewExtraDisplayMethods($view); // CUSTOM_ADMIN_CODE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_CODE_BODY' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CODE_BODY')] = $this->setCustomViewCodeBody($view); // CUSTOM_ADMIN_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_BODY' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BODY')] = $this->setCustomViewBody($view); // CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT')] = $this->setCustomViewSubmitButtonScript($view); // setup the templates $this->setCustomViewTemplateBody($view); // set the site form if needed - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_TOP_FORM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_TOP_FORM')] = $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 1 ); - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_BOTTOM_FORM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BOTTOM_FORM')] = $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 2 @@ -1531,27 +1381,23 @@ class Infusion extends Interpretation if ($view['settings']->main_get->gettype == 1) { // CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER')] = $this->setFileHeader( 'custom.admin.view.controller', $view['settings']->code ); // CUSTOM_ADMIN_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEW_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_MODEL_HEADER')] = $this->setFileHeader( 'custom.admin.view.model', $view['settings']->code ); // CUSTOM_ADMIN_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEW_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_HTML_HEADER')] = $this->setFileHeader( 'custom.admin.view.html', $view['settings']->code ); // CUSTOM_ADMIN_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEW_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_HEADER')] = $this->setFileHeader( 'custom.admin.view', $view['settings']->code ); @@ -1559,34 +1405,32 @@ class Infusion extends Interpretation elseif ($view['settings']->main_get->gettype == 2) { // CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER <<>> add the header details for the controller - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER')] = $this->setFileHeader( 'custom.admin.views.controller', $view['settings']->code ); // CUSTOM_ADMIN_VIEWS_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEWS_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_MODEL_HEADER')] = $this->setFileHeader( 'custom.admin.views.model', $view['settings']->code ); // CUSTOM_ADMIN_VIEWS_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEWS_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_HTML_HEADER')] = $this->setFileHeader( 'custom.admin.views.html', $view['settings']->code ); // CUSTOM_ADMIN_VIEWS_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'CUSTOM_ADMIN_VIEWS_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_HEADER')] = $this->setFileHeader( 'custom.admin.views', $view['settings']->code ); } + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -1594,6 +1438,8 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; } // setup the layouts @@ -1601,72 +1447,66 @@ class Infusion extends Interpretation } // ADMIN_HELPER_CLASS_HEADER - $this->fileContentStatic[$this->hhh . 'ADMIN_HELPER_CLASS_HEADER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ADMIN_HELPER_CLASS_HEADER')] = $this->setFileHeader( 'admin.helper', 'admin' ); // ADMIN_COMPONENT_HEADER - $this->fileContentStatic[$this->hhh . 'ADMIN_COMPONENT_HEADER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ADMIN_COMPONENT_HEADER')] = $this->setFileHeader( 'admin.component', 'admin' ); // SITE_HELPER_CLASS_HEADER - $this->fileContentStatic[$this->hhh . 'SITE_HELPER_CLASS_HEADER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_HELPER_CLASS_HEADER')] = $this->setFileHeader( 'site.helper', 'site' ); // SITE_COMPONENT_HEADER - $this->fileContentStatic[$this->hhh . 'SITE_COMPONENT_HEADER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_COMPONENT_HEADER')] = $this->setFileHeader( 'site.component', 'site' ); // HELPER_EXEL - $this->fileContentStatic[$this->hhh . 'HELPER_EXEL' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_EXEL')] = $this->setHelperExelMethods(); // VIEWARRAY - $this->fileContentStatic[$this->hhh . 'VIEWARRAY' . $this->hhh] + $this->fileContentStatic[Placefix::_h('VIEWARRAY')] = PHP_EOL . implode("," . PHP_EOL, $viewarray); // CUSTOM_ADMIN_EDIT_VIEW_ARRAY - $this->fileContentStatic[$this->hhh . 'SITE_EDIT_VIEW_ARRAY' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_EDIT_VIEW_ARRAY')] = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array); // MAINMENUS - $this->fileContentStatic[$this->hhh . 'MAINMENUS' . $this->hhh] + $this->fileContentStatic[Placefix::_h('MAINMENUS')] = $this->setMainMenus(); // SUBMENU - $this->fileContentStatic[$this->hhh . 'SUBMENU' . $this->hhh] + $this->fileContentStatic[Placefix::_h('SUBMENU')] = $this->setSubMenus(); // GET_CRYPT_KEY - $this->fileContentStatic[$this->hhh . 'GET_CRYPT_KEY' . $this->hhh] + $this->fileContentStatic[Placefix::_h('GET_CRYPT_KEY')] = $this->setGetCryptKey(); // set the license locker $this->setLockLicense(); // CONTRIBUTORS - $this->fileContentStatic[$this->hhh . 'CONTRIBUTORS' . $this->hhh] + $this->fileContentStatic[Placefix::_h('CONTRIBUTORS')] = $this->theContributors; // INSTALL - $this->fileContentStatic[$this->hhh . 'INSTALL' . $this->hhh] + $this->fileContentStatic[Placefix::_h('INSTALL')] = $this->setInstall(); // UNINSTALL - $this->fileContentStatic[$this->hhh . 'UNINSTALL' . $this->hhh] + $this->fileContentStatic[Placefix::_h('UNINSTALL')] = $this->setUninstall(); // UPDATE_VERSION_MYSQL @@ -1676,57 +1516,46 @@ class Infusion extends Interpretation if (!StringHelper::check($this->dynamicDashboard)) { // DASHBOARDVIEW - $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' - . $this->hhh] - = Config::get('component_code_name'); + $this->fileContentStatic[Placefix::_h('DASHBOARDVIEW')] + = CFactory::_('Config')->component_code_name; // DASHBOARDICONS - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASHBOARDICONS' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASHBOARDICONS')] = $this->setDashboardIcons(); // DASHBOARDICONACCESS - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASHBOARDICONACCESS' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASHBOARDICONACCESS')] = $this->setDashboardIconAccess(); // DASH_MODEL_METHODS - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASH_MODEL_METHODS' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_MODEL_METHODS')] = $this->setDashboardModelMethods(); // DASH_GET_CUSTOM_DATA - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASH_GET_CUSTOM_DATA' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_GET_CUSTOM_DATA')] = $this->setDashboardGetCustomData(); // DASH_DISPLAY_DATA - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASH_DISPLAY_DATA' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_DISPLAY_DATA')] = $this->setDashboardDisplayData(); // DASH_VIEW_HEADER - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASH_VIEW_HEADER' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_VIEW_HEADER')] = $this->setFileHeader('dashboard.view', 'dashboard'); // DASH_VIEW_HTML_HEADER - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASH_VIEW_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_VIEW_HTML_HEADER')] = $this->setFileHeader('dashboard.view.html', 'dashboard'); // DASH_MODEL_HEADER - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASH_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_MODEL_HEADER')] = $this->setFileHeader('dashboard.model', 'dashboard'); // DASH_CONTROLLER_HEADER - $this->fileContentDynamic[Config::get('component_code_name')][$this->hhh - . 'DASH_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_CONTROLLER_HEADER')] = $this->setFileHeader('dashboard.controller', 'dashboard'); } else { // DASHBOARDVIEW - $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('DASHBOARDVIEW')] = $this->dynamicDashboard; } @@ -1737,25 +1566,22 @@ class Infusion extends Interpretation $target = array('admin' => 'import'); $this->buildDynamique($target, 'import'); // IMPORT_EXT_METHOD <<>> - $this->fileContentDynamic['import'][$this->hhh - . 'IMPORT_EXT_METHOD' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic['import'][Placefix::_h('IMPORT_EXT_METHOD')] + = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( ComponentbuilderHelper::getDynamicScripts('ext'), - $this->placeholders + CFactory::_('Placeholder')->active ); // IMPORT_SETDATA_METHOD <<>> - $this->fileContentDynamic['import'][$this->hhh - . 'IMPORT_SETDATA_METHOD' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic['import'][Placefix::_h('IMPORT_SETDATA_METHOD')] + = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( ComponentbuilderHelper::getDynamicScripts('setdata'), - $this->placeholders + CFactory::_('Placeholder')->active ); // IMPORT_SAVE_METHOD <<>> - $this->fileContentDynamic['import'][$this->hhh - . 'IMPORT_SAVE_METHOD' . $this->hhh] - = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->fileContentDynamic['import'][Placefix::_h('IMPORT_SAVE_METHOD')] + = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( ComponentbuilderHelper::getDynamicScripts('save'), - $this->placeholders + CFactory::_('Placeholder')->active ); } @@ -1766,19 +1592,15 @@ class Infusion extends Interpretation $target = array('admin' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax'][$this->hhh - . 'REGISTER_AJAX_TASK' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('REGISTER_AJAX_TASK')] = $this->setRegisterAjaxTask('admin'); - $this->fileContentDynamic['ajax'][$this->hhh - . 'AJAX_INPUT_RETURN' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_INPUT_RETURN')] = $this->setAjaxInputReturn('admin'); // set the model header - $this->fileContentDynamic['ajax'][$this->hhh - . 'AJAX_ADMIN_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_ADMIN_MODEL_HEADER')] = $this->setFileHeader('ajax.admin.model', 'ajax'); // set the module - $this->fileContentDynamic['ajax'][$this->hhh - . 'AJAX_MODEL_METHODS' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_MODEL_METHODS')] = $this->setAjaxModelMethods('admin'); } @@ -1789,19 +1611,15 @@ class Infusion extends Interpretation $target = array('site' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax'][$this->hhh - . 'REGISTER_SITE_AJAX_TASK' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('REGISTER_SITE_AJAX_TASK')] = $this->setRegisterAjaxTask('site'); - $this->fileContentDynamic['ajax'][$this->hhh - . 'AJAX_SITE_INPUT_RETURN' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_INPUT_RETURN')] = $this->setAjaxInputReturn('site'); // set the model header - $this->fileContentDynamic['ajax'][$this->hhh - . 'AJAX_SITE_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_MODEL_HEADER')] = $this->setFileHeader('ajax.site.model', 'ajax'); // set the module - $this->fileContentDynamic['ajax'][$this->hhh - . 'AJAX_SITE_MODEL_METHODS' . $this->hhh] + $this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_MODEL_METHODS')] = $this->setAjaxModelMethods('site'); } @@ -1815,12 +1633,10 @@ class Infusion extends Interpretation $target = array('admin' => 'a_rule_zi'); $this->buildDynamique($target, 'rule', $rule); // set the JFormRule Name - $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh - . 'Name' . $this->hhh] + $this->fileContentDynamic['a_rule_zi_' . $rule][Placefix::_h('Name')] = ucfirst($rule); // set the JFormRule PHP - $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh - . 'VALIDATION_RULE_METHODS' . $this->hhh] + $this->fileContentDynamic['a_rule_zi_' . $rule][Placefix::_h('VALIDATION_RULE_METHODS')] = PHP_EOL . $_php; } } @@ -1844,11 +1660,11 @@ class Infusion extends Interpretation } // CONFIG_FIELDSETS - $keepLang = $this->lang; - $this->lang = 'admin'; + $keepLang = CFactory::_('Config')->lang_target; + CFactory::_('Config')->lang_target = 'admin'; // run field sets for second time $this->setConfigFieldsets(2); - $this->lang = $keepLang; + CFactory::_('Config')->lang_target = $keepLang; // setup front-views and all needed stuff for the site if (isset($this->componentData->site_views) @@ -1856,53 +1672,51 @@ class Infusion extends Interpretation $this->componentData->site_views )) { - $this->target = 'site'; + CFactory::_('Config')->build_target = 'site'; // start dynamic build foreach ($this->componentData->site_views as $view) { // for list views - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SViews' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SViews')] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'sviews' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sviews')] = $view['settings']->code; // for single views - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SView' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SView')] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'sview' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('sview')] = $view['settings']->code; // set placeholder - $this->placeholders[$this->hhh . 'SView' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SView')] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sview' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('sview')] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SVIEW')] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SView' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SView')] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sview' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('sview')] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SVIEW')] = $view['settings']->CODE; - $this->placeholders[$this->hhh . 'SViews' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SViews')] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sviews' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('sviews')] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('SVIEWS')] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SViews' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SViews')] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sviews' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('sviews')] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('SVIEWS')] = $view['settings']->CODE; + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildSiteViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -1910,165 +1724,145 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; // set license per view if needed $this->setLockLicensePer( - $view['settings']->code, $this->target + $view['settings']->code, CFactory::_('Config')->build_target ); // set the site default view if (isset($view['default_view']) && $view['default_view'] == 1) { - $this->fileContentStatic[$this->hhh - . 'SITE_DEFAULT_VIEW' . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] = $view['settings']->code; } // add site menu if (isset($view['menu']) && $view['menu'] == 1) { // SITE_MENU_XML <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_MENU_XML' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_MENU_XML')] = $this->setCustomViewMenu($view); } // insure the needed route helper is loaded - $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTEHELPER')] .= $this->setRouterHelp( $view['settings']->code, $view['settings']->code, true ); // build route details - $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')] .= $this->routerParseSwitch( $view['settings']->code, $view ); - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] .= $this->routerBuildViews($view['settings']->code); if ($view['settings']->main_get->gettype == 1) { // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('USER_PERMISSION_CHECK_ACCESS')] = $this->setUserPermissionCheckAccess($view, 1); // SITE_BEFORE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_BEFORE_GET_ITEM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEM')] = $this->getCustomScriptBuilder( - $this->target . '_php_before_getitem', + CFactory::_('Config')->build_target . '_php_before_getitem', $view['settings']->code, '', null, true ); // SITE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_GET_ITEM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_ITEM')] = $this->setCustomViewGetItem( $view['settings']->main_get, - $view['settings']->code, $this->_t(2) + $view['settings']->code, Indent::_(2) ); // SITE_AFTER_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_AFTER_GET_ITEM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEM')] = $this->getCustomScriptBuilder( - $this->target . '_php_after_getitem', + CFactory::_('Config')->build_target . '_php_after_getitem', $view['settings']->code, '', null, true ); } elseif ($view['settings']->main_get->gettype == 2) { // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('USER_PERMISSION_CHECK_ACCESS')] = $this->setUserPermissionCheckAccess($view, 2); // SITE_GET_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_GET_LIST_QUERY' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_LIST_QUERY')] = $this->setCustomViewListQuery( $view['settings']->main_get, $view['settings']->code ); // SITE_BEFORE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_BEFORE_GET_ITEMS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEMS')] = $this->getCustomScriptBuilder( - $this->target . '_php_before_getitems', + CFactory::_('Config')->build_target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true ); // SITE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_GET_ITEMS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_ITEMS')] = $this->setCustomViewGetItems( $view['settings']->main_get, $view['settings']->code ); // SITE_AFTER_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_AFTER_GET_ITEMS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEMS')] = $this->getCustomScriptBuilder( - $this->target . '_php_after_getitems', + CFactory::_('Config')->build_target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true ); } // add to lang array - $this->setLangContent( + CFactory::_('Language')->set( 'site', - Config::get('lang_prefix') . '_' . $view['settings']->CODE, + CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE, $view['settings']->name ); - $this->setLangContent( + CFactory::_('Language')->set( 'site', - Config::get('lang_prefix') . '_' . $view['settings']->CODE + CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description ); // SITE_CUSTOM_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_CUSTOM_METHODS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CUSTOM_METHODS')] = $this->setCustomViewCustomItemMethods( $view['settings']->main_get, $view['settings']->code ); - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_CUSTOM_METHODS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CUSTOM_METHODS')] .= $this->setCustomViewCustomMethods( $view, $view['settings']->code ); // SITE_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_DIPLAY_METHOD' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_DIPLAY_METHOD')] = $this->setCustomViewDisplayMethod($view); // set document details $this->setPrepareDocument($view); // SITE_EXTRA_DIPLAY_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_EXTRA_DIPLAY_METHODS' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_EXTRA_DIPLAY_METHODS')] = $this->setCustomViewExtraDisplayMethods($view); // SITE_CODE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_CODE_BODY' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CODE_BODY')] = $this->setCustomViewCodeBody($view); // SITE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_BODY' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BODY')] = $this->setCustomViewBody($view); // setup the templates $this->setCustomViewTemplateBody($view); // set the site form if needed - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_TOP_FORM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_TOP_FORM')] = $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 1 ); - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_BOTTOM_FORM' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BOTTOM_FORM')] = $this->setCustomViewForm( $view['settings']->code, $view['settings']->main_get->gettype, 2 @@ -2084,27 +1878,23 @@ class Infusion extends Interpretation && $view['settings']->php_controller != '//') { // SITE_VIEW_CONTROLLER_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEW_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_CONTROLLER_HEADER')] = $this->setFileHeader( 'site.view.controller', $view['settings']->code ); } // SITE_VIEW_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEW_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_MODEL_HEADER')] = $this->setFileHeader( 'site.view.model', $view['settings']->code ); // SITE_VIEW_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEW_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_HTML_HEADER')] = $this->setFileHeader( 'site.view.html', $view['settings']->code ); // SITE_VIEW_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEW_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_HEADER')] = $this->setFileHeader( 'site.view', $view['settings']->code ); @@ -2118,34 +1908,32 @@ class Infusion extends Interpretation && $view['settings']->php_controller != '//') { // SITE_VIEW_CONTROLLER_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEW_CONTROLLER_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_CONTROLLER_HEADER')] = $this->setFileHeader( 'site.views.controller', $view['settings']->code ); } // SITE_VIEWS_MODEL_HEADER <<>> add the header details for the model - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEWS_MODEL_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_MODEL_HEADER')] = $this->setFileHeader( 'site.views.model', $view['settings']->code ); // SITE_VIEWS_HTML_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEWS_HTML_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_HTML_HEADER')] = $this->setFileHeader( 'site.views.html', $view['settings']->code ); // SITE_VIEWS_HEADER <<>> add the header details for the view - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . 'SITE_VIEWS_HEADER' . $this->hhh] + $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_HEADER')] = $this->setFileHeader( 'site.views', $view['settings']->code ); } + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildSiteViewContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -2153,6 +1941,8 @@ class Infusion extends Interpretation &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; } // setup the layouts @@ -2166,181 +1956,150 @@ class Infusion extends Interpretation // load the site statics if (!$this->removeSiteFolder || !$this->removeSiteEditFolder) { - $this->target = 'site'; + CFactory::_('Config')->build_target = 'site'; // if no default site view was set, the redirect to root if (!isset( - $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] )) { - $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] = ''; } // set site custom script to helper class // SITE_CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[$this->hhh - . 'SITE_CUSTOM_HELPER_SCRIPT' . $this->hhh] - = $this->setPlaceholders( + $this->fileContentStatic[Placefix::_h('SITE_CUSTOM_HELPER_SCRIPT')] + = CFactory::_('Placeholder')->update( $this->customScriptBuilder['component_php_helper_site'], - $this->placeholders + CFactory::_('Placeholder')->active ); // SITE_GLOBAL_EVENT_HELPER - if (!isset($this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' - . $this->hhh])) + if (!isset($this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')])) { - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' - . $this->hhh] = ''; + $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')] = ''; } - if (!isset($this->fileContentStatic[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh])) + if (!isset($this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')])) { - $this->fileContentStatic[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = ''; + $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] = ''; } // now load the data for the global event if needed if ($this->componentData->add_site_event == 1) { - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')] .= PHP_EOL . PHP_EOL . '// Trigger the Global Site Event'; - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' - . $this->hhh] - .= PHP_EOL . $this->fileContentStatic[$this->hhh - . 'Component' . $this->hhh] + $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')] + .= PHP_EOL . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::globalEvent($document);'; // SITE_GLOBAL_EVENT_HELPER - $this->fileContentStatic[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $this->fileContentStatic[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) + $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[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) . '**/'; - $this->fileContentStatic[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) + $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[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) . '{'; - $this->fileContentStatic[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->setPlaceholders( + $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( $this->customScriptBuilder['component_php_site_event'], - $this->placeholders + CFactory::_('Placeholder')->active ); - $this->fileContentStatic[$this->hhh - . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] - .= PHP_EOL . $this->_t(1) . '}'; + $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] + .= PHP_EOL . Indent::_(1) . '}'; } } // PREINSTALLSCRIPT - $this->fileContentStatic[$this->hhh . 'PREINSTALLSCRIPT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('PREINSTALLSCRIPT')] = $this->getCustomScriptBuilder( 'php_preflight', 'install', PHP_EOL, null, true ); // PREUPDATESCRIPT - $this->fileContentStatic[$this->hhh . 'PREUPDATESCRIPT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('PREUPDATESCRIPT')] = $this->getCustomScriptBuilder( 'php_preflight', 'update', PHP_EOL, null, true ); // POSTINSTALLSCRIPT - $this->fileContentStatic[$this->hhh . 'POSTINSTALLSCRIPT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('POSTINSTALLSCRIPT')] = $this->setPostInstallScript(); // POSTUPDATESCRIPT - $this->fileContentStatic[$this->hhh . 'POSTUPDATESCRIPT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('POSTUPDATESCRIPT')] = $this->setPostUpdateScript(); // UNINSTALLSCRIPT - $this->fileContentStatic[$this->hhh . 'UNINSTALLSCRIPT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('UNINSTALLSCRIPT')] = $this->setUninstallScript(); // MOVEFOLDERSSCRIPT - $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSSCRIPT' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('MOVEFOLDERSSCRIPT')] = $this->setMoveFolderScript(); // MOVEFOLDERSMETHOD - $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSMETHOD' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('MOVEFOLDERSMETHOD')] = $this->setMoveFolderMethod(); // HELPER_UIKIT - $this->fileContentStatic[$this->hhh . 'HELPER_UIKIT' . $this->hhh] + $this->fileContentStatic[Placefix::_h('HELPER_UIKIT')] = $this->setUikitHelperMethods(); // CONFIG_FIELDSETS - $this->fileContentStatic[$this->hhh . 'CONFIG_FIELDSETS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('CONFIG_FIELDSETS')] = implode(PHP_EOL, $this->configFieldSets); // check if this has been set if (!isset( - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] ) || !StringHelper::check( - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] )) { - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] = 0; } else { - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' - . $this->hhh] - = '(' . $this->fileContentStatic[$this->hhh - . 'ROUTER_BUILD_VIEWS' . $this->hhh] . ')'; + $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] + = '(' . $this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')] . ')'; } // README if ($this->componentData->addreadme) { - $this->fileContentStatic[$this->hhh . 'README' . $this->hhh] + $this->fileContentStatic[Placefix::_h('README')] = $this->componentData->readme; } // remove all the power placeholders - $this->fileContentStatic[$this->hhh . 'ADMIN_POWER_HELPER' . $this->hhh] = ''; - $this->fileContentStatic[$this->hhh . 'SITE_POWER_HELPER' . $this->hhh] = ''; - $this->fileContentStatic[$this->hhh . 'CUSTOM_POWER_AUTOLOADER' . $this->hhh] = ''; + $this->fileContentStatic[Placefix::_h('ADMIN_POWER_HELPER')] = ''; + $this->fileContentStatic[Placefix::_h('SITE_POWER_HELPER')] = ''; + $this->fileContentStatic[Placefix::_h('CUSTOM_POWER_AUTOLOADER')] = ''; // infuse powers data if set - if (ArrayHelper::check($this->powers)) + if (ArrayHelper::check(CFactory::_('Power')->active)) { // start the autoloader $autoloader = array(); - foreach ($this->powers as $power) + foreach (CFactory::_('Power')->active as $power) { if (ObjectHelper::check($power)) { // Trigger Event: jcb_ce_onBeforeInfusePowerData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeInfusePowerData', array(&$this->componentContext, &$power, &$this) ); // POWERCODE - $this->fileContentDynamic[$power->key][$this->hhh - . 'POWERCODE' . $this->hhh] + $this->fileContentDynamic[$power->key][Placefix::_h('POWERCODE')] = $this->getPowerCode($power); // build the autoloader $autoloader[implode('.', $power->_namespace_prefix)] = $power->_namespace_prefix; // Trigger Event: jcb_ce_onAfterInfusePowerData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterInfusePowerData', array(&$this->componentContext, &$power, &$this) ); @@ -2350,9 +2109,9 @@ class Infusion extends Interpretation $this->setPowersAutoloader($autoloader, (!$this->removeSiteFolder || !$this->removeSiteEditFolder)); } // tweak system to set stuff to the module domain - $_backup_target = $this->target; - $_backup_lang = $this->lang; - $_backup_langPrefix = Config::get('lang_prefix'); + $_backup_target = CFactory::_('Config')->build_target; + $_backup_lang = CFactory::_('Config')->lang_target; + $_backup_langPrefix = CFactory::_('Config')->lang_prefix; // infuse module data if set if (ArrayHelper::check($this->joomlaModules)) { @@ -2361,42 +2120,37 @@ class Infusion extends Interpretation if (ObjectHelper::check($module)) { // Trigger Event: jcb_ce_onBeforeInfuseModuleData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeInfuseModuleData', array(&$this->componentContext, &$module, &$this) ); - $this->target = $module->key; - $this->lang = $module->key; + CFactory::_('Config')->build_target = $module->key; + CFactory::_('Config')->lang_target = $module->key; $this->langPrefix = $module->lang_prefix; - Config::set('lang_prefix', $module->lang_prefix); + CFactory::_('Config')->set('lang_prefix', $module->lang_prefix); // MODCODE - $this->fileContentDynamic[$module->key][$this->hhh - . 'MODCODE' . $this->hhh] + $this->fileContentDynamic[$module->key][Placefix::_h('MODCODE')] = $this->getModCode($module); // DYNAMICGET - $this->fileContentDynamic[$module->key][$this->hhh - . 'DYNAMICGETS' . $this->hhh] + $this->fileContentDynamic[$module->key][Placefix::_h('DYNAMICGETS')] = $this->setCustomViewCustomMethods( $module, $module->key ); // HELPERCODE if ($module->add_class_helper >= 1) { - $this->fileContentDynamic[$module->key][$this->hhh - . 'HELPERCODE' . $this->hhh] + $this->fileContentDynamic[$module->key][Placefix::_h('HELPERCODE')] = $this->getModHelperCode($module); } // MODDEFAULT - $this->fileContentDynamic[$module->key][$this->hhh - . 'MODDEFAULT' . $this->hhh] + $this->fileContentDynamic[$module->key][Placefix::_h('MODDEFAULT')] = $this->getModDefault($module, $module->key); // only add install script if needed if ($module->add_install_script) { // INSTALLCLASS - $this->fileContentDynamic[$module->key][$this->hhh - . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($module))->get(); + $this->fileContentDynamic[$module->key][Placefix::_h('INSTALLCLASS')] + = CFactory::_J('Extension.InstallScript')->get($module); } // FIELDSET if (isset($module->form_files) @@ -2411,9 +2165,8 @@ class Infusion extends Interpretation foreach ($fieldsets as $fieldset => $fields) { // FIELDSET_ . $file.$field_name.$fieldset - $this->fileContentDynamic[$module->key][$this->hhh - . 'FIELDSET_' . $file . $field_name - . $fieldset . $this->hhh] + $this->fileContentDynamic[$module->key][Placefix::_h('FIELDSET_' + . $file . $field_name . $fieldset)] = $this->getExtensionFieldsetXML( $module, $fields ); @@ -2422,11 +2175,10 @@ class Infusion extends Interpretation } } // MAINXML - $this->fileContentDynamic[$module->key][$this->hhh - . 'MAINXML' . $this->hhh] + $this->fileContentDynamic[$module->key][Placefix::_h('MAINXML')] = $this->getModuleMainXML($module); // Trigger Event: jcb_ce_onAfterInfuseModuleData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterInfuseModuleData', array(&$this->componentContext, &$module, &$this) ); @@ -2441,25 +2193,23 @@ class Infusion extends Interpretation if (ObjectHelper::check($plugin)) { // Trigger Event: jcb_ce_onBeforeInfusePluginData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeInfusePluginData', array(&$this->componentContext, &$plugin, &$this) ); - $this->target = $plugin->key; - $this->lang = $plugin->key; + CFactory::_('Config')->build_target = $plugin->key; + CFactory::_('Config')->lang_target = $plugin->key; $this->langPrefix = $plugin->lang_prefix; - Config::set('lang_prefix', $plugin->lang_prefix); + CFactory::_('Config')->set('lang_prefix', $plugin->lang_prefix); // MAINCLASS - $this->fileContentDynamic[$plugin->key][$this->hhh - . 'MAINCLASS' . $this->hhh] + $this->fileContentDynamic[$plugin->key][Placefix::_h('MAINCLASS')] = $this->getPluginMainClass($plugin); // only add install script if needed if ($plugin->add_install_script) { // INSTALLCLASS - $this->fileContentDynamic[$plugin->key][$this->hhh - . 'INSTALLCLASS' . $this->hhh] - = (new InstallScript($plugin))->get(); + $this->fileContentDynamic[$plugin->key][Placefix::_h('INSTALLCLASS')] + = CFactory::_J('Extension.InstallScript')->get($plugin); } // FIELDSET if (isset($plugin->form_files) @@ -2474,9 +2224,8 @@ class Infusion extends Interpretation foreach ($fieldsets as $fieldset => $fields) { // FIELDSET_ . $file.$field_name.$fieldset - $this->fileContentDynamic[$plugin->key][$this->hhh - . 'FIELDSET_' . $file . $field_name - . $fieldset . $this->hhh] + $this->fileContentDynamic[$plugin->key][Placefix::_h( + 'FIELDSET_' . $file . $field_name . $fieldset)] = $this->getExtensionFieldsetXML( $plugin, $fields ); @@ -2485,11 +2234,10 @@ class Infusion extends Interpretation } } // MAINXML - $this->fileContentDynamic[$plugin->key][$this->hhh - . 'MAINXML' . $this->hhh] + $this->fileContentDynamic[$plugin->key][Placefix::_h('MAINXML')] = $this->getPluginMainXML($plugin); // Trigger Event: jcb_ce_onAfterInfusePluginData - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterInfusePluginData', array(&$this->componentContext, &$plugin, &$this) ); @@ -2497,17 +2245,21 @@ class Infusion extends Interpretation } } // rest globals - $this->target = $_backup_target; - $this->lang = $_backup_lang; + CFactory::_('Config')->build_target = $_backup_target; + CFactory::_('Config')->lang_target = $_backup_lang; $this->langPrefix = $_backup_langPrefix; - Config::set('lang_prefix', $_backup_langPrefix); + CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); + // for plugin event TODO change event api signatures + $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFilesContent - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onAfterBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh) ); + // for plugin event TODO change event api signatures + CFactory::_('Placeholder')->active = $this->placeholders; return true; } @@ -2525,7 +2277,7 @@ class Infusion extends Interpretation protected function setViewPlaceholders(&$view) { // just to be safe, lets clear previous view placeholders - $this->clearFromPlaceHolders('view'); + CFactory::_('Placeholder')->clearType('view'); // VIEW <<>> if (isset($view->name_single) && $view->name_single != 'null') @@ -2540,17 +2292,17 @@ class Infusion extends Interpretation ); // set some place holder for the views - $this->placeholders[$this->hhh . 'view' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('view')] = $nameSingleCode; - $this->placeholders[$this->hhh . 'View' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('View')] = $name_single_first_uppercase; - $this->placeholders[$this->hhh . 'VIEW' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('VIEW')] = $name_single_uppercase; - $this->placeholders[$this->bbb . 'view' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('view')] = $nameSingleCode; - $this->placeholders[$this->bbb . 'View' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('View')] = $name_single_first_uppercase; - $this->placeholders[$this->bbb . 'VIEW' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('VIEW')] = $name_single_uppercase; } @@ -2566,43 +2318,37 @@ class Infusion extends Interpretation ); // set some place holder for the views - $this->placeholders[$this->hhh . 'views' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('views')] = $nameListCode; - $this->placeholders[$this->hhh . 'Views' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('Views')] = $name_list_first_uppercase; - $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] + CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')] = $name_list_uppercase; - $this->placeholders[$this->bbb . 'views' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('views')] = $nameListCode; - $this->placeholders[$this->bbb . 'Views' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('Views')] = $name_list_first_uppercase; - $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] + CFactory::_('Placeholder')->active[Placefix::_('VIEWS')] = $name_list_uppercase; } // view <<>> if (isset($nameSingleCode)) { - $this->fileContentDynamic[$nameSingleCode][$this->hhh . 'view' - . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('view')] = $nameSingleCode; - $this->fileContentDynamic[$nameSingleCode][$this->hhh . 'VIEW' - . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEW')] = $name_single_uppercase; - $this->fileContentDynamic[$nameSingleCode][$this->hhh . 'View' - . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('View')] = $name_single_first_uppercase; if (isset($nameListCode)) { - $this->fileContentDynamic[$nameListCode][$this->hhh . 'view' - . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('view')] = $nameSingleCode; - $this->fileContentDynamic[$nameListCode][$this->hhh . 'VIEW' - . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEW')] = $name_single_uppercase; - $this->fileContentDynamic[$nameListCode][$this->hhh . 'View' - . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('View')] = $name_single_first_uppercase; } } @@ -2610,29 +2356,20 @@ class Infusion extends Interpretation // views <<>> if (isset($nameListCode)) { - $this->fileContentDynamic[$nameListCode][$this->hhh . 'views' - . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('views')] = $nameListCode; - $this->fileContentDynamic[$nameListCode][$this->hhh . 'VIEWS' - . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS')] = $name_list_uppercase; - $this->fileContentDynamic[$nameListCode][$this->hhh . 'Views' - . $this->hhh] + $this->fileContentDynamic[$nameListCode][Placefix::_h('Views')] = $name_list_first_uppercase; if (isset($nameSingleCode)) { - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'views' - . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('views')] = $nameListCode; - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'VIEWS' - . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWS')] = $name_list_uppercase; - $this->fileContentDynamic[$nameSingleCode][$this->hhh - . 'Views' - . $this->hhh] + $this->fileContentDynamic[$nameSingleCode][Placefix::_h('Views')] = $name_list_first_uppercase; } } @@ -2653,20 +2390,20 @@ class Infusion extends Interpretation if ($this->setLangAdmin()) { $values[] = array_values( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['admin'] ); $mainLangLoader['admin'] = count( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['admin'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['admin'] ); } // check the admin system lang is set if ($this->setLangAdminSys()) { $values[] = array_values( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['adminsys'] ); $mainLangLoader['adminsys'] = count( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['adminsys'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['adminsys'] ); } // check the site lang is set @@ -2674,10 +2411,10 @@ class Infusion extends Interpretation && $this->setLangSite()) { $values[] = array_values( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['site'] ); $mainLangLoader['site'] = count( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['site'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['site'] ); } // check the site system lang is set @@ -2685,27 +2422,29 @@ class Infusion extends Interpretation && $this->setLangSiteSys()) { $values[] = array_values( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['sitesys'] ); $mainLangLoader['sitesys'] = count( - $this->languages['components'][Config::get('lang_tag', 'en-GB')]['sitesys'] + $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['sitesys'] ); } $values = array_unique(ArrayHelper::merge($values)); // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); // update insert the current lang in to DB - $this->setLangPlaceholders($values, Config::get('component_id')); + $this->setLangPlaceholders($values, CFactory::_('Config')->component_id); // remove old unused language strings - $this->purgeLanuageStrings($values, Config::get('component_id')); + $this->purgeLanuageStrings($values, CFactory::_('Config')->component_id); // path to INI file $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles - $this->triggerEvent( + CFactory::_J('Event')->trigger( 'jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages['components'], &$this->langTag) ); + // for plugin event TODO change event api signatures + CFactory::_('Config')->lang_tag = $this->langTag; // now we insert the values into the files if (ArrayHelper::check($this->languages['components'])) { @@ -2734,7 +2473,7 @@ class Infusion extends Interpretation $t = '.sys'; } // build the file name - $file_name = $tag . '.com_' . Config::get('component_code_name') . $t + $file_name = $tag . '.com_' . CFactory::_('Config')->component_code_name . $t . '.ini'; // check if language should be added if ($this->shouldLanguageBeAdded( @@ -2789,25 +2528,25 @@ class Infusion extends Interpretation if (isset($langXML['admin']) && ArrayHelper::check($langXML['admin'])) { - $replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] - = implode(PHP_EOL . $this->_t(3), $langXML['admin']); + $replace[Placefix::_h('ADMIN_LANGUAGES')] + = implode(PHP_EOL . Indent::_(3), $langXML['admin']); } if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && isset($langXML['site']) && ArrayHelper::check($langXML['site'])) { - $replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] - = implode(PHP_EOL . $this->_t(2), $langXML['site']); + $replace[Placefix::_h('SITE_LANGUAGES')] + = implode(PHP_EOL . Indent::_(2), $langXML['site']); } // build xml path - $xmlPath = $this->componentPath . '/' . Config::get('component_code_name') + $xmlPath = $this->componentPath . '/' . CFactory::_('Config')->component_code_name . '.xml'; // get the content in xml $componentXML = FileHelper::getContent( $xmlPath ); // update the xml content - $componentXML = $this->setPlaceholders($componentXML, $replace); + $componentXML = CFactory::_('Placeholder')->update($componentXML, $replace); // store the values back to xml $this->writeFile($xmlPath, $componentXML); } diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index a4cb1bba7..895288ce3 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -3230,6 +3230,8 @@ COM_COMPONENTBUILDER_CONDITIONS="Conditions" COM_COMPONENTBUILDER_CONFIG_ACTIVE="Active" COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of your components" COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_LABEL="Add Menu Prefix" +COM_COMPONENTBUILDER_CONFIG_ADD_PLACEHOLDERS_DESCRIPTION="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code." +COM_COMPONENTBUILDER_CONFIG_ADD_PLACEHOLDERS_LABEL="Add Custom Code Placeholders" COM_COMPONENTBUILDER_CONFIG_ADMIN_CUSTOM_TABS_TABS="Admin Custom Tabs (tabs)" COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_ADDFIELDS="Admin Fields (addfields)" COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS="Admin Fields Conditions (addconditions)" @@ -3341,12 +3343,12 @@ COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_LABEL="Compiler Folder Path" COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_MESSAGE="Error! Please add some text here." COM_COMPONENTBUILDER_CONFIG_COMPILER_PLUGIN_DESCRIPTION="Select the plugin you would like to use in JCB's compiler" COM_COMPONENTBUILDER_CONFIG_COMPILER_PLUGIN_LABEL="Activate Compiler Plugins" -COM_COMPONENTBUILDER_CONFIG_COMPONENT="Component" COM_COMPONENTBUILDER_CONFIG_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS="Component Admin Views (addadmin_views)" COM_COMPONENTBUILDER_CONFIG_COMPONENT_CUSTOM_ADMIN_MENUS_ADDCUSTOMMENUS="Component Custom Admin Menus (addcustommenus)" COM_COMPONENTBUILDER_CONFIG_COMPONENT_CUSTOM_ADMIN_VIEWS_ADDCUSTOM_ADMIN_VIEWS="Component Custom Admin Views (addcustom_admin_views)" COM_COMPONENTBUILDER_CONFIG_COMPONENT_DASHBOARD_DASHBOARD_TAB="Component Dashboard (dashboard_tab)" -COM_COMPONENTBUILDER_CONFIG_COMPONENT_LABEL="Component" +COM_COMPONENTBUILDER_CONFIG_COMPONENT_ID="Component Id" +COM_COMPONENTBUILDER_CONFIG_COMPONENT_ID_LABEL="Component" COM_COMPONENTBUILDER_CONFIG_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS="Component Site Views (addsite_views)" COM_COMPONENTBUILDER_CONFIG_COMPONENT_UPDATES_VERSION_UPDATE="Component Updates (version_update)" COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_DESCRIPTION="Here you can set the path to where all components are backed up to." @@ -3604,8 +3606,6 @@ COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_LABEL="Package Name Placeho COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_DESCRIPTION="Select percentage any language should be translated before the system should add the language to the component during compilation." COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_LABEL="Add Language if %? ready." COM_COMPONENTBUILDER_CONFIG_PHP_MAIL="PHP Mail" -COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_DESCRIPTION="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code." -COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_LABEL="Add Custom Code Placeholders" COM_COMPONENTBUILDER_CONFIG_REMOTE_SERVER="Remote Server" COM_COMPONENTBUILDER_CONFIG_REPEATABLETABLE_JOOMLA="Repeatable-table (joomla)" COM_COMPONENTBUILDER_CONFIG_REPEATABLE_JOOMLA="Repeatable (Joomla)" @@ -5597,8 +5597,13 @@ COM_COMPONENTBUILDER_HI="Hi" COM_COMPONENTBUILDER_HIDE_ONLY="Hide Only" COM_COMPONENTBUILDER_HIDE_TOGGLE="Hide Toggle" COM_COMPONENTBUILDER_HOW_TO_GET_A_S_FREE_KEYSA_FROM_VDM="How to get
    free keys from VDM." +COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="

    External Code Error

    " +COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="

    External Code Notice

    " +COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE="

    External Code Warning

    " COM_COMPONENTBUILDER_HTHREEPLACEHOLDER_REMOVEDHTHREEPBTHISB_CUSTOM_CODE_CAN_ONLY_BE_USED_IN_BOTHERB_CUSTOM_CODE_NOT_IN_IT_SELF_SINCE_THAT_WILL_CAUSE_A_INFINITE_LOOP_IN_THE_COMPILERP="

    Placeholder Removed!

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

    " COM_COMPONENTBUILDER_HTHREESHTHREEPCUSTOM_CODE_CAN_ONLY_BE_USED_IN_OTHER_CUSTOM_CODE_IF_SET_AS_BJCB_MANUALB_YOU_CAN_NOT_ADD_THEM_TO_EMHASH_AUTOMATIONEM_CODE_AT_THIS_POINTP="

    %s

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

    " +COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s namespace error (%s)

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

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

    " +COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s namespace error (%s)

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

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

    " COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP="

    Curl Not Found!

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

    " COM_COMPONENTBUILDER_HTWODATA_IS_CORRUPTHTWOTHIS_COULD_BE_DUE_TO_BKEY_ERRORB_OR_BROKEN_PACKAGE="

    Data is corrupt!

    This could be due to key error, or broken package!" COM_COMPONENTBUILDER_HTWODATA_IS_CORRUPTHTWOTHIS_COULD_BE_DUE_TO_BROKEN_PACKAGE="

    Data is corrupt!

    This could be due to broken package!" @@ -5607,6 +5612,7 @@ COM_COMPONENTBUILDER_HTWOWE_COULD_NOT_OPEN_THE_PACKAGEHTWOTHIS_COULD_BE_DUE_TO_T COM_COMPONENTBUILDER_IAUTHORI_BSB="Author: %s" COM_COMPONENTBUILDER_ICOMPANYI_BSB="Company: %s" COM_COMPONENTBUILDER_ICON="Icon" +COM_COMPONENTBUILDER_ID_MISMATCH_WAS_DETECTED_WITH_THE_SSSS_GUI_CODE_FIELD_SO_THE_PLACEHOLDER_WAS_NOT_SET="ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set." COM_COMPONENTBUILDER_IEMAILI_BSB="Email: %s" COM_COMPONENTBUILDER_IMPORT_BY_GUID_ONLY="Import by GUID only!" COM_COMPONENTBUILDER_IMPORT_CONTINUE="Continue" @@ -8108,12 +8114,14 @@ 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." COM_COMPONENTBUILDER_POWER_VERSION_LABEL="Version" COM_COMPONENTBUILDER_POWER_YES="Yes" +COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP="

    Power guid:%s not found!

    " COM_COMPONENTBUILDER_PROPERTIES="Properties" COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties
    Here you can set the properties for this field." COM_COMPONENTBUILDER_PROPERTY="Property" COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER="Property already selected, try another." COM_COMPONENTBUILDER_PROPERTY_NAME="Property Name" COM_COMPONENTBUILDER_PROPERTY_VALUE="Property Value" +COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDING_FILE_NAME_IN_THE_NAMESPACE_IS_BSB_THIS_IS_BAD_CONVENTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPA_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s naming mismatch error (%s)

    The %s name is %s and the ending file name in the namespace is %s. This is bad convention, please see psr-4 for more info.

    Click here to fix this issue.

    " COM_COMPONENTBUILDER_PUBLIC_ACCESS="Public Access" COM_COMPONENTBUILDER_PUBLISHED="Published" COM_COMPONENTBUILDER_PUBLISHING="Publishing" @@ -8967,6 +8975,8 @@ COM_COMPONENTBUILDER_S_BEING_IMPORTED="%s Being Imported" COM_COMPONENTBUILDER_S_NOT_LINKED="%s Not Linked" COM_COMPONENTBUILDER_S_PLEASE_WAIT="%s, please wait!" COM_COMPONENTBUILDER_S_S_NUMBER_BSB_COULD_NOT_BE_DOWNLOADED_SUCCESSFULLY_TO_THIS_JOOMLA_INSTALL="%s (%s) number %s could not be downloaded successfully to this Joomla Install!" +COM_COMPONENTBUILDER_S_WE_DETECTED_A_CHANGE_IN_BEXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_CHANGE_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected a change in EXTERNALCODE, but you do not have permission to allow this change so %s was removed from the compilation. Please contact your system administrator for more info!
    (admin access required)" +COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_NEW_CODESTRING_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOU_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected NEW EXTERNALCODE, but you do not have permission to allow this new code/string so %s was removed from the compilation. Please contact you system administrator for more info!
    (admin access required)" COM_COMPONENTBUILDER_TAB="Tab" COM_COMPONENTBUILDER_TABLE_BSB_NOT_FOUND_IN_THE_LOCAL_DATABASE_SO_ITS_VALUES_COULD_NOT_BE_IMPORTED_PLEASE_UPDATE_YOUR_JCB_INSTALL_AND_TRY_AGAIN="Table %s not found in the local database so its values could not be imported, please update your JCB install and try again." COM_COMPONENTBUILDER_TABLE_BSB_NOT_FOUND_IN_THE_LOCAL_DATABASE_SO_ITS_VALUES_COULD_NOT_BE_IMPORTED_THE_WHOLE_POWERS_FEATURE_IS_ONLY_AVAILABLE_TO_A_HREFSPRO_MEMBERSA_AT_THIS_TIME="Table %s not found in the local database so its values could not be imported. The whole powers feature is only available to PRO Members at this time." @@ -9110,12 +9120,17 @@ COM_COMPONENTBUILDER_THE_BNONE_DBB_OPTION_WILL_REMOVE_THIS_FIELD_FROM_BEING_SAVE COM_COMPONENTBUILDER_THE_BONLY_IN_ADMIN_LIST_VIEWB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_ADMIN_LIST_VIEW_NOT_TO_ANY_LINKED_VIEWS="The Only in Admin List View option will only Add this field to the admin list view, not to any linked views." COM_COMPONENTBUILDER_THE_BONLY_IN_LINKED_LIST_VIEWSB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_LINKED_LIST_VIEW_IF_THIS_VIEW_GETS_LINKED_TO_OTHER_VIEW_NOT_TO_THIS_ADMIN_LIST_VIEW="The Only in Linked List Views option will only Add this field to the linked list view, if this view gets linked to other view, not to this admin list view." COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The phpseclib\NET\SFTP library\class is not available! This library\class should have been added to your libraries/vdm_io/vendor folder. Please contact your system administrator for more info" +COM_COMPONENTBUILDER_THE_BSB_CUT_SEQUENCE_FAILED_ON_THE_RETURNED_EXTERNAL_CODESTRING_AS_MORE_LINES_HAS_TO_BE_CUT_THEN_WAS_FOUND_IN_THE_CODESTRING_WE_HAVE_COMPLETELY_REMOVED_THE_CODE_PLEASE_CHECK_THIS_CODESTRING="The %s cut sequence failed on the returned external code/string as more lines has to be cut then was found in the code/string. We have completely removed the code. Please check this code/string!" COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The %s file could not be moved to %s path on %s server." COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The %s file could not be moved to %s server." +COM_COMPONENTBUILDER_THE_BSB_IS_NOT_A_VALID_URLPATH="The %s is not a valid url/path!" COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The %s library\class is not available! This library\class should have been added to your libraries/phpseclib/vendor folder. Please contact your system administrator for more info!" COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="The %s library can not be deleted, or things will break." +COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING="The %s returned an invalid string!" COM_COMPONENTBUILDER_THE_BSHOW_IN_ALL_LIST_VIEWSB_OPTION_WILL_ADD_THIS_FIELD_TO_ALL_LIST_VIEWS_ADMIN_AMP_LINKED="The Show in All List Views option will Add this field to all list views, admin & linked." COM_COMPONENTBUILDER_THE_BSINGLE_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_JUST_ONE_VALUE_IN_THIS_FILTERFIELD="The single filter selection option allows the user to select just one value in this filter/field." +COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been added for the first time. Please investigate to ensure the correct code/string was used! Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention! Do not ignore this warning as it will only show once." +COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been changed since the last compilation. Please investigate to ensure the changes are safe! Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention! Do not ignore this warning as it will only show once." COM_COMPONENTBUILDER_THE_COMPONENT="The Component" COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views" COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config" diff --git a/admin/models/compiler.php b/admin/models/compiler.php index ff338e856..d8b405e61 100644 --- a/admin/models/compiler.php +++ b/admin/models/compiler.php @@ -202,18 +202,10 @@ class ComponentbuilderModelCompiler extends ListModel return true; } - public function builder($version, $id, $backup, $repo, $addPlaceholders, $addPowers, $debugLinenr, $minify) + public function builder() { - $set['version'] = $version; - $set['component'] = $id; - $set['backup'] = $backup; - $set['repository'] = $repo; - $set['placeholders'] = $addPlaceholders; - $set['powers'] = $addPowers; - $set['debuglinenr'] = $debugLinenr; - $set['minify'] = $minify; // run compiler - $this->compiler = new Compiler($set); + $this->compiler = new Compiler(); if($this->compiler) { return true; diff --git a/admin/models/powers.php b/admin/models/powers.php index 55c580c18..9a3f0a281 100644 --- a/admin/models/powers.php +++ b/admin/models/powers.php @@ -158,6 +158,8 @@ class ComponentbuilderModelPowers extends ListModel continue; } + // remove dots + $item->namespace = str_replace('.','\\', $item->namespace); } } diff --git a/admin/views/compiler/tmpl/default.php b/admin/views/compiler/tmpl/default.php index 9618879fe..24a3811f9 100644 --- a/admin/views/compiler/tmpl/default.php +++ b/admin/views/compiler/tmpl/default.php @@ -33,7 +33,7 @@ Joomla.submitbutton = function(task, key) if (task == ''){ return false; } else { - var component = jQuery('#component').val(); + var component = jQuery('#component_id').val(); var isValid = true; if(component == '' && task == 'compiler.compiler'){ @@ -56,7 +56,7 @@ Joomla.submitbutton = function(task, key) // some ui movements if (task == 'compiler.compiler'){ // get the component name - let component_name = jQuery("#component option:selected").text(); + let component_name = jQuery("#component_id option:selected").text(); // set the component name jQuery(".component-name").text(component_name); // wait a little since to much is happening... @@ -189,9 +189,9 @@ jQuery('
    ') // token var token = ''; var all_is_good = ''; -jQuery('#compilerForm').on('change', '#component',function (e) +jQuery('#compilerForm').on('change', '#component_id',function (e) { - var component = jQuery('#component').val(); + var component = jQuery('#component_id').val(); if(component == "") { jQuery('#component-details').html(""); jQuery("#noticeboard").show(); diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 689e0509d..970ebbf4c 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -133,7 +133,7 @@ class ComponentbuilderViewCompiler extends HtmlView // placeholders attributes $attributes = array( 'type' => 'radio', - 'name' => 'placeholders', + 'name' => 'add_placeholders', 'label' => 'COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE', @@ -148,7 +148,7 @@ class ComponentbuilderViewCompiler extends HtmlView // debuglinenr attributes $attributes = array( 'type' => 'radio', - 'name' => 'debuglinenr', + 'name' => 'debug_line_nr', 'label' => 'COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING', @@ -190,7 +190,7 @@ class ComponentbuilderViewCompiler extends HtmlView // component attributes $attributes = array( 'type' => 'list', - 'name' => 'component', + 'name' => 'component_id', 'label' => 'COM_COMPONENTBUILDER_COMPONENTS', 'class' => 'list_class', 'description' => 'COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE', diff --git a/admin/views/powers/tmpl/default_body.php b/admin/views/powers/tmpl/default_body.php index 830c1199d..4c886a499 100644 --- a/admin/views/powers/tmpl/default_body.php +++ b/admin/views/powers/tmpl/default_body.php @@ -71,7 +71,7 @@ $edit = "index.php?option=com_componentbuilder&view=powers&task=power.edit"; - escape($item->namespace); ?> + namespace; ?>
    : @@ -80,7 +80,8 @@ $edit = "index.php?option=com_componentbuilder&view=powers&task=power.edit"; escape($item->extends_name); ?> escape($item->extends_name); ?> - + extends === '-1') : ?>
    : + escape($item->extends_custom); ?>
    diff --git a/componentbuilder.xml b/componentbuilder.xml index 4a6de3979..3a5f4b84d 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 21st August, 2022 + 30th August, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php new file mode 100644 index 000000000..f0c1320eb --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php @@ -0,0 +1,144 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Component; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; + + +/** + * Get a Components Global Placeholders + * + * @since 3.2.0 + */ +class Placeholder +{ + /** + * Placeholders + * + * @var arraya + * @since 3.2.0 + **/ + protected $placeholders = null; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected $config; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected $db; + + /** + * Constructor. + * + * @param Config $config The compiler config object. + * @param \JDatabaseDriver $db The Database Driver object. + * + * @since 3.2.0 + **/ + public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * get all System Placeholders + * + * @return array The global placeholders + * + * @since 3.2.0 + */ + public function get() + { + // set only once + if (is_array($this->placeholders)) + { + return $this->placeholders; + } + + // load the config + $config = $this->config; + // load the db + $db = $this->db; + // reset bucket + $bucket = array(); + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.target', 'a.value'))); + // from these tables + $query->from('#__componentbuilder_placeholder AS a'); + // Reset the query using our newly populated query object. + $db->setQuery($query); + + // Load the items + $db->execute(); + if ($db->getNumRows()) + { + $bucket = $db->loadAssocList('target', 'value'); + // open all the code + foreach ($bucket as $key => &$code) + { + $code = base64_decode($code); + } + } + + // set component place holders + $bucket[Placefix::_h('component')] = $config->component_code_name; + $bucket[Placefix::_h('Component')] = StringHelper::safe($config->component_code_name, 'F'); + $bucket[Placefix::_h('COMPONENT')] = StringHelper::safe($config->component_code_name, 'U'); + $bucket[Placefix::_('component')] = $bucket[Placefix::_h('component')]; + $bucket[Placefix::_('Component')] = $bucket[Placefix::_h('Component')]; + $bucket[Placefix::_('COMPONENT')] = $bucket[Placefix::_h('COMPONENT')]; + $bucket[Placefix::_h('LANG_PREFIX')] = $config->lang_prefix; + $bucket[Placefix::_('LANG_PREFIX')] = $bucket[Placefix::_h('LANG_PREFIX')]; + + // get the current components overrides + if (($_placeholders = GetHelper::var( + 'component_placeholders', $config->component_id, + 'joomla_component', 'addplaceholders' + )) !== false + && JsonHelper::check($_placeholders)) + { + $_placeholders = json_decode($_placeholders, true); + if (ArrayHelper::check($_placeholders)) + { + foreach ($_placeholders as $row) + { + $bucket[$row['target']] = $row['value']; + } + } + } + + $this->placeholders = $bucket; + + return $bucket; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/index.html similarity index 100% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/index.html rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/index.html diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php index 96d8cbcbb..933ff6bc4 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -12,167 +12,492 @@ namespace VDM\Joomla\Componentbuilder\Compiler; -use Joomla\Registry\Registry; +use Joomla\Registry\Registry; +use Joomla\CMS\Factory; +use Joomla\Input\Input; use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; /** - * Compiler Configurations Registry + * Compiler Configurations * - * @since 3.1.6 + * @since 3.2.0 */ class Config extends Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable { + /** + * Hold a JInput object for easier access to the input variables. + * + * @var Input + * @since 3.2.0 + */ + protected $input; + /** * The Params * * @var Registry - * @since 3.1.6 + * @since 3.2.0 */ protected Registry $params; /** * Constructor * - * @param array $config The data to bind to the new Config object. - * @param Registry $params The component parameters + * @param Input|null $input Input + * @param Registry|null $params The component parameters * - * @since 3.1.6 + * @throws \Exception + * @since 3.2.0 */ - public function __construct(array $config, ?Registry $params = null) + public function __construct(?Input $input = null, ?Registry $params = null) { - // Set the params + $this->input = $input ?: Factory::getApplication()->input; $this->params = $params ?: Helper::getParams('com_componentbuilder'); - // Instantiate the internal data object. - $this->data = new \stdClass; + // use underscore as the separator + $this->separator = '_'; - // Load the config to the data object - $this->bindData($this->data, $this->modelConfig($config)); + // Instantiate the internal data object. + $this->data = new \stdClass(); } /** - * model the configuration data array + * setting any config value * - * @param array $config The data to bind to the new Config object. + * @param String $key The value's key/path name + * @param mixed $value Optional default value, returned if the internal value is null. * - * @return array - * @since 3.1.6 + * @since 3.2.0 */ - protected function modelConfig(array $config): array + public function __set($key, $value) { - // we do not yet have this set as an option - $config['remove_line_breaks'] - = 2; // 2 is global (use the components value) + $this->set($key, $value); + } - // set the minfy switch of the JavaScript - $config['minify'] = (isset($config['minify']) && $config['minify'] != 2) - ? $config['minify'] : $this->params->get('minify', 0); + /** + * getting any valid value + * + * @param String $key The value's key/path name + * + * @since 3.2.0 + * @throws \InvalidArgumentException If $key is not a valid function name. + */ + public function __get($key) + { + // function name with no underscores + $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $key))); - // set the global language - $config['lang_tag'] = $this->params->get('language', 'en-GB'); + if (($value = $this->get($key, '__N0T_S3T_')) !== '__N0T_S3T_') + { + return $value; + } + elseif (method_exists($this, $method)) + { + $value = $this->{$method}(); - // check if we have Tidy enabled - $config['tidy'] = extension_loaded('Tidy'); + $this->set($key, $value); - // set the field type builder - $config['field_builder_type'] = $this->params->get( - 'compiler_field_builder_type', 2 + return $value; + } + + throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function [%s], or path.', $key, $method)); + } + + /** + * Get a registry value. + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * @param mixed $default Optional default value, returned if the internal value is null. + * + * @return mixed Value of entry or null + * + * @since 3.2.0 + */ + public function get($path, $default = null) + { + // function name with no underscores + $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $path))); + + // check if it has been set + if (($value = parent::get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') + { + return $value; + } + elseif (method_exists($this, $method)) + { + $value = $this->{$method}(); + + $this->set($path, $value); + + return $value; + } + + return $default; + } + + /** + * get posted component id + * + * @return int Component id + * @since 3.2.0 + */ + protected function getComponentid(): int + { + return $this->input->post->get('component_id', 0, 'INT'); + } + + /** + * get components code name + * + * @return string The components code name + * @since 3.2.0 + */ + protected function getComponentcodename(): string + { + // get components code name + return StringHelper::safe(GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'name_code' + )); + } + + /** + * get component context + * + * @return string The component context + * @since 3.2.0 + */ + protected function getComponentcontext(): string + { + // get component context + return $this->component_code_name . '.' . $this->component_id; + } + + /** + * get component code name length + * + * @return int The component code name length + * @since 3.2.0 + */ + protected function getComponentcodenamelength(): int + { + // get component name length + return strlen($this->component_code_name); + } + + /** + * get posted Joomla version + * + * @return int Joomla version code + * @since 3.2.0 + */ + protected function getJoomlaversion(): int + { + return $this->input->post->get('joomla_version', 3, 'INT'); + } + + /** + * get posted Joomla version name + * + * @return string Joomla version code name + * @since 3.2.0 + */ + protected function getJoomlaversionname(): string + { + return StringHelper::safe($this->joomla_version); + } + + /** + * get indentation value + * + * @return string Indentation value + * @since 3.2.0 + */ + protected function getIndentationvalue(): string + { + return "\t"; // TODO add to GUI as an Global Option? + } + + /** + * get posted backup switch + * + * @return int Backup switch number + * @since 3.2.0 + */ + protected function getBackup(): int + { + return $this->input->post->get('backup', 0, 'INT'); + } + + /** + * get posted repository switch + * + * @return int Repository switch number + * @since 3.2.0 + */ + protected function getRepository(): int + { + return $this->input->post->get('repository', 0, 'INT'); + } + + /** + * get posted debuglinenr switch + * + * @return int Debuglinenr switch number + * @since 3.2.0 + */ + protected function getDebuglinenr(): int + { + // get posted value + $value = $this->input->post->get('debug_line_nr', 2, 'INT'); + + // get active value + $add = ($value == 0) ? false : ( + ($value == 1) ? true : ( + ((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'debug_linenr' ) == 1) ? true : false + ) ); - // load the compiler path - $config['compiler_path'] = $this->params->get( + return $add; + } + + /** + * get posted minify switch + * + * @return int Minify switch number + * @since 3.2.0 + */ + protected function getMinify(): int + { + $minify = $this->input->post->get('minify', 2, 'INT'); + + // if value is 2 use global value + $minify = ($minify != 2) ? $minify : $this->params->get('minify', 0); + + return $minify; + } + + /** + * get posted remove line breaks switch + * + * @return bool Remove line breaks switch number + * @since 3.2.0 + */ + protected function getRemovelinebreaks(): bool + { + $value = 2; // 2 is global (use the components value) TODO: get from post + + // get active value + $remove = ($value == 0) ? false : ( + ($value == 1) ? true : ( + ((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'remove_line_breaks' ) == 1) ? true : false + ) + ); + + return $remove; + } + + /** + * get system tidy state + * + * @return bool Tidy is active + * @since 3.2.0 + */ + protected function getTidy(): bool + { + // check if we have Tidy enabled + return \extension_loaded('Tidy'); + } + + /** + * get language tag + * + * @return string The active language tag + * @since 3.2.0 + */ + protected function getLangtag(): string + { + // get the global language + return $this->params->get('language', 'en-GB'); + } + + /** + * get language prefix + * + * @return string The language prefix + * @since 3.2.0 + */ + protected function getLangprefix(): string + { + // get components code name + return 'COM_' . StringHelper::safe(GetHelper::var( + 'joomla_component', $this->component_id, 'id', 'name_code' + ), 'U'); + } + + /** + * get language target + * + * @return string The language active target + * @since 3.2.0 + */ + protected function getLangtarget(): string + { + // we start with admin + // but this is a switch value and is changed many times + return 'admin'; + } + + /** + * get language string targets + * + * @return array The language prefix + * @since 3.2.0 + */ + protected function getLangstringtargets(): array + { + // these strings are used to search for language strings in all content + return array_values($this->lang_string_key_targets); + } + + /** + * get language string targets (by key name) + * + * @return array The language prefix + * @since 3.2.0 + */ + protected function getLangstringkeytargets(): array + { + // these strings are used to search for language strings in all content + return [ + 'jjt' => 'Joomla' . '.JText._(', + 'js' => 'JText:' . ':script(', + 't' => 'Text:' . ':_(', // namespace and J version will be found + 'ts' => 'Text:' . ':sprintf(', // namespace and J version will be found + 'jt' => 'JustTEXT:' . ':_(' + ]; + } + + /** + * get field builder type + * + * @return int The field builder type + * @since 3.2.0 + */ + protected function getFieldbuildertype(): int + { + // get the field type builder + return $this->params->get( + 'compiler_field_builder_type', 2 + ); + } + + /** + * get compiler path + * + * @return string The compiler path + * @since 3.2.0 + */ + protected function getCompilerpath(): string + { + // get the compiler path + return $this->params->get( 'compiler_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler' ); + } - // load the jcb powers path - $config['jcb_powers_path'] = $this->params->get( - 'jcb_powers_path', - 'libraries/jcb_powers'); + /** + * get jcb powers path + * + * @return string The jcb powers path + * @since 3.2.0 + */ + protected function getJcbpowerspath(): string + { + // get jcb powers path + return $this->params->get('jcb_powers_path', 'libraries/jcb_powers'); + } - // set the component ID - $config['component_id'] = (int)$config['component']; - // TODO set up stream correctly - unset($config['component']); + /** + * get switch to add assets table fix + * + * @return int Switch number to add assets table fix + * @since 3.2.0 + */ + protected function getAddassetstablefix(): int + { + // get global add assets table fix + $global = $this->params->get( + 'assets_table_fix', 1 + ); - // set this components code name - if ($name_code = GetHelper::var( - 'joomla_component', $config['component_id'], 'id', 'name_code' - )) { - // set lang prefix - $config['lang_prefix'] = 'COM_' . StringHelper::safe( - $name_code, 'U' - ); + // get component value + $add = (($add_assets_table_fix = (int) GetHelper::var( + 'joomla_component', $this->component_id, 'id', + 'assets_table_fix' + )) == 3) ? $global : $add_assets_table_fix; - // set component code name - $config['component_code_name'] = StringHelper::safe( - $name_code - ); + return $add; + } - // set component context - $config['component_context'] = $config['component_code_name'] . '.' - . $config['component_id']; + /** + * get switch add placeholders + * + * @return bool Switch to add placeholders + * @since 3.2.0 + */ + protected function getAddplaceholders(): bool + { + // get posted value + $value = $this->input->post->get('add_placeholders', 2, 'INT'); - // set the component name length - $config['component_code_name_length'] = strlen( - $config['component_code_name'] - ); + // get active value + $add = ($value == 0) ? false : ( + ($value == 1) ? true : ( + ((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_placeholders' ) == 1) ? true : false + ) + ); - // add assets table fix - $global = (int)$this->params->get( - 'assets_table_fix', 1 - ); - $config['add_assets_table_fix'] = (($add_assets_table_fix - = (int)GetHelper::var( - 'joomla_component', $config['component_id'], 'id', - 'assets_table_fix' - )) == 3) ? $global : $add_assets_table_fix; + return $add; + } - // set if language strings line breaks should be removed - $global = ((int)GetHelper::var( - 'joomla_component', $config['component_id'], 'id', - 'remove_line_breaks' - ) == 1) ? true : false; - $config['remove_line_breaks'] = ((int)$config['remove_line_breaks'] - == 0) - ? false - : (((int)$config['remove_line_breaks'] == 1) ? true - : $global); + /** + * get switch add power + * + * @return bool Switch to add power + * @since 3.2.0 + */ + protected function getAddpower(): bool + { + // get posted value + $value = $this->input->post->get('powers', 2, 'INT'); - // set if placeholders should be added to customcode - $global = ((int)GetHelper::var( - 'joomla_component', $config['component_id'], 'id', - 'add_placeholders' - ) == 1) ? true : false; - $config['add_placeholders'] = ((int)$config['placeholders'] == 0) - ? false - : (((int)$config['placeholders'] == 1) ? true : $global); - // TODO set up stream correctly - unset($config['placeholders']); + // get active value + $add = ($value == 0) ? false : ( + ($value == 1) ? true : ( + ((int) GetHelper::var('joomla_component', $this->component_id, 'id', 'add_powers' ) == 1) ? true : false + ) + ); - // set if line numbers should be added to comments - $global = ((int)GetHelper::var( - 'joomla_component', $config['component_id'], 'id', - 'debug_linenr' - ) == 1) ? true : false; - $config['debug_line_nr'] = ((int)$config['debuglinenr'] == 0) ? false - : (((int)$config['debuglinenr'] == 1) ? true : $global); + return $add; + } - // set if powers should be added to component (default is true) - $global = ((int)GetHelper::var( - 'joomla_component', $config['component_id'], 'id', - 'add_powers' - ) == 1) ? true : false; - $config['add_power'] = (isset($config['powers']) && (int)$config['powers'] == 0) - ? false : ((isset($config['powers']) && (int)$config['powers'] == 1) ? true : $global); - // TODO set up stream correctly - unset($config['powers']); - } - - return $config; - } + /** + * get switch build target switch + * + * @return string Switch to control the build flow + * @since 3.2.0 + */ + protected function getBuildtarget(): string + { + // we start with admin + // but this is a switch value and is changed many times + return 'admin'; + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode.php new file mode 100644 index 000000000..9777f1bac --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode.php @@ -0,0 +1,635 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\External; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; + + +/** + * Compiler Custom Code + * + * @since 3.2.0 + */ +class Customcode +{ + /** + * The function name memory ids + * + * @var array + * @since 3.2.0 + **/ + public array $functionNameMemory = []; + + /** + * The active custom code + * + * @var array + * @since 3.2.0 + */ + public $active = []; + + /** + * The custom code memory + * + * @var array + * @since 3.2.0 + */ + public $memory = []; + + /** + * The placeholders for custom code keys + * + * @var array + */ + protected $keys + = array( + '[' => '[', + ']' => ']', + ',' => ',', + '+' => '+', + '=' => '=' + ); + + /** + * The custom code to be added + * + * @var array + * @since 3.2.0 + */ + protected $data = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language Extractor + * + * @var Extractor + * @since 3.2.0 + **/ + protected Extractor $extractor; + + /** + * Compiler Custom Code External + * + * @var External + * @since 3.2.0 + **/ + protected External $external; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected $db; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Extract|null $extractor The compiler language extractor object. + * @param External|null $external The compiler external custom code object. + * @param \JDatabaseDriver $db The Database Driver object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Placeholder $placeholder = null, + ?Extractor $extractor = null, ?External $external = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); + $this->external = $external ?: Compiler::_('Customcode.External'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Set the **ALL** dynamic values in a strings here + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * We can now at any time debug the + * dynamic build values if it gets broken + * + * @return string + * @since 3.2.0 + */ + public function add(string $string, int $debug = 0): string + { + if (StringHelper::check($string)) + { + $string = $this->extractor->engine( + $this->set( + $this->external->set($string, $debug), $debug + ) + ); + } + // if debug + if ($debug) + { + jexit(); + } + + return $string; + } + + /** + * We start set the custom code data & can load it in to string + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * @param int|null $not The not switch + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, int $debug = 0, ?int $not = null): string + { + // insure the code is loaded + $loaded = false; + // check if content has custom code place holder + if (strpos($string, '[CUSTO' . 'MCODE=') !== false) + { + // if debug + if ($debug) + { + echo 'Custom Code String:'; + var_dump($string); + } + // the ids found in this content + $bucket = array(); + $found = GetHelper::allBetween( + $string, '[CUSTO' . 'MCODE=', ']' + ); + if (ArrayHelper::check($found)) + { + foreach ($found as $key) + { + // if debug + if ($debug) + { + echo '$key before update:'; + var_dump($key); + } + // check if we have args + if (is_numeric($key)) + { + $id = (int) $key; + } + elseif (StringHelper::check($key) + && strpos( + $key, '+' + ) === false) + { + $getFuncName = trim($key); + if (!isset($this->functionNameMemory[$getFuncName])) + { + if (!$found_local = GetHelper::var( + 'custom_code', $getFuncName, 'function_name', + 'id' + )) + { + continue; + } + $this->functionNameMemory[$getFuncName] + = $found_local; + } + $id = (int) $this->functionNameMemory[$getFuncName]; + } + elseif (StringHelper::check($key) + && strpos( + $key, '+' + ) !== false) + { + $array = explode('+', $key); + // set ID + if (is_numeric($array[0])) + { + $id = (int) $array[0]; + } + elseif (StringHelper::check($array[0])) + { + $getFuncName = trim($array[0]); + if (!isset($this->functionNameMemory[$getFuncName])) + { + if (!$found_local + = GetHelper::var( + 'custom_code', $getFuncName, + 'function_name', 'id' + )) + { + continue; + } + $this->functionNameMemory[$getFuncName] + = $found_local; + } + $id = (int) $this->functionNameMemory[$getFuncName]; + } + else + { + continue; + } + // load args for this ID + if (isset($array[1])) + { + if (!isset($this->data[$id]['args'])) + { + $this->data[$id]['args'] = array(); + } + // only load if not already loaded + if (!isset($this->data[$id]['args'][$key])) + { + if (strpos($array[1], ',') !== false) + { + // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values) + $this->data[$id]['args'][$key] + = array_map( + function ($_key) { + return $this->placeholder->update( + $_key, + $this->keys + ); + }, (array) explode(',', $array[1]) + ); + } + elseif (StringHelper::check( + $array[1] + )) + { + $this->data[$id]['args'][$key] + = array(); + // update the function values with the custom code key placeholders (this allow the use of [] + and , in the values) + $this->data[$id]['args'][$key][] + = $this->placeholder->update( + $array[1], + $this->keys + ); + } + } + } + } + else + { + continue; + } + // make sure to remove the not if set + if ($not && is_numeric($not) && $not > 0 && $not == $id) + { + continue; + } + $bucket[$id] = $id; + } + } + // if debug + if ($debug) + { + echo 'Bucket:'; + var_dump($bucket); + } + // check if any custom code placeholders where found + if (ArrayHelper::check($bucket)) + { + $_tmpLang = $this->config->lang_target; + // insure we add the langs to both site and admin + $this->config->lang_target = 'both'; + // now load the code to memory + $loaded = $this->load($bucket, false, $debug); + // revert lang to current setting + $this->config->lang_target = $_tmpLang; + } + // if debug + if ($debug) + { + echo 'Loaded:'; + var_dump($loaded); + } + // when the custom code is loaded + if ($loaded === true) + { + $string = $this->insert($bucket, $string, $debug); + } + // if debug + if ($debug) + { + echo 'Custom Code String After Update:'; + var_dump($string); + } + } + + return $string; + } + + /** + * Load the custom code from the system + * + * @param array|null $ids The custom code ides if known + * @param bool $setLang The set lang switch + * @param int $debug The switch to debug the update + * + * @return bool + * @since 3.2.0 + */ + public function load(?array $ids = null, bool $setLang = true, $debug = 0): bool + { + // should the result be stored in memory + $loadInMemory = false; + // Create a new query object. + $query = $this->db->getQuery(true); + $query->from( + $this->db->quoteName('#__componentbuilder_custom_code', 'a') + ); + if (ArrayHelper::check($ids)) + { + if ($idArray = $this->check($ids)) + { + $query->select( + $this->db->quoteName( + array('a.id', 'a.code', 'a.comment_type') + ) + ); + $query->where( + $this->db->quoteName('a.id') . ' IN (' . implode( + ',', $idArray + ) . ')' + ); + $query->where( + $this->db->quoteName('a.target') . ' = 2' + ); // <--- to load the correct target + $loadInMemory = true; + } + else + { + // all values are already in memory continue + return true; + } + } + else + { + $query->select( + $this->db->quoteName( + array('a.id', 'a.code', 'a.comment_type', 'a.component', + 'a.from_line', 'a.hashtarget', 'a.hashendtarget', + 'a.path', 'a.to_line', 'a.type') + ) + ); + $query->where( + $this->db->quoteName('a.component') . ' = ' + . (int) $this->config->component_id + ); + $query->where( + $this->db->quoteName('a.target') . ' = 1' + ); // <--- to load the correct target + $query->order( + $this->db->quoteName('a.from_line') . ' ASC' + ); // <--- insure we always add code from top of file + // reset custom code + $this->active = array(); + } + $query->where($this->db->quoteName('a.published') . ' >= 1'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + $bucket = $this->db->loadAssocList('id'); + // open the code + foreach ($bucket as $nr => &$customCode) + { + $customCode['code'] = base64_decode($customCode['code']); + // always insure that the external code is loaded + $customCode['code'] = $this->external->set( + $customCode['code'] + ); + // set the lang only if needed + if ($setLang) + { + $customCode['code'] = $this->extractor->engine( + $customCode['code'] + ); + } + // check for more custom code (since this is a custom code placeholder) + else + { + $customCode['code'] = $this->set( + $customCode['code'], $debug, $nr + ); + } + // build the hash array + if (isset($customCode['hashtarget'])) + { + $customCode['hashtarget'] = explode( + "__", $customCode['hashtarget'] + ); + // is this a replace code, set end has array + if ($customCode['type'] == 1 + && strpos( + $customCode['hashendtarget'], '__' + ) !== false) + { + $customCode['hashendtarget'] = explode( + "__", $customCode['hashendtarget'] + ); + // NOW see if this is an end of page target (TODO not sure if the string is always d41d8cd98f00b204e9800998ecf8427e) + // I know this fix is not air-tight, but it should work as the value of an empty line when md5'ed is ^^^^ + // Then if the line number is only >>>one<<< it is almost always end of the page. + // So I am using those two values to detect end of page replace ending, to avoid mismatching the ending target hash. + if ($customCode['hashendtarget'][0] == 1 + && 'd41d8cd98f00b204e9800998ecf8427e' + === $customCode['hashendtarget'][1]) + { + // unset since this will force the replacement unto end of page. + unset($customCode['hashendtarget']); + } + } + } + } + // load this code into memory if needed + if ($loadInMemory === true) + { + $this->memory = $this->memory + $bucket; + } + $this->active = array_merge($this->active, $bucket); + + return true; + } + + return false; + } + + /** + * Insert the custom code into the string + * + * @param array|null $ids The custom code ides if known + * @param string $string The string to insert custom code into + * @param int $debug The switch to debug the update + * + * @return string on success + * @since 3.2.0 + */ + protected function insert(array $ids, string $string, int $debug = 0) + { + $code = array(); + // load the code + foreach ($ids as $id) + { + $this->buildPlaceholders( + $this->memory[$id], $code, $debug + ); + } + // if debug + if ($debug) + { + echo 'Place holders to Update String:'; + var_dump($code); + echo 'Custom Code String Before Update:'; + var_dump($string); + } + + // now update the string + return $this->placeholder->update($string, $code); + } + + /** + * Build custom code placeholders + * + * @param array $item The memory item + * @param array $code The custom code bucket + * @param int $debug The switch to debug the update + * + * @return void + * @since 3.2.0 + */ + protected function buildPlaceholders(array $item, array &$code, int $debug = 0) + { + // check if there is args for this code + if (isset($this->data[$item['id']]['args']) + && ArrayHelper::check( + $this->data[$item['id']]['args'] + )) + { + // since we have args we cant update this code via IDE (TODO) + $placeholder = $this->placeholder->keys(3, null); + // if debug + if ($debug) + { + echo 'Custom Code Placeholders:'; + var_dump($placeholder); + } + // we have args and so need to load each + foreach ( + $this->data[$item['id']]['args'] as $key => $args + ) + { + $this->placeholder->setType('arg', $args); + // if debug + if ($debug) + { + echo 'Custom Code Global Placeholders:'; + var_dump($this->placeholder->active); + } + $code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start'] + . PHP_EOL . $this->placeholder->update( + $item['code'], $this->placeholder->active + ) . $placeholder['end']; + } + // always clear the args + $this->placeholder->clearType('arg'); + } + else + { + if (($keyPlaceholder = array_search( + $item['id'], $this->functionNameMemory + )) === false) + { + $keyPlaceholder = $item['id']; + } + // check what type of place holders we should load here + $placeholderType = (int) $item['comment_type'] . '2'; + if (stripos($item['code'], Placefix::b() . 'view') !== false + || stripos($item['code'], Placefix::b() . 'sview') !== false + || stripos($item['code'], Placefix::b() . 'arg') !== false) + { + // if view is being set dynamicly then we can't update this code via IDE (TODO) + $placeholderType = 3; + } + // if now ars were found, clear it + $this->placeholder->clearType('arg'); + // load args for this code + $placeholder = $this->placeholder->keys( + $placeholderType, $item['id'] + ); + $code['[CUSTOM' . 'CODE=' . $keyPlaceholder . ']'] + = $placeholder['start'] . PHP_EOL + . $this->placeholder->update( + $item['code'], $this->placeholder->active + ) . $placeholder['end']; + } + } + + /** + * check if we already have these ids in local memory + * + * @param array $ids The custom code ids + * + * @return Mixed + * @since 3.2.0 + */ + protected function check(array $ids) + { + // reset custom code + $this->active = []; + + foreach ($ids as $pointer => $id) + { + if (isset($this->memory[$id])) + { + $this->active[] = $this->memory[$id]; + unset($ids[$pointer]); + } + } + + // check if any ids left to fetch + if (ArrayHelper::check($ids)) + { + return $ids; + } + + return false; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/External.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/External.php new file mode 100644 index 000000000..685c0baba --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/External.php @@ -0,0 +1,406 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use Joomla\CMS\Factory; +use Joomla\CMS\User\User; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Filesystem\Path; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; + + +/** + * Compiler External Custom Code + * + * @since 3.2.0 + */ +class External +{ + /** + * The external code/string to be added + * + * @var array + * @since 3.2.0 + */ + protected array $code = []; + + /** + * The external code/string cutter + * + * @var array + * @since 3.2.0 + */ + protected array $cutter = []; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * User object + * + * @var User + * @since 3.2.0 + **/ + protected User $user; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param \JDatabaseDriver|null $db The Database Driver object. + * @param User|null $user The User object. + * @param CMSApplication|null $app The CMS Application object. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null, + ?\JDatabaseDriver $db = null, ?User $user = null, ?CMSApplication $app = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->db = $db ?: Factory::getDbo(); + $this->user = $user ?: Factory::getUser(); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Set the external code string & load it in to string + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, int $debug = 0): string + { + // check if content has custom code placeholder + if (strpos($string, '[EXTERNA' . 'LCODE=') !== false) + { + // if debug + if ($debug) + { + echo 'External Code String:'; + var_dump($string); + } + // target content + $bucket = array(); + $found = GetHelper::allBetween( + $string, '[EXTERNA' . 'LCODE=', ']' + ); + if (ArrayHelper::check($found)) + { + // build local bucket + foreach ($found as $target) + { + // check for cutting sequence + // example: >{3|4 + // will cut 3 rows at top and 4 rows at bottom + // if the external code has 8 or more lines + if (($pos = strpos($target, '>{')) !== false) + { + // the length + $target_len = strlen($target); + // where to cut + $cutting = $target_len - $pos; + // get the sequence + $sequence = substr($target, "-$cutting"); + // remove from the URL + $target_url = str_replace($sequence, '', $target); + // set the cut key for this target if not set + $this->cutter[trim($target)] = str_replace('>{', '', $sequence); + } + else + { + $target_url = $target; + } + // check if the target is valid URL or path + if ((!filter_var($target_url, FILTER_VALIDATE_URL) === false + && FileHelper::exists($target_url)) + || (Path::clean($target_url) === $target_url + && FileHelper::exists($target_url))) + { + $this->getCode($target, $bucket); + } + // give notice that target is not a valid url/path + else + { + // set key + $key = '[EXTERNA' . 'LCODE=' . $target . ']'; + // set the notice + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE' + ), 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_IS_NOT_A_VALID_URLPATH', + $key + ), 'Warning' + ); + // remove the placeholder + $bucket[$key] = ''; + } + } + // now update local string if bucket has values + if (ArrayHelper::check($bucket)) + { + $string = $this->placeholder->update($string, $bucket); + } + } + // if debug + if ($debug) + { + echo 'External Code String After Update:'; + var_dump($string); + } + } + + return $string; + } + + /** + * Get the External Code/String + * + * @param string $string The content to check + * @param array $bucket The Placeholders bucket + * + * @return void + * @since 3.2.0 + */ + protected function getCode(string $target, array &$bucket) + { + // set URL key + $target_key = trim($target); + // set key + $key = '[EXTERNA' . 'LCODE=' . $target . ']'; + // remove the cut sequence from the url + if (isset($this->cutter[$target_key])) + { + // remove from the URL + $target_url = trim(str_replace('>{' . $this->cutter[$target_key], '', $target)); + } + else + { + $target_url = trim($target); + } + // check if we already fetched this + if (!isset($this->code[$target_key])) + { + // get the data string (code) + $this->code[$target_key] + = FileHelper::getContent($target_url); + // check if we must cut this + if (isset($this->cutter[$target_key]) && + $this->cutter[$target_key]) + { + $this->code[$target_key] = $this->cut( + $this->code[$target_key], + $this->cutter[$target_key], + $key + ); + } + // did we get any value + if (StringHelper::check( + $this->code[$target_key] + )) + { + // check for changes + $live_hash = md5($this->code[$target_key]); + // check if it exists local + if ($hash = GetHelper::var( + 'external_code', $target_key, 'target', 'hash' + )) + { + // must be an admin make a change to use EXTERNAL code (we may add a custom access switch - use ADMIN for now) + if ($hash !== $live_hash && $this->user->authorise( + 'core.admin', 'com_componentbuilder' + )) + { + // update the hash since it changed + $object = new stdClass(); + $object->target = $target_key; + $object->hash = $live_hash; + // update local hash + $this->db->updateObject( + '#__componentbuilder_external_code', $object, + 'target' + ); + // give notice of the change + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE'), + 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB', + $key + ), 'Warning' + ); + } + elseif ($hash !== $live_hash) + { + // set the notice + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_S_WE_DETECTED_A_CHANGE_IN_BEXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_CHANGE_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL', + $this->user->get('name'), $key + ), 'Error' + ); + // remove the code/string + $this->code[$target_key] = ''; + } + } + // only an admin can add new EXTERNAL code (we may add a custom access switch - use ADMIN for now) + elseif ($this->user->authorise( + 'core.admin', 'com_componentbuilder' + )) + { + // add the hash to track changes + $object = new stdClass(); + $object->target = $target_key; + $object->hash = $live_hash; + // insert local hash + $this->db->insertObject( + '#__componentbuilder_external_code', $object + ); + // give notice the first time this is added + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE'), + 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB', + $key + ), 'Warning' + ); + } + else + { + // set the notice + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_NEW_CODESTRING_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOU_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL', + $this->user->get('name'), $key + ), 'Error' + ); + // remove the code/string + $this->code[$target_key] = ''; + } + } + else + { + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE'), 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING', $key + ), 'Error' + ); + } + } + // add to local bucket + if (isset($this->code[$target_key])) + { + // update the placeholder with the external code string + $bucket[$key] = $this->code[$target_key]; + } + else + { + // remove the placeholder + $bucket[$key] = ''; + } + } + + /** + * Cut the External Code/String + * + * @param string $string The content to cut + * @param string $sequence The cutting sequence + * @param string $key The content key + * + * @return string + * @since 3.2.0 + */ + protected function cut(string $string, string $sequence, string $key): string + { + // we first break the string up in rows + $rows = (array) explode(PHP_EOL, $string); + // get the cutting sequence + $cutter = (array) explode('|', $sequence); + // we only continue if we have more rows than we have to cut + if (array_sum($cutter) < ArrayHelper::check($rows)) + { + // remove the rows at the bottom if needed + if (isset($cutter[1]) && $cutter[1] > 0) + { + array_splice($rows, "-$cutter[1]"); + } + // remove the rows at the top if needed + if ($cutter[0] > 0) + { + $rows = array_splice($rows, $cutter[0]); + } + + // return the remaining rows + return implode(PHP_EOL, $rows); + } + + // we set an error message about too few lines to cut + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE'), + 'Error' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_CUT_SEQUENCE_FAILED_ON_THE_RETURNED_EXTERNAL_CODESTRING_AS_MORE_LINES_HAS_TO_BE_CUT_THEN_WAS_FOUND_IN_THE_CODESTRING_WE_HAVE_COMPLETELY_REMOVED_THE_CODE_PLEASE_CHECK_THIS_CODESTRING', + $key + ), 'Error' + ); + + return ''; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Gui.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Gui.php new file mode 100644 index 000000000..808aabcdb --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Gui.php @@ -0,0 +1,256 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse; + + +/** + * Compiler Gui Custom Code + * + * @since 3.2.0 + */ +class Gui +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder Reverse + * + * @var Reverse + * @since 3.2.0 + **/ + protected Reverse $reverse; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Reverse|null $reverse The compiler placeholder reverse object. + * @param \JDatabaseDriver|null $db The Database Driver object. + * @param CMSApplication|null $app The CMS Application object. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Reverse $reverse = null, + ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); + $this->db = $db ?: Factory::getDbo(); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * Set the JCB GUI code placeholder + * + * @param string $string The code string + * @param array $config The placeholder config values + * + * @return string + * @since 3.2.0 + */ + public function set(string $string, array $config): string + { + if (StringHelper::check($string)) + { + if ($this->config->get('add_placeholders', false) + && $this->check($string) && ArrayHelper::check($config) + && isset($config['table']) && StringHelper::check($config['table']) + && isset($config['field']) && StringHelper::check($config['field']) + && isset($config['type']) && StringHelper::check($config['type']) + && isset($config['id']) && is_numeric($config['id'])) + { + // if we have a key we must get the ID + if (isset($config['key']) && StringHelper::check($config['key']) && $config['key'] !== 'id') + { + if (($id = GetHelper::var($config['table'], $config['id'], $config['key'], 'id')) !== false && is_numeric($id)) + { + $config['id'] = $id; + } + else + { + // we must give a error message to inform the user of this issue. (should never happen) + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_ID_MISMATCH_WAS_DETECTED_WITH_THE_SSSS_GUI_CODE_FIELD_SO_THE_PLACEHOLDER_WAS_NOT_SET', + $config['table'], $config['field'], + $config['key'], $config['id'] + ), 'Error' + ); + // check some config + if (!isset($config['prefix'])) + { + $config['prefix'] = ''; + } + + return $config['prefix'] . $string; + } + } + // check some config + if (!isset($config['prefix'])) + { + $config['prefix'] = PHP_EOL; + } + // add placeholder based on type of code + switch (strtolower($config['type'])) + { + // adding with html commenting + case 'html': + $front = $config['prefix'] . '' . PHP_EOL; + $back = '' + ); + + if (($guiCode = ArrayHelper::merge($guiCode)) !== false + && ArrayHelper::check($guiCode, true)) + { + foreach ($guiCode as $code) + { + $first_line = strtok($code, PHP_EOL); + // get the GUI target details + $query = explode('.', trim($first_line, '.')); + // only continue if we have 3 values in the query + if (is_array($query) && count($query) >= 3) + { + // cleanup the newlines around the code + $code = trim(str_replace($first_line, '', $code), PHP_EOL) + . PHP_EOL; + // set the ID + $id = (int) $query[2]; + // make the field name save + $field = FieldHelper::safe($query[1]); + // make the table name save + $table = StringHelper::safe($query[0]); + // reverse placeholder as much as we can + $code = $this->reverse->engine( + $code, $placeholders, $target, $id, $field, $table + ); + // update the GUI/Tables/Database + $object = new \stdClass(); + $object->id = $id; + $object->{$field} = base64_encode( + $code + ); // (TODO) this may not always work... + // update the value in GUI + $this->db->updateObject( + '#__componentbuilder_' . (string) $table, $object, 'id' + ); + } + } + } + } + + /** + * search a code to see if there is already any custom + * code or other reasons not to add the GUI code placeholders + * + * @param string $code The code to check + * + * @return bool true if GUI code placeholders can be added + * @since 3.2.0 + */ + protected function check(string &$code): bool + { + // check for customcode placeholders + if (strpos($code, '$$$$') !== false) + { + // we do not add GUI wrapper placeholder to code + // that already has any customcode placeholders + return false; + } + + return true; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/index.html similarity index 100% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/index.html rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/index.html diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php similarity index 66% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php index 0c72523fd..f2a3843f3 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extension/InstallScript.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/InstallScript.php @@ -9,41 +9,29 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -namespace VDM\Joomla\Componentbuilder\Extension; +namespace VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\InstallInterface; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Componentbuilder\Line; -use VDM\Joomla\Componentbuilder\Tab; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface; /** * Loading the Extension Installation Script Class * - * @since 3.1.5 + * @since 3.2.0 */ -class InstallScript +class InstallScript implements GetScriptInterface { - /** - * The Line numbering Methods - * - * @since 3.1.5 - */ - use Line; - - /** - * The Tab Adding Method - * - * @since 3.1.5 - */ - use Tab; - /** * The extension * - * @var object - * @since 3.1.5 + * @var InstallInterface|Object + * @since 3.2.0 */ protected object $extension; @@ -51,7 +39,7 @@ class InstallScript * The methods * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $methods = ['php_script', 'php_preflight', 'php_postflight', 'php_method']; @@ -59,7 +47,7 @@ class InstallScript * The types * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $types = ['construct', 'install', 'update', 'uninstall', 'discover_install']; @@ -67,7 +55,7 @@ class InstallScript * The construct bucket * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $construct = []; @@ -75,7 +63,7 @@ class InstallScript * The install bucket * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $install = []; @@ -83,7 +71,7 @@ class InstallScript * The update bucket * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $update = []; @@ -91,7 +79,7 @@ class InstallScript * The uninstall bucket * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $uninstall = []; @@ -99,7 +87,7 @@ class InstallScript * The preflight switch * * @var bool - * @since 3.1.5 + * @since 3.2.0 */ protected bool $preflightActive = false; @@ -107,7 +95,7 @@ class InstallScript * The preflight bucket * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; @@ -115,7 +103,7 @@ class InstallScript * The postflight switch * * @var bool - * @since 3.1.5 + * @since 3.2.0 */ protected bool $postflightActive = false; @@ -123,15 +111,19 @@ class InstallScript * The postflight bucket * * @var array - * @since 3.1.5 + * @since 3.2.0 */ protected array $postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []]; /** - * Constructor - * @since 3.1.5 + * get install script + * + * @param Object $extension The extension object + * + * @return string + * @since 3.2.0 */ - public function __construct(object $extension) + public function get(object $extension): string { // loop over methods and types foreach ($this->methods as $method) @@ -163,16 +155,7 @@ class InstallScript } $this->extension = $extension; - } - /** - * get install script - * - * @return string - * @since 3.1.5 - */ - public function get(): string - { // return the class return $this->build(); } @@ -181,7 +164,7 @@ class InstallScript * build the install class * * @return string - * @since 3.1.5 + * @since 3.2.0 */ protected function build(): string { @@ -216,12 +199,13 @@ class InstallScript * get install script head * * @return string - * @since 3.1.5 + * @since 3.2.0 */ protected function head(): string { // get the extension $extension = $this->extension; + // start build $script = PHP_EOL . '/**'; $script .= PHP_EOL . ' * ' . $extension->official_name @@ -239,7 +223,7 @@ class InstallScript * get constructor * * @return string - * @since 3.1.5 + * @since 3.2.0 */ protected function construct(): string { @@ -250,18 +234,18 @@ class InstallScript } // the __construct script - $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $script .= PHP_EOL . $this->_t(1) . ' * Constructor'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . ' * Constructor'; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) . ' */'; - $script .= PHP_EOL . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function __construct($adapter)'; - $script .= PHP_EOL . $this->_t(1) . '{'; + $script .= PHP_EOL . Indent::_(1) . '{'; $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct); // close the function - $script .= PHP_EOL . $this->_t(1) . '}'; + $script .= PHP_EOL . Indent::_(1) . '}'; return $script; } @@ -272,7 +256,7 @@ class InstallScript * @param string $name the method being called * * @return string - * @since 3.1.5 + * @since 3.2.0 */ protected function main(string $name): string { @@ -282,26 +266,26 @@ class InstallScript return ''; } // load the install method - $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $script .= PHP_EOL . $this->_t(1) . " * Called on $name"; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . " * Called on $name"; + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) . ' * @return boolean True on success'; - $script .= PHP_EOL . $this->_t(1) . ' */'; - $script .= PHP_EOL . $this->_t(1) . 'public function ' + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' . $name . '($adapter)'; - $script .= PHP_EOL . $this->_t(1) . '{'; + $script .= PHP_EOL . Indent::_(1) . '{'; $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name}); // return true if ('uninstall' !== $name) { - $script .= PHP_EOL . $this->_t(2) . 'return true;'; + $script .= PHP_EOL . Indent::_(2) . 'return true;'; } // close the function - $script .= PHP_EOL . $this->_t(1) . '}'; + $script .= PHP_EOL . Indent::_(1) . '}'; return $script; } @@ -312,7 +296,7 @@ class InstallScript * @param string $name the method being called * * @return string - * @since 3.1.5 + * @since 3.2.0 */ protected function flight(string $name): string { @@ -323,42 +307,40 @@ class InstallScript } // the pre/post function types - $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $script .= PHP_EOL . $this->_t(1) + $script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**'; + $script .= PHP_EOL . Indent::_(1) . ' * Called before any type of action'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; - $script .= PHP_EOL . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) . ' *'; - $script .= PHP_EOL . $this->_t(1) + $script .= PHP_EOL . Indent::_(1) . ' *'; + $script .= PHP_EOL . Indent::_(1) . ' * @return boolean True on success'; - $script .= PHP_EOL . $this->_t(1) . ' */'; - $script .= PHP_EOL . $this->_t(1) . 'public function ' + $script .= PHP_EOL . Indent::_(1) . ' */'; + $script .= PHP_EOL . Indent::_(1) . 'public function ' . $name . '($route, $adapter)'; - $script .= PHP_EOL . $this->_t(1) . '{'; - $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( - __LINE__ - ) . ' get application'; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(1) . '{'; + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + . ' get application'; + $script .= PHP_EOL . Indent::_(2) . '$app = JFactory::getApplication();' . PHP_EOL; // add the default version check (TODO) must make this dynamic if ('preflight' === $name) { - $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( - __LINE__ - ) . ' the default for both install and update'; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__) + .' the default for both install and update'; + $script .= PHP_EOL . Indent::_(2) . '$jversion = new JVersion();'; - $script .= PHP_EOL . $this->_t(2) + $script .= PHP_EOL . Indent::_(2) . "if (!\$jversion->isCompatible('3.8.0'))"; - $script .= PHP_EOL . $this->_t(2) . '{'; - $script .= PHP_EOL . $this->_t(3) + $script .= PHP_EOL . Indent::_(2) . '{'; + $script .= PHP_EOL . Indent::_(3) . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; - $script .= PHP_EOL . $this->_t(3) . 'return false;'; - $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; + $script .= PHP_EOL . Indent::_(3) . 'return false;'; + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; } // now add the scripts @@ -367,22 +349,23 @@ class InstallScript if (ArrayHelper::check($_script)) { // set the if and script - $script .= PHP_EOL . $this->_t(2) . "if ('" . $route + $script .= PHP_EOL . Indent::_(2) . "if ('" . $route . "' === \$route)"; - $script .= PHP_EOL . $this->_t(2) . '{'; + $script .= PHP_EOL . Indent::_(2) . '{'; $script .= PHP_EOL . implode( PHP_EOL . PHP_EOL, $_script ); - $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; + $script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL; } } // return true - $script .= PHP_EOL . $this->_t(2) . 'return true;'; + $script .= PHP_EOL . Indent::_(2) . 'return true;'; // close the function - $script .= PHP_EOL . $this->_t(1) . '}'; + $script .= PHP_EOL . Indent::_(1) . '}'; return $script; - } + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Extension/JoomlaThree/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php new file mode 100644 index 000000000..28da40a9e --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php @@ -0,0 +1,111 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\DI\Container; + + +/** + * Compiler Factory + * + * @since 3.2.0 + */ +abstract class Factory +{ + /** + * Global Compiler Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected static $JoomlaVersion; + + /** + * Get any class from the compiler container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get version specific class from the compiler container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _J($key) + { + if (empty(self::$JoomlaVersion)) + { + self::$JoomlaVersion = self::getContainer()->get('Config')->joomla_version; + } + + return self::getContainer()->get('J' . self::$JoomlaVersion . '.' . $key); + } + + /** + * Get a the global compiler container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + $container = (new Container()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Config()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Event()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Language()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Customcode()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Power()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Component()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Extension()); + + return $container; + } + + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php new file mode 100644 index 000000000..e9e67c911 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php @@ -0,0 +1,33 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler Events Interface + * + * @since 3.2.0 + */ +interface EventInterface +{ + /** + * Trigger an event + * + * @param string $event The event to trigger + * @param mix $data The values to pass to the event/plugin + * + * @return void + * @since 3.2.0 + */ + public function trigger(string $event, $data); +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/GetScriptInterface.php similarity index 51% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/GetScriptInterface.php index e4ae1c346..c41170ef8 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Line.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/GetScriptInterface.php @@ -9,35 +9,24 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -namespace VDM\Joomla\Componentbuilder; - - -use VDM\Joomla\Componentbuilder\Factory\Compiler\Config; +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; /** - * Add line comment + * The functions a get script should have * - * @since 3.1.5 + * @since 3.2.0 */ -trait Line +interface GetScriptInterface { /** - * Set the line number in comments + * get code to use * - * @param int $nr The line number + * @param Object $code The code object * * @return string - * @since 3.1.5 + * @since 3.2.0 */ - private function setLine(int $nr): string - { - if (Config::get('debug_line_nr', false)) - { - return ' [' . get_called_class() . ' ' . $nr . ']'; - } - - return ''; - } + public function get(object $extension): string; } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/InstallInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/InstallInterface.php new file mode 100644 index 000000000..3b0528273 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/InstallInterface.php @@ -0,0 +1,44 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * The properties an extension should have to be passed to the InstallScript class + */ +interface InstallInterface +{ + /** + * The extension official name + * + * @return string + * @since 3.2.0 + */ + public function getOfficialName(): string; + + /** + * The extension class name + * + * @return string + * @since 3.2.0 + */ + public function getClassName(): string; + + /** + * The extension installer class name + * + * @return string + * @since 3.2.0 + */ + public function getInstallerClassName(): string; +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php new file mode 100644 index 000000000..8e1264f8c --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php @@ -0,0 +1,98 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaThree; + + +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; + + +/** + * Compiler Events + * + * @since 3.2.0 + */ +class Event implements EventInterface +{ + /** + * event plugin trigger switch + * + * @var boolean + * @since 3.2.0 + */ + protected $activePlugins = false; + + /** + * Constructor + * + * @param Registry|null $params The component parameters + * + * @since 3.2.0 + */ + public function __construct(?Registry $params = null) + { + // Set the params + $params = $params ?: Helper::getParams('com_componentbuilder'); + // get active plugins + if (($plugins = $params->get('compiler_plugin', false)) + !== false) + { + foreach ($plugins as $plugin) + { + // get possible plugins + if (\JPluginHelper::isEnabled('extension', $plugin)) + { + // Import the appropriate plugin group. + \JPluginHelper::importPlugin('extension', $plugin); + // activate events + $this->activePlugins = true; + } + } + } + } + + /** + * Trigger and event + * + * @param string $event The event to trigger + * @param mix $data The values to pass to the event/plugin + * + * @return void + * @since 3.2.0 + */ + public function trigger($event, $data) + { + // only execute if plugins were loaded (active) + if ($this->activePlugins) + { + // Get the dispatcher. + $dispatcher = \JEventDispatcher::getInstance(); + + // Trigger this compiler event. + $results = $dispatcher->trigger($event, $data); + + // Check for errors encountered while trigger the event + if (count((array) $results) && in_array(false, $results, true)) + { + // Get the last error. + $error = $dispatcher->getError(); + + if (!($error instanceof \Exception)) + { + throw new \Exception($error); + } + } + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language.php new file mode 100644 index 000000000..fc604ea5d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language.php @@ -0,0 +1,201 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; + + +/** + * Compiler Language Content + * + * @since 3.2.0 + */ +class Language +{ + /** + * The language content + * + * @var array + * @since 3.2.0 + **/ + protected array $content = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + } + + /** + * Get the language string key + * + * @param string $string The plan text string (English) + * + * @return string The key language string (all uppercase) + * @since 3.2.0 + */ + public function key($string): string + { + // this is there to insure we don't break already added Language strings + if (StringHelper::safe($string, 'U', '_', false, false) + === $string) + { + return false; + } + + // build language key + $key_lang = $this->config->lang_prefix . '_' . StringHelper::safe( + $string, 'U' + ); + + // set the language string + $this->set($this->config->lang_target, $key_lang, $string); + + return $key_lang; + } + + /** + * check if the language string exist + * + * @param string $target The target area for the language string + * @param string|null $language The language key string + * + * @return bool + * @since 3.2.0 + */ + public function exist(string $target, ?string $language = null): bool + { + if ($language) + { + return isset($this->content[$target][$language]); + } + + return isset($this->content[$target]); + } + + /** + * get the language string + * + * @param string $target The target area for the language string + * @param string|null $language The language key string + * + * @return Mixed The language string found or empty string if none is found + * @since 3.2.0 + */ + public function get(string $target, string $language): string + { + if (isset($this->content[$target][$language])) + { + return $this->content[$target][$language]; + } + + return ''; + } + + /** + * get target array + * + * @param string $target The target area for the language string + * + * @return array The target array or empty array if none is found + * @since 3.2.0 + */ + public function getTarget(string $target): array + { + if (isset($this->content[$target]) && ArrayHelper::check($this->content[$target])) + { + return $this->content[$target]; + } + + return []; + } + + /** + * set target array + * + * @param string $target The target area for the language string + * @param array|null $content The language content string + * + * @return void + * @since 3.2.0 + */ + public function setTarget(string $target, ?array $content) + { + $this->content[$target] = $content; + } + + /** + * set the language content values to language content array + * + * @param string $target The target area for the language string + * @param string $language The language key string + * @param string $string The language string + * @param bool $addPrefix The switch to add langPrefix + * + * @return void + * @since 3.2.0 + */ + public function set(string $target, string $language, string $string, bool $addPrefix = false) + { + if ($addPrefix && empty( + $this->content[$target][$this->config->lang_prefix . '_' . $language] + )) + { + $this->content[$target][$this->config->lang_prefix . '_' . $language] + = $this->fix($string); + } + elseif (empty($this->content[$target][$language])) + { + $this->content[$target][$language] = $this->fix( + $string + ); + } + } + + /** + * We need to remove all text breaks from all language strings + * + * @param string $string The language string + * + * @return string + * @since 3.2.0 + */ + protected function fix(string $string): string + { + if ($this->config->remove_line_breaks) + { + return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string)); + } + + return trim($string); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/Extractor.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/Extractor.php new file mode 100644 index 000000000..7ab78f18d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/Extractor.php @@ -0,0 +1,254 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Language; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; + + +/** + * Compiler Language Extractor + * + * @since 3.2.0 + */ +class Extractor +{ + /** + * The lang keys for extensions + * + * @var array + * @since 3.2.0 + **/ + public array $langKeys = []; + + /** + * The Language JS matching check + * + * @var array + * @since 3.2.0 + **/ + public array $langMismatch = []; + + /** + * The Language SC matching check + * + * @var array + * @since 3.2.0 + **/ + public array $langMatch = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Language|null $language The compiler Language object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Language $language = null, ?Placeholder $placeholder = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->language = $language ?: Compiler::_('Language'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + } + + /** + * Extract Language Strings + * + * @param string $content The content + * + * @return string The content with the updated Language place holder + * @since 3.2.0 + */ + public function engine(string $content): string + { + // get targets to search for + $lang_string_targets = array_filter( + $this->config->lang_string_targets, function ($get) use ($content) { + if (strpos($content, $get) !== false) + { + return true; + } + + return false; + } + ); + // check if we should continue + if (ArrayHelper::check($lang_string_targets)) + { + // insure string is not broken + $content = $this->placeholder->update($content, $this->placeholder->active); + // reset some buckets + $lang_holders = array(); + $lang_check = array(); + $lang_only = array(); + $js_text = array(); + $sc_text = array(); + // first get the Joomla .JText._() + if (in_array('Joomla' . '.JText._(', $lang_string_targets)) + { + $js_text[] = GetHelper::allBetween( + $content, "Joomla" . ".JText._('", "'" + ); + $js_text[] = GetHelper::allBetween( + $content, 'Joomla' . '.JText._("', '"' + ); + // combine into one array + $js_text = ArrayHelper::merge($js_text); + // we need to add a check to insure these JavaScript lang matchup + if (ArrayHelper::check( + $js_text + )) //<-- not really needed hmmm + { + // load the JS text to mismatch array + $lang_check[] = $js_text; + $this->langMismatch = ArrayHelper::merge( + array($js_text, $this->langMismatch) + ); + } + } + // now get the JText: :script() + if (in_array('JText:' . ':script(', $lang_string_targets)) + { + $sc_text[] = GetHelper::allBetween( + $content, "JText:" . ":script('", "'" + ); + $sc_text[] = GetHelper::allBetween( + $content, 'JText:' . ':script("', '"' + ); + // combine into one array + $sc_text = ArrayHelper::merge($sc_text); + // we need to add a check to insure these JavaScript lang matchup + if (ArrayHelper::check($sc_text)) + { + // load the Script text to match array + $lang_check[] = $sc_text; + $this->langMatch = ArrayHelper::merge( + array($sc_text, $this->langMatch) + ); + } + } + // now do the little trick for JustTEXT: :_('Just uppercase text'); + if (in_array('JustTEXT:' . ':_(', $lang_string_targets)) + { + $lang_only[] = GetHelper::allBetween( + $content, "JustTEXT:" . ":_('", "')" + ); + $lang_only[] = GetHelper::allBetween( + $content, 'JustTEXT:' . ':_("', '")' + ); + // merge lang only + $lang_only = ArrayHelper::merge($lang_only); + } + // set language data + foreach ($lang_string_targets as $lang_string_target) + { + // need some special treatment here + if ($lang_string_target === 'Joomla' . '.JText._(' + || $lang_string_target === 'JText:' . ':script(' + || $lang_string_target === 'JustTEXT:' . ':_(') + { + continue; + } + $lang_check[] = GetHelper::allBetween( + $content, $lang_string_target . "'", "'" + ); + $lang_check[] = GetHelper::allBetween( + $content, $lang_string_target . '"', '"' + ); + } + // the normal loading of the language strings + $lang_check = ArrayHelper::merge($lang_check); + if (ArrayHelper::check( + $lang_check + )) //<-- not really needed hmmm + { + foreach ($lang_check as $string) + { + if ($key_lang = $this->language->key($string)) + { + // load the language targets + foreach ($lang_string_targets as $lang_string_target) + { + // need some special treatment here + if ($lang_string_target === 'JustTEXT:' . ':_(') + { + continue; + } + $lang_holders[$lang_string_target . "'" . $string + . "'"] + = $lang_string_target . "'" . $key_lang . "'"; + $lang_holders[$lang_string_target . '"' . $string + . '"'] + = $lang_string_target . '"' . $key_lang . '"'; + } + } + } + } + // the uppercase loading only (for arrays and other tricks) + if (ArrayHelper::check($lang_only)) + { + foreach ($lang_only as $string) + { + if ($key_lang = $this->language->key($string)) + { + // load the language targets + $lang_holders["JustTEXT:" . ":_('" . $string . "')"] + = "'" . $key_lang . "'"; + $lang_holders['JustTEXT:' . ':_("' . $string . '")'] + = '"' . $key_lang . '"'; + } + } + } + // only continue if we have value to replace + if (ArrayHelper::check($lang_holders)) + { + $content = $this->placeholder->update($content, $lang_holders); + } + } + + return $content; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Language/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php new file mode 100644 index 000000000..ff1120415 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php @@ -0,0 +1,262 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; + + +/** + * Compiler Placeholder + * + * @since 3.2.0 + */ +class Placeholder +{ + /** + * The active placeholders + * + * @var array + * @since 3.2.0 + **/ + public array $active = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Compiler::_('Config'); + } + + /** + * Set a type of placeholder with set of values + * + * @param string $key The main string for placeholder key + * @param array $values The values to add + * + * @return void + * @since 3.2.0 + */ + public function setType(string $key, array $values) + { + // always fist reset the type + $this->clearType($key); + + // only add if there are values + if (ArrayHelper::check($values)) + { + $number = 0; + foreach ($values as $value) + { + $this->active[Placefix::_($key . $number)] + = $value; + $number++; + } + } + } + + /** + * Remove a type of placeholder by main key + * + * @param string $key The main string for placeholder key + * + * @return void + * @since 3.2.0 + */ + public function clearType(string $key) + { + $key = Placefix::_($key); + + $this->active = array_filter( + $this->active, + function(string $k) use($key){ + return preg_replace('/\d/', '', $k) !== $key; + }, + ARRAY_FILTER_USE_KEY + ); + } + + /** + * Update the data with the placeholders + * + * @param string $data The actual data + * @param array $placeholder The placeholders + * @param int $action The action to use + * + * THE ACTION OPTIONS ARE + * 1 -> Just replace (default) + * 2 -> Check if data string has placeholders + * 3 -> Remove placeholders not in data string + * + * @return string + * @since 3.2.0 + */ + public function update(string $data, array &$placeholder, int $action = 1): string + { + // make sure the placeholders is an array + if (!ArrayHelper::check($placeholder)) + { + // This is an error, (TODO) actualy we need to add a kind of log here to know that this happened + return $data; + } + // continue with the work of replacement + if (1 == $action) // <-- just replace (default) + { + return str_replace( + array_keys($placeholder), array_values($placeholder), $data + ); + } + elseif (2 == $action) // <-- check if data string has placeholders + { + $replace = false; + foreach ($placeholder as $key => $val) + { + if (strpos($data, $key) !== false) + { + $replace = true; + break; + } + } + // only replace if the data has these placeholder values + if ($replace === true) + { + + return str_replace( + array_keys($placeholder), array_values($placeholder), $data + ); + } + } + elseif (3 == $action) // <-- remove placeholders not in data string + { + $replace = $placeholder; + foreach ($replace as $key => $val) + { + if (strpos($data, $key) === false) + { + unset($replace[$key]); + } + } + // only replace if the data has these placeholder values + if (ArrayHelper::check($replace)) + { + return str_replace( + array_keys($replace), array_values($replace), $data + ); + } + } + + return $data; + } + + /** + * return the placeholders for inserted and replaced code + * + * @param int $type The type of placement + * @param int|null $id The code id in the system + * + * @return array on success + * @since 3.2.0 + */ + public function keys(int $type, ?int $id = null) + { + switch ($type) + { + case 3: + return [ 'start' => "", 'end' => ""]; + break; + case 11: + //***[REPLACED$$$$]***//**1**/ + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '/***[REPLACED$$$$]***//**' . $id . '**/', + 'end' => '/***[/REPLACED$$$$]***/' + ]; + } + else + { + return [ 'start' => "", 'end' => ""]; + } + break; + case 12: + //***[INSERTED$$$$]***//**1**/ + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '/***[INSERTED$$$$]***//**' . $id . '**/', + 'end' => '/***[/INSERTED$$$$]***/' + ]; + } + else + { + return [ 'start' => "", 'end' => ""]; + } + break; + case 21: + // + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '', + 'end' => '' + ]; + } + else + { + return [ 'start' => "", 'end' => ""]; + } + break; + case 22: + // + if ($this->config->get('add_placeholders', false) === true) + { + return [ + 'start' => '', + 'end' => '' + ]; + } + else + { + return [ 'start' => "", 'end' => ""]; + } + break; + case 33: + return ['start' => Placefix::h(), 'end' => Placefix::h()]; + break; + case 66: + return ['start' => Placefix::b(), 'end' => Placefix::d()]; + break; + } + + return false; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/Reverse.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/Reverse.php new file mode 100644 index 000000000..a41a4a98d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/Reverse.php @@ -0,0 +1,243 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Placeholder; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Language; +use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor; + + +/** + * Compiler Placeholder Reverse + * + * @since 3.2.0 + */ +class Reverse +{ + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Language + * + * @var Language + * @since 3.2.0 + **/ + protected Language $language; + + /** + * Compiler Language Extractor + * + * @var Extractor + * @since 3.2.0 + **/ + protected Extractor $extractor; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Language|null $language The compiler language object. + * @param Extract|null $extractor The compiler language extractor object. + * + * @since 3.2.0 + */ + public function __construct( + ?Config $config = null, ?Placeholder $placeholder = null, + ?Language $language = null, ?Extractor $extractor = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->language = $language ?: Compiler::_('Language'); + $this->extractor = $extractor ?: Compiler::_('Language.Extractor'); + } + + /** + * Reverse Engineer the dynamic placeholders (TODO hmmmm this is not ideal) + * + * @param string $string The string to revers + * @param array $placeholders The values to search for + * @param string $target The target path type + * @param int|null $id The custom code id + * @param string $field The field name + * @param string $table The table name + * + * @return string + * @since 3.2.0 + */ + public function engine(string $string, array &$placeholders, + string $target, ?int $id = null, $field = 'code', $table = 'custom_code'): string + { + // get local code if set + if ($id > 0 && $code = base64_decode( + GetHelper::var($table, $id, 'id', $field) + )) + { + $string = $this->setReverse( + $string, $code, $target + ); + } + + return $this->placeholder->update($string, $placeholders, 2); + } + + /** + * Set the language strings for the reveres process + * + * @param string $updateString The string to update + * @param string $string The string to use language update + * @param string $target The target path type + * + * @return string + * @since 3.2.0 + */ + protected function setReverse(string $updateString, string $string, string $target): string + { + // get targets to search for + $lang_string_targets = array_filter( + $this->config->lang_string_targets, function ($get) use ($string) { + if (strpos($string, $get) !== false) + { + return true; + } + + return false; + } + ); + // check if we should continue + if (ArrayHelper::check($lang_string_targets)) + { + // start lang holder + $lang_holders = array(); + // set the lang for both since we don't know what area is being targeted + $_tmp = $this->config->lang_target; + // set the lang based on target + if (strpos($target, 'module') !== false) + { + // backup lang prefix + $_tmp_lang_prefix = $this->config->lang_prefix; + // set the new lang prefix + $lang_prefix = strtoupper( + str_replace('module', 'mod', $target) + ); + $this->config->set('lang_prefix', $lang_prefix); + // now set the lang + if (isset($this->extractor->langKeys[$this->config->lang_prefix])) + { + $this->config->lang_target = $this->extractor->langKeys[$this->config->lang_prefix]; + } + else + { + $this->config->lang_target = 'module'; + } + } + elseif (strpos($target, 'plugin') !== false) + { + // backup lang prefix + $_tmp_lang_prefix = $this->config->lang_prefix; + // set the new lang prefix + $lang_prefix = strtoupper( + str_replace('plugin', 'plg', $target) + ); + $this->config->set('lang_prefix', $lang_prefix); + // now set the lang + if (isset($this->extractor->langKeys[$this->config->lang_prefix])) + { + $this->config->lang_target = $this->extractor->langKeys[$this->config->lang_prefix]; + } + else + { + $this->config->lang_target = 'plugin'; + } + } + else + { + $this->config->lang_target = 'both'; + } + // set language data + foreach ($lang_string_targets as $lang_string_target) + { + $lang_check[] = GetHelper::allBetween( + $string, $lang_string_target . "'", "'" + ); + $lang_check[] = GetHelper::allBetween( + $string, $lang_string_target . "'", "'" + ); + } + // merge arrays + $lang_array = ArrayHelper::merge($lang_check); + // continue only if strings were found + if (ArrayHelper::check( + $lang_array + )) //<-- not really needed hmmm + { + foreach ($lang_array as $lang) + { + $_key_lang = StringHelper::safe($lang, 'U'); + // this is there to insure we dont break already added Language strings + if ($_key_lang === $lang) + { + continue; + } + // build lang key + $key_lang = $this->config->lang_prefix . '_' . $_key_lang; + // set lang content string + $this->language->set($this->config->lang_target, $key_lang, $lang); + // reverse the placeholders + foreach ($lang_string_targets as $lang_string_target) + { + $lang_holders[$lang_string_target . "'" . $key_lang . "'"] + = $lang_string_target . "'" . $lang . "'"; + $lang_holders[$lang_string_target . '"' . $key_lang . '"'] + = $lang_string_target . '"' . $lang . '"'; + } + } + // return the found placeholders + $updateString = $this->placeholder->replace( + $updateString, $lang_holders + ); + } + // reset the lang + $this->config->lang_target = $_tmp; + // also rest the lang prefix if set + if (isset($_tmp_lang_prefix)) + { + $lang_prefix = $_tmp_lang_prefix; + $this->config->set('lang_prefix', $_tmp_lang_prefix); + } + } + + return $updateString; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php new file mode 100644 index 000000000..3afc35771 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php @@ -0,0 +1,517 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\GuidHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; + + +/** + * Compiler Power + * + * @since 3.2.0 + */ +class Power +{ + /** + * All loaded powers + * + * @var array + * @since 3.2.0 + **/ + public array $active = []; + + /** + * The state of all loaded powers + * + * @var array + * @since 3.2.0 + **/ + protected array $state = []; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + **/ + protected Customcode $customcode; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * @param Gui|null $gui The compiler customcode gui object. + * @param \JDatabaseDriver|null $db The Database Driver object. + * @param CMSApplication|null $app The CMS Application object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Placeholder $placeholder = null, + ?Customcode $customcode = null, ?Gui $gui = null, + ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->db = $db ?: Factory::getDbo(); + $this->app = $app ?: Factory::getApplication(); + } + + /** + * load all the powers linked to this component + * + * @param array $guids The global unique ids of the linked powers + * + * @return void + * @since 3.2.0 + */ + public function load(array $guids) + { + if (ArrayHelper::check($guids)) + { + foreach ($guids as $guid => $build) + { + $this->get($guid, $build); + } + } + } + + /** + * Get a power + * + * @param string $guid The global unique id of the power + * @param int $build Force build switch (to override global switch) + * + * @return mixed + * @since 3.2.0 + */ + public function get(string $guid, int $build = 0) + { + if (($this->config->get('add_power', true) || $build == 1) && $this->set($guid)) + { + return $this->active[$guid]; + } + + return false; + } + + /** + * Set a power + * + * @param string $guid The global unique id of the power + * + * @return bool + * @since 3.2.0 + */ + protected function set(string $guid): bool + { + // check if we have been here before + if (isset($this->state[$guid])) + { + return $this->state[$guid]; + } + elseif (GuidHelper::valid($guid)) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + // from these tables + $query->from('#__componentbuilder_power AS a'); + $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // make sure that in recursion we + // don't try to load this power again + $this->state[$guid] = true; + // get the power data + $this->active[$guid] = $this->db->loadObject(); + // make sure to add any language strings found to all language files + // since we can't know where this is used at this point + $tmp_lang_target = $this->config->lang_target; + $this->config->lang_target = 'both'; + // we set the fix usr if needed + $fix_url + = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id=' + . $this->active[$guid]->id . '" target="_blank"'; + // set some keys + $this->active[$guid]->target_type = 'P0m3R!'; + $this->active[$guid]->key = $this->active[$guid]->id . '_' . $this->active[$guid]->target_type; + // now set the name + $this->active[$guid]->name = $this->placeholder->update( + $this->customcode->add($this->active[$guid]->name), + $this->placeholder->active + ); + // now set the code_name and class name + $this->active[$guid]->code_name = $this->active[$guid]->class_name = ClassfunctionHelper::safe( + $this->active[$guid]->name + ); + // set official name + $this->active[$guid]->official_name = StringHelper::safe( + $this->active[$guid]->name, 'W' + ); + // set namespace + $this->active[$guid]->namespace = $this->placeholder->update( + $this->active[$guid]->namespace, $this->placeholder->active + ); + // validate namespace + if (strpos($this->active[$guid]->namespace, '\\') === false) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst($this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $fix_url), + 'Error' + ); + $this->state[$guid] = false; + unset($this->active[$guid]); + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + // we break out here + return false; + } + else + { + // setup the path array + $path_array = (array) explode('\\', $this->active[$guid]->namespace); + // make sure all sub folders in src dir is set and remove all characters that will not work in folders naming + $this->active[$guid]->namespace = NamespaceHelper::safe(str_replace('.', '\\', $this->active[$guid]->namespace)); + // make sure it has two or more + if (ArrayHelper::check($path_array) <= 1) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst($this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->namespace, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $this->active[$guid]->type, + $fix_url), + 'Error' + ); + $this->state[$guid] = false; + unset($this->active[$guid]); + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + // we break out here + return false; + } + // get the file and class name (the last value in array) + $file_name = array_pop($path_array); + // src array bucket + $src_array = array(); + // do we have src folders + if (strpos($file_name, '.') !== false) + { + // we have src folders in the namespace + $src_array = (array) explode('.', $file_name); + // get the file and class name (the last value in array) + $this->active[$guid]->file_name = array_pop($src_array); + // namespace array + $namespace_array = array_merge($path_array, $src_array); + } + else + { + // set the file name + $this->active[$guid]->file_name = $file_name; + // namespace array + $namespace_array = $path_array; + } + // the last value is the same as the class name + if ($this->active[$guid]->file_name !== $this->active[$guid]->class_name) + { + // we raise an error message + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDING_FILE_NAME_IN_THE_NAMESPACE_IS_BSB_THIS_IS_BAD_CONVENTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPA_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP', + ucfirst($this->active[$guid]->type), $this->active[$guid]->name, $this->active[$guid]->type, $this->active[$guid]->class_name, $this->active[$guid]->file_name, + '"https://www.php-fig.org/psr/psr-4/" target="_blank"', + $fix_url), + 'Error' + ); + $this->state[$guid] = false; + unset($this->active[$guid]); + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + // we break out here + return false; + } + // make sure the arrays are namespace safe + $path_array = array_map(function ($val) { + return NamespaceHelper::safe($val); + }, $path_array); + $namespace_array = array_map(function ($val) { + return NamespaceHelper::safe($val); + }, $namespace_array); + // set the actual class namespace + $this->active[$guid]->_namespace = implode('\\', $namespace_array); + // prefix values + $this->active[$guid]->_namespace_prefix = $path_array; + // get the parent folder (the first value in array) + $prefix_folder = implode('.', $path_array); + // make sub folders if still found + $sub_folder = ''; + if (ArrayHelper::check($src_array)) + { + // make sure the arrays are namespace safe + $sub_folder = '/' . implode('/', array_map(function ($val) { + return NamespaceHelper::safe($val); + }, $src_array)); + } + // now we set the paths + $this->active[$guid]->path_jcb = $this->config->get('jcb_powers_path', 'libraries/jcb_powers'); + $this->active[$guid]->path_parent = $this->active[$guid]->path_jcb . '/' . $prefix_folder; + $this->active[$guid]->path = $this->active[$guid]->path_parent . '/src' . $sub_folder; + } + // load use ids + $use = array(); + $as = array(); + // check if we have use selection + $this->active[$guid]->use_selection = (isset($this->active[$guid]->use_selection) + && JsonHelper::check( + $this->active[$guid]->use_selection + )) ? json_decode($this->active[$guid]->use_selection, true) : null; + if ($this->active[$guid]->use_selection) + { + $use = array_values(array_map(function ($u) use(&$as) { + // track the AS options + if (empty($u['as'])) + { + $as[$u['use']] = 'default'; + } + else + { + $as[$u['use']] = (string) $u['as']; + } + // return the guid + return $u['use']; + }, $this->active[$guid]->use_selection)); + } + // check if we have load selection + $this->active[$guid]->load_selection = (isset($this->active[$guid]->load_selection) + && JsonHelper::check( + $this->active[$guid]->load_selection + )) ? json_decode($this->active[$guid]->load_selection, true) : null; + if ($this->active[$guid]->load_selection) + { + // load use ids + array_map(function ($l) { + // just load it directly and be done with it + return $this->set($l['load']); + }, $this->active[$guid]->load_selection); + } + // see if we have implements + $this->active[$guid]->implement_names = array(); + // does this implement + $this->active[$guid]->implements = (isset($this->active[$guid]->implements) + && JsonHelper::check( + $this->active[$guid]->implements + )) ? json_decode($this->active[$guid]->implements, true) : null; + if ($this->active[$guid]->implements) + { + foreach ($this->active[$guid]->implements as $implement) + { + if ($implement == -1 + && StringHelper::check($this->active[$guid]->implements_custom)) + { + $this->active[$guid]->implement_names[] = $this->placeholder->update( + $this->customcode->add($this->active[$guid]->implements_custom), + $this->placeholder->active + ); + // just add this once + unset($this->active[$guid]->implements_custom); + } + // does this extend existing + elseif (GuidHelper::valid($implement)) + { + // check if it was set + if ($this->set($implement)) + { + // get the name + $this->active[$guid]->implement_names[] = $this->get($implement, 1)->class_name; + // add to use + $use[] = $implement; + } + } + } + } + // does this extend something + $this->active[$guid]->extends_name = null; + // we first check for custom extending options + if ($this->active[$guid]->extends == -1 + && StringHelper::check($this->active[$guid]->extends_custom)) + { + $this->active[$guid]->extends_name = $this->placeholder->update( + $this->customcode->add($this->active[$guid]->extends_custom), + $this->placeholder->active + ); + // just add once + unset($this->active[$guid]->extends_custom); + } + // does this extend existing + elseif (GuidHelper::valid($this->active[$guid]->extends)) + { + // check if it was set + if ($this->set($this->active[$guid]->extends)) + { + // get the name + $this->active[$guid]->extends_name = $this->get($this->active[$guid]->extends, 1)->class_name; + // add to use + $use[] = $this->active[$guid]->extends; + } + } + // set GUI mapper + $guiMapper = array('table' => 'power', 'id' => (int) $this->active[$guid]->id, 'type' => 'php'); + // add the header script + if ($this->active[$guid]->add_head == 1) + { + // set GUI mapper field + $guiMapper['field'] = 'head'; + // base64 Decode code + $this->active[$guid]->head = $this->gui->set( + $this->placeholder->update( + $this->customcode->add( + base64_decode( + $this->active[$guid]->head + ) + ), $this->placeholder->active + ), + $guiMapper + ) . PHP_EOL; + } + // now add all the extra use statements + if (ArrayHelper::check($use)) + { + foreach (array_unique($use) as $u) + { + if ($this->set($u)) + { + $add_use = $this->get($u, 1)->namespace; + // check if it is already added manually, you know how some people are + if (strpos($this->active[$guid]->head, $add_use) === false) + { + // check if it has an AS option + if (isset($as[$u]) && StringHelper::check($as[$u]) && $as[$u] !== 'default') + { + $this->active[$guid]->head .= 'use ' . $add_use . ' as ' . $as[$u] . ';' . PHP_EOL; + } + else + { + $this->active[$guid]->head .= 'use ' . $add_use . ';' . PHP_EOL; + } + } + } + } + } + // now set the description + $this->active[$guid]->description = (StringHelper::check($this->active[$guid]->description)) ? $this->placeholder->update( + $this->customcode->add($this->active[$guid]->description), + $this->placeholder->active + ) : ''; + // add the main code if set + if (StringHelper::check($this->active[$guid]->main_class_code)) + { + // set GUI mapper field + $guiMapper['field'] = 'main_class_code'; + // base64 Decode code + $this->active[$guid]->main_class_code = $this->gui->set( + $this->placeholder->update( + $this->customcode->add( + base64_decode( + $this->active[$guid]->main_class_code + ) + ), $this->placeholder->active + ), + $guiMapper + ); + } + // reset back to starting value + $this->config->lang_target = $tmp_lang_target; + + return true; + } + } + // we failed to get the power, + // so we raise an error message + // only if guid is valid + if (GuidHelper::valid($guid)) + { + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP', $guid), + 'Error' + ); + } + // let's not try again + $this->state[$guid] = false; + + return false; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php new file mode 100644 index 000000000..9d7e52bf7 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php @@ -0,0 +1,56 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder as ComponentPlaceholder; + + +/** + * Component Service Provider + * + * @since 3.2.0 + */ +class Component implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(ComponentPlaceholder::class, 'Component.Placeholder') + ->share('Component.Placeholder', [$this, 'getComponentPlaceholder'], true); + } + + /** + * Get the Component Placeholders + * + * @param Container $container The DI container. + * + * @return ComponentPlaceholder + * @since 3.2.0 + */ + public function getComponentPlaceholder(Container $container): ComponentPlaceholder + { + return new ComponentPlaceholder( + $container->get('Config') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Config.php new file mode 100644 index 000000000..08372e34a --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Config.php @@ -0,0 +1,54 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Config as CompilerConfig; + + +/** + * Compiler Config Service Provider + * + * @since 3.2.0 + */ +class Config implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerConfig::class, 'Config') + ->share('Config', [$this, 'getConfig'], true); + } + + /** + * Get the Compiler Configurations + * + * @param Container $container The DI container. + * + * @return CompilerConfig + * @since 3.2.0 + */ + public function getConfig(Container $container): CompilerConfig + { + return new CompilerConfig(); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php new file mode 100644 index 000000000..ad55c797e --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php @@ -0,0 +1,99 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Customcode as CompilerCustomcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\External; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; + + +/** + * Compiler Custom Code Service Provider + * + * @since 3.2.0 + */ +class Customcode implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerCustomcode::class, 'Customcode') + ->share('Customcode', [$this, 'getCustomcode'], true); + + $container->alias(External::class, 'Customcode.External') + ->share('Customcode.External', [$this, 'getExternal'], true); + + $container->alias(Gui::class, 'Customcode.Gui') + ->share('Customcode.Gui', [$this, 'getGui'], true); + } + + /** + * Get the Compiler Customcode + * + * @param Container $container The DI container. + * + * @return CompilerCustomcode + * @since 3.2.0 + */ + public function getCustomcode(Container $container): CompilerCustomcode + { + return new CompilerCustomcode( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Language.Extractor'), + $container->get('Customcode.External') + ); + } + + /** + * Get the Compiler Customcode External + * + * @param Container $container The DI container. + * + * @return External + * @since 3.2.0 + */ + public function getExternal(Container $container): External + { + return new External( + $container->get('Placeholder') + ); + } + + /** + * Get the Compiler Customcode Gui + * + * @param Container $container The DI container. + * + * @return Gui + * @since 3.2.0 + */ + public function getGui(Container $container): Gui + { + return new Gui( + $container->get('Config'), + $container->get('Placeholder.Reverse') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php new file mode 100644 index 000000000..4f892f35d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php @@ -0,0 +1,55 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; + + +/** + * Event Service Provider + * + * @since 3.2.0 + */ +class Event implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3Event::class, 'J3.Event') + ->share('J3.Event', [$this, 'getJ3Event'], true); + } + + /** + * Get the Joomla 3 Event + * + * @param Container $container The DI container. + * + * @return EventInterface + * @since 3.2.0 + */ + public function getJ3Event(Container $container): EventInterface + { + return new J3Event(); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php new file mode 100644 index 000000000..72b6c0445 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php @@ -0,0 +1,55 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface; +use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as J3InstallScript; + + +/** + * Extension Script Service Provider + * + * @since 3.2.0 + */ +class Extension implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3InstallScript::class, 'J3.Extension.InstallScript') + ->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true); + } + + /** + * Get the Joomla 3 Extension Install Script + * + * @param Container $container The DI container. + * + * @return GetScriptInterface + * @since 3.2.0 + */ + public function getJ3ExtensionInstallScript(Container $container): GetScriptInterface + { + return new J3InstallScript(); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Language.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Language.php new file mode 100644 index 000000000..786cb6138 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Language.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Language as CompilerLanguage; +use VDM\Joomla\Componentbuilder\Compiler\Language\Extractor; + + +/** + * Compiler Language Service Provider + * + * @since 3.2.0 + */ +class Language implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerLanguage::class, 'Language') + ->share('Language', [$this, 'getLanguage'], true); + + $container->alias(Extractor::class, 'Language.Extractor') + ->share('Language.Extractor', [$this, 'getLanguageExtractor'], true); + } + + /** + * Get the Compiler Language + * + * @param Container $container The DI container. + * + * @return CompilerLanguage + * @since 3.2.0 + */ + public function getLanguage(Container $container): CompilerLanguage + { + return new CompilerLanguage( + $container->get('Config') + ); + } + + /** + * Get the Compiler Language Extractor + * + * @param Container $container The DI container. + * + * @return Extractor + * @since 3.2.0 + */ + public function getLanguageExtractor(Container $container): Extractor + { + return new Extractor( + $container->get('Config'), + $container->get('Language'), + $container->get('Placeholder') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Placeholder.php new file mode 100644 index 000000000..844732cce --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Placeholder.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder as CompilerPlaceholder; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder\Reverse; + + +/** + * Compiler Placeholder Service Provider + * + * @since 3.2.0 + */ +class Placeholder implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerPlaceholder::class, 'Placeholder') + ->share('Placeholder', [$this, 'getPlaceholder'], true); + + $container->alias(Reverse::class, 'Placeholder.Reverse') + ->share('Placeholder.Reverse', [$this, 'getPlaceholderReverse'], true); + } + + /** + * Get the Compiler Placeholder + * + * @param Container $container The DI container. + * + * @return CompilerPlaceholder + * @since 3.2.0 + */ + public function getPlaceholder(Container $container): CompilerPlaceholder + { + return new CompilerPlaceholder( + $container->get('Config') + ); + } + + /** + * Get the Compiler Placeholder Reverse + * + * @param Container $container The DI container. + * + * @return Worker + * @since 3.2.0 + */ + public function getPlaceholderReverse(Container $container): Reverse + { + return new Reverse( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Language.Extractor') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php new file mode 100644 index 000000000..b13b3d4e4 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php @@ -0,0 +1,59 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Power as CompilerPower; + + +/** + * Compiler Power Service Provider + * + * @since 3.2.0 + */ +class Power implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerPower::class, 'Power') + ->share('Power', [$this, 'getPower'], true); + } + + /** + * Get the Compiler Power + * + * @param Container $container The DI container. + * + * @return CompilerPower + * @since 3.2.0 + */ + public function getPower(Container $container): CompilerPower + { + return new CompilerPower( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Customcode.Gui') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php new file mode 100644 index 000000000..ff3422f1b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php @@ -0,0 +1,90 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; + + +/** + * The Indentation Factory + * + * @since 3.2.0 + */ +abstract class Indent +{ + /** + * Spacer bucket (to speed-up the build) + * + * @var array + * @since 3.2.0 + */ + private static array $bucket = []; + + /** + * The indentation string + * + * @var string + * @since 3.2.0 + */ + private static string $indent; + + /** + * Set the space + * + * @param int $nr The number of spaces + * + * @return string + * @since 3.2.0 + */ + public function _(int $nr): string + { + // check if we already have the string + if (!isset(self::$bucket[$nr])) + { + // get the string + self::$bucket[$nr] = str_repeat(self::indent(), (int) $nr); + } + // return stored indentation + return self::$bucket[$nr]; + } + + /** + * Get the indentation string + * + * @return string + * @since 3.2.0 + */ + private static function indent(): string + { + if (empty(self::$indent)) + { + self::init(); + } + + return self::$indent; + } + + /** + * The constructor for indent + * + * @return void + * @since 3.2.0 + */ + private static function init() + { + // the default is TAB + self::$indent = Compiler::_('Config')->indentation_value; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Line.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Line.php new file mode 100644 index 000000000..b000153c7 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Line.php @@ -0,0 +1,79 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; + + +/** + * The Debug Line Number Factory + * + * @since 3.2.0 + */ +abstract class Line +{ + /** + * Should we add debug lines + * + * @since 3.2.0 + **/ + private static $add = 'check'; + + /** + * Set the line number in comments + * + * @param int $nr The line number + * @param string $class The class name + * + * @return string + * @since 3.2.0 + */ + public static function _(int $nr, string $class): string + { + if (self::add()) + { + return ' [' . $class . ' ' . $nr . ']'; + } + + return ''; + } + + /** + * Check if we should add the line number + * + * @return bool + * @since 3.2.0 + */ + private static function add(): bool + { + if (!is_bool(self::$add)) + { + self::init(); + } + + return self::$add; + } + + /** + * The constructor for add + * + * @return void + * @since 3.2.0 + */ + private static function init() + { + self::$add = Compiler::_('Config')->debug_line_nr; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Placefix.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Placefix.php new file mode 100644 index 000000000..db5c11214 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Placefix.php @@ -0,0 +1,106 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +/** + * The Placeholder Prefix and Suffix Factory + * + * @since 3.2.0 + */ +abstract class Placefix +{ + /** + * The hash prefix and suffix + * + * @var string + * @since 3.2.0 + **/ + private static $hhh = '#' . '#' . '#'; + + /** + * The open prefix + * + * @var string + * @since 3.2.0 + **/ + private static $bbb = '[' . '[' . '['; + + /** + * The close suffix + * + * @var string + * @since 3.2.0 + **/ + private static $ddd = ']' . ']' . ']'; + + /** + * Get a prefix and suffix added to given string + * + * @param string $class The class name + * + * @return string + * @since 3.2.0 + */ + public static function _(string $string): string + { + return self::b() . $string . self::d(); + } + + /** + * Get a open prefix + * + * @return string + * @since 3.2.0 + */ + public static function b(): string + { + return self::$bbb; + } + + /** + * Get a close suffix + * + * @return string + * @since 3.2.0 + */ + public static function d(): string + { + return self::$ddd; + } + + /** + * Get a hash prefix and suffix added to given string + * + * @param string $class The class name + * + * @return string + * @since 3.2.0 + */ + public static function _h(string $string): string + { + return self::h() . $string . self::h(); + } + + /** + * Get a hash-fix + * + * @return string + * @since 3.2.0 + */ + public static function h(): string + { + return self::$hhh; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php deleted file mode 100644 index 20fdeb033..000000000 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Factory/Compiler/Config.php +++ /dev/null @@ -1,257 +0,0 @@ - - * @git Joomla Component Builder - * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -namespace VDM\Joomla\Componentbuilder\Factory\Compiler; - - -use Joomla\CMS\Factory; -use Joomla\Registry\Registry; -use VDM\Joomla\Componentbuilder\Compiler\Config as CompilerConfig; -use VDM\Joomla\Utilities\ArrayHelper; - - -/** - * Factory to load the compiler config - */ -abstract class Config -{ - /** - * Global Config object - * - * @var CompilerConfig - * @since 3.1.6 - **/ - protected static $CompilerConfig = null; - - /** - * Get a value. - * - * @param string $path Registry path (e.g. version) - * @param mixed $default Optional default value, returned if the internal value is null. - * - * @return mixed Value of entry or null - * - * @since 3.1.6 - */ - public static function get(string $path, $default = null) - { - // check that if we already have config registry set - if (!self::$CompilerConfig) - { - // create config registry - self::$CompilerConfig = self::create(); - } - - // return the value or default if none is found - return self::$CompilerConfig->get($path, $default); - } - - /** - * Check if a registry path exists. - * - * @param string $path Registry path (e.g. guid.main.0.path) - * - * @return boolean - * - * @since 3.1.6 - */ - public static function exists($path) - { - // check that if we already have config registry set - if (!self::$CompilerConfig) - { - // create config registry - self::$CompilerConfig = self::create(); - } - - // check if exists - return self::$CompilerConfig->exists($path); - } - - /** - * Method to extract a sub-registry from path - * - * @param string $path Registry path (e.g. guid.main) - * - * @return Registry Registry object (empty if no data is present) - * - * @since 3.1.6 - */ - public function extract($path) - { - if (!self::exists($path)) - { - // create config registry - return new Registry(); - } - - return self::$CompilerConfig->extract($path); - } - - /** - * Gets this object represented as an ArrayIterator. - * - * This allows the data properties to be accessed via a foreach statement. - * - * @return \ArrayIterator This object represented as an ArrayIterator. - * - * @see IteratorAggregate::getIterator() - * @since 3.1.6 - */ - #[\ReturnTypeWillChange] - public static function getIterator() - { - // check that if we already have config registry set - if (!self::$CompilerConfig) - { - // create config registry - self::$CompilerConfig = self::create(); - } - - return self::$CompilerConfig->getIterator(); - } - - /** - * Set a registry value. - * - * @param string $path Registry Path (e.g. guid.main.0.url) - * @param mixed $value Value of entry - * @param string $separator The key separator - * - * @return mixed The value of the that has been set. - * - * @since 3.1.6 - */ - public static function set($path, $value, $separator = null) - { - // check that if we already have config registry set - if (!self::$CompilerConfig) - { - // create config registry - self::$CompilerConfig = self::create(); - } - - self::$CompilerConfig->set($path, $value, $separator); - } - - /** - * Delete a registry value - * - * @param string $path Registry Path (e.g. guid.main.0.url) - * - * @return mixed The value of the removed node or null if not set - * - * @since 3.1.6 - */ - public static function remove($path) - { - // check that if we already have config registry set - if (!self::$CompilerConfig) - { - // create config registry - self::$CompilerConfig = self::create(); - } - - // remove the actual value - return self::$CompilerConfig->remove($path); - } - - /** - * Transforms a namespace to an array - * - * @return array An associative array holding the namespace data - * - * @since 3.1.6 - */ - public static function toArray() - { - // check that if we already have config registry set - if (!self::$CompilerConfig) - { - // create config registry - self::$CompilerConfig = self::create(); - } - - return self::$CompilerConfig->toArray(); - } - - /** - * Transforms a namespace to an object - * - * @return object An an object holding the namespace data - * - * @since 3.1.6 - */ - public static function toObject() - { - // check that if we already have config registry set - if (!self::$CompilerConfig) - { - // create config registry - self::$CompilerConfig = self::create(); - } - - return self::$CompilerConfig->toObject(); - } - - /** - * Initialize a CompilerConfig object if id does not exist. - * - * Returns the global {@link CompilerConfig} object, only creating it if it doesn't already exist. - * - * @param array $config The data to bind to the new Config object. - * - * - * @return CompilerConfig object - * - * @see Session - * @since 3.1.6 - **/ - public static function init($config = null): CompilerConfig - { - if (!self::$CompilerConfig) - { - self::$CompilerConfig = self::create($config); - } - - return self::$CompilerConfig; - } - - /** - * Create a CompilerConfig object - * - * @param array $config The data to bind to the new Config object. - * - * @return CompilerConfig object - * @since 3.1.6 - * @throws \Exception - **/ - protected static function create($config = null): CompilerConfig - { - // get the session - $session = Factory::getSession(); - - // check if we have config - if (ArrayHelper::check($config)) - { - // save for later should we call this out of scope - $session->set('Componentbuilder.Compiler.Config', $config); - } - // if not found try loading it from the session - elseif (($config = $session->get('Componentbuilder.Compiler.Config', false)) === false) - { - throw new \Exception('Compiler configuration not found.'); - } - - return new CompilerConfig($config); - } -} - diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php deleted file mode 100644 index 070435503..000000000 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Tab.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @git Joomla Component Builder - * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -namespace VDM\Joomla\Componentbuilder; - - -/** - * Adds Tabs - * - * @since 3.1.5 - */ -trait Tab -{ - /** - * Tab/spacer bucket (to speed-up the build) - * - * @var array - * @since 3.1.5 - */ - protected $tabSpacerBucket = array(); - - /** - * Set tab/spacer - * - * @var string - * @since 3.1.5 - */ - protected $tabSpacer = "\t"; - - /** - * Set the tab/space - * - * @param int $nr The number of tag/space - * - * @return string - * @since 3.1.5 - */ - public function _t(int $nr) : string - { - // check if we already have the string - if (!isset($this->tabSpacerBucket[$nr])) - { - // get the string - $this->tabSpacerBucket[$nr] = str_repeat($this->tabSpacer, (int) $nr); - } - // return stored string - return $this->tabSpacerBucket[$nr]; - } -} - diff --git a/libraries/jcb_powers/VDM.Joomla/src/index.html b/libraries/jcb_powers/VDM.Joomla/src/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/language/en-GB/en-GB.com_componentbuilder.ini b/site/language/en-GB/en-GB.com_componentbuilder.ini index 31d1c9ab4..7a37a2961 100644 --- a/site/language/en-GB/en-GB.com_componentbuilder.ini +++ b/site/language/en-GB/en-GB.com_componentbuilder.ini @@ -41,9 +41,15 @@ COM_COMPONENTBUILDER_FREEOPEN="Free/Open" COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder will work!" COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERCOPYRIGHTHFOURPSP="

    %s

    " COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERLICENSEHFOURPSP="

    %s

    " +COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="

    External Code Error

    " +COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="

    External Code Notice

    " +COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE="

    External Code Warning

    " +COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s namespace error (%s)

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

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

    " +COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s namespace error (%s)

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

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

    " COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP="

    Curl Not Found!

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

    " COM_COMPONENTBUILDER_IAUTHORI_BSB="Author: %s" COM_COMPONENTBUILDER_ICOMPANYI_BSB="Company: %s" +COM_COMPONENTBUILDER_ID_MISMATCH_WAS_DETECTED_WITH_THE_SSSS_GUI_CODE_FIELD_SO_THE_PLACEHOLDER_WAS_NOT_SET="ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set." COM_COMPONENTBUILDER_IEMAILI_BSB="Email: %s" COM_COMPONENTBUILDER_IWEBSITEI_BSB="Website: %s" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY="Joomla Component Builder - Backup Key" @@ -66,19 +72,28 @@ COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND="Package owner details not COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET="Package Owner Not Set" COM_COMPONENTBUILDER_PAIDLOCKED="Paid/Locked" COM_COMPONENTBUILDER_PLUGIN="Plugin" +COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP="

    Power guid:%s not found!

    " COM_COMPONENTBUILDER_PROPERTY="Property" +COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDING_FILE_NAME_IN_THE_NAMESPACE_IS_BSB_THIS_IS_BAD_CONVENTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPA_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s naming mismatch error (%s)

    The %s name is %s and the ending file name in the namespace is %s. This is bad convention, please see psr-4 for more info.

    Click here to fix this issue.

    " COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S="%s
    You can add a gitHub Access Token to Componentbuilder global options to make authenticated requests to gitHub. An access token with only public access will do to retrieve %s." COM_COMPONENTBUILDER_SELECT_EXTENSION="Select Extension" COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it." COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it." COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE="Sorry this placeholder is already in use!" COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER="Sorry this placeholder is already in use in the compiler!" +COM_COMPONENTBUILDER_S_WE_DETECTED_A_CHANGE_IN_BEXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_CHANGE_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected a change in EXTERNALCODE, but you do not have permission to allow this change so %s was removed from the compilation. Please contact your system administrator for more info!
    (admin access required)" +COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMISSION_TO_ALLOW_THIS_NEW_CODESTRING_SO_BSB_WAS_REMOVED_FROM_THE_COMPILATION_PLEASE_CONTACT_YOU_SYSTEM_ADMINISTRATOR_FOR_MORE_INFOBR_SMALLADMIN_ACCESS_REQUIREDSMALL="%s, we detected NEW EXTERNALCODE, but you do not have permission to allow this new code/string so %s was removed from the compilation. Please contact you system administrator for more info!
    (admin access required)" COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key." COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key." COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The phpseclib\NET\SFTP library\class is not available! This library\class should have been added to your libraries/vdm_io/vendor folder. Please contact your system administrator for more info" +COM_COMPONENTBUILDER_THE_BSB_CUT_SEQUENCE_FAILED_ON_THE_RETURNED_EXTERNAL_CODESTRING_AS_MORE_LINES_HAS_TO_BE_CUT_THEN_WAS_FOUND_IN_THE_CODESTRING_WE_HAVE_COMPLETELY_REMOVED_THE_CODE_PLEASE_CHECK_THIS_CODESTRING="The %s cut sequence failed on the returned external code/string as more lines has to be cut then was found in the code/string. We have completely removed the code. Please check this code/string!" COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The %s file could not be moved to %s path on %s server." COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The %s file could not be moved to %s server." +COM_COMPONENTBUILDER_THE_BSB_IS_NOT_A_VALID_URLPATH="The %s is not a valid url/path!" COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The %s library\class is not available! This library\class should have been added to your libraries/phpseclib/vendor folder. Please contact your system administrator for more info!" +COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING="The %s returned an invalid string!" +COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been added for the first time. Please investigate to ensure the correct code/string was used! Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention! Do not ignore this warning as it will only show once." +COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been changed since the last compilation. Please investigate to ensure the changes are safe! Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention! Do not ignore this warning as it will only show once." COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for %s could not be made. Please check your signature details!" COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for %s was not well formed, please check your signature details!" COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to %s has failed, please check that your details are correct!" diff --git a/site/models/api.php b/site/models/api.php index 3d3e30ac0..2e4c557b5 100644 --- a/site/models/api.php +++ b/site/models/api.php @@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Model\ItemModel; use Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; /** * Componentbuilder Api Item Model @@ -193,14 +194,14 @@ class ComponentbuilderModelApi extends ItemModel public function compileInstall($component) { $values = array( - 'version' => 3, - 'install' => 1, - 'component' => 0, + 'joomla_version' => 3, + 'install' => 0, + 'component_id' => 0, 'backup' => 0, 'repository' => 0, - 'placeholders' => 2, - 'debuglinenr' => 2, - 'minify' => 2 + 'add_placeholders' => 0, + 'debug_line_nr' => 0, + 'minify' => 0 ); // set the values foreach ($values as $key => $val) @@ -211,16 +212,18 @@ class ComponentbuilderModelApi extends ItemModel } } // make sure we have a component - if (isset($values['component']) && $values['component'] > 1) + if (isset($values['component_id']) && $values['component_id'] > 1) { // make sure the component is published - $published = ComponentbuilderHelper::getVar('joomla_component', (int) $values['component'], 'id', 'published'); + $published = ComponentbuilderHelper::getVar('joomla_component', (int) $values['component_id'], 'id', 'published'); // make sure the component is checked in - $checked_out = ComponentbuilderHelper::getVar('joomla_component', (int) $values['component'], 'id', 'checked_out'); + $checked_out = ComponentbuilderHelper::getVar('joomla_component', (int) $values['component_id'], 'id', 'checked_out'); if (1 == $published && $checked_out == 0) { + // load the config values + CFactory::_('Config')->loadArray($values, true); // start up Compiler - $this->compiler = new Compiler($values); + $this->compiler = new Compiler(); if($this->compiler) { // component was compiled @@ -228,12 +231,12 @@ class ComponentbuilderModelApi extends ItemModel // get compiler model to run the installer $model = ComponentbuilderHelper::getModel('compiler', JPATH_COMPONENT_ADMINISTRATOR); // now install components - if (1 == $values['install'] && $model->install($this->compiler->componentFolderName.'.zip')) + if (1 == CFactory::_('Config')->install && $model->install($this->compiler->componentFolderName.'.zip')) { // component was installed $this->messages[] = JText::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_SUCCESSFULLY_INSTALLED_AND_REMOVED_FROM_TEMP_FOLDER', $this->compiler->componentFolderName); } - elseif (1 != $values['install']) + elseif (1 != CFactory::_('Config')->install) { jimport('joomla.filesystem.file'); $config = JFactory::getConfig(); -- 2.45.1 From abe9b5d227d15d65cd369bef075cec35028cfaed Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 31 Aug 2022 13:49:01 +0200 Subject: [PATCH 06/49] Adds the customcode dispencer class --- README.md | 6 +- admin/README.txt | 6 +- admin/helpers/compiler/a_Get.php | 340 ++++++------------ admin/helpers/compiler/b_Structure.php | 4 +- admin/helpers/compiler/e_Interpretation.php | 104 +++--- admin/helpers/compiler/f_Infusion.php | 68 ++-- componentbuilder.xml | 2 +- .../Compiler/Customcode/Dispenser.php | 283 +++++++++++++++ .../Compiler/Customcode/Hash.php | 110 ++++++ .../Compiler/Customcode/LockBase.php | 85 +++++ .../Compiler/Service/Customcode.php | 61 ++++ 11 files changed, 739 insertions(+), 330 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Dispenser.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Hash.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/LockBase.php diff --git a/README.md b/README.md index 84cd3b690..6f5a0b002 100644 --- a/README.md +++ b/README.md @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 30th August, 2022 ++ *Last Build*: 31st August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **319334** ++ *Line count*: **319873** + *Field count*: **2002** -+ *File count*: **2087** ++ *File count*: **2090** + *Folder count*: **359** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 84cd3b690..6f5a0b002 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 30th August, 2022 ++ *Last Build*: 31st August, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **319334** ++ *Line count*: **319873** + *Field count*: **2002** -+ *File count*: **2087** ++ *File count*: **2090** + *Folder count*: **359** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 5da9bf912..bafeb57cf 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -648,6 +648,7 @@ class Get * The Custom Script Builder * * @var array + * @deprecated 3.3 Use CFactory::_('Customcode.Dispenser')->hub; */ public $customScriptBuilder = array(); @@ -1716,17 +1717,17 @@ class Get // add_javascript if ($component->add_javascript == 1) { - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->javascript, 'component_js', - false, - false, + null, + null, $guiMapper ); } else { - $this->customScriptBuilder['component_js'] = ''; + CFactory::_('Customcode.Dispenser')->hub['component_js'] = ''; } unset($component->javascript); @@ -1742,14 +1743,14 @@ class Get $component->{'css_' . $area} )) { - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->{'css_' . $area}, 'component_css_' . $area ); } else { - $this->customScriptBuilder['component_css_' . $area] = ''; + CFactory::_('Customcode.Dispenser')->hub['component_css_' . $area] = ''; } unset($component->{'css_' . $area}); } @@ -1776,17 +1777,17 @@ class Get { // set GUI mapper field $guiMapper['field'] = $scriptMethod . '_' . $scriptType; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->{$scriptMethod . '_' . $scriptType}, $scriptMethod, $scriptType, - false, + null, $guiMapper ); } else { - $this->customScriptBuilder[$scriptMethod][$scriptType] = ''; + CFactory::_('Customcode.Dispenser')->hub[$scriptMethod][$scriptType] = ''; } unset($component->{$scriptMethod . '_' . $scriptType}); } @@ -1801,18 +1802,18 @@ class Get // update GUI mapper $guiMapper['field'] = 'php_helper_admin'; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->php_helper_admin, 'component_php_helper_admin', - false, - false, + null, + null, $guiMapper ); unset($guiMapper['prefix']); } else { - $this->customScriptBuilder['component_php_helper_admin'] = ''; + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_admin'] = ''; } unset($component->php_helper); // add_admin_event @@ -1822,17 +1823,17 @@ class Get CFactory::_('Config')->lang_target = 'admin'; // update GUI mapper field $guiMapper['field'] = 'php_admin_event'; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->php_admin_event, 'component_php_admin_event', - false, - false, + null, + null, $guiMapper ); } else { - $this->customScriptBuilder['component_php_admin_event'] = ''; + CFactory::_('Customcode.Dispenser')->hub['component_php_admin_event'] = ''; } unset($component->php_admin_event); // add_php_helper_both @@ -1843,18 +1844,18 @@ class Get // update GUI mapper field $guiMapper['field'] = 'php_helper_both'; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->php_helper_both, 'component_php_helper_both', - false, - false, + null, + null, $guiMapper ); unset($guiMapper['prefix']); } else { - $this->customScriptBuilder['component_php_helper_both'] = ''; + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_both'] = ''; } // add_php_helper_site if ($component->add_php_helper_site == 1 @@ -1864,18 +1865,18 @@ class Get // update GUI mapper field $guiMapper['field'] = 'php_helper_site'; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->php_helper_site, 'component_php_helper_site', - false, - false, + null, + null, $guiMapper ); unset($guiMapper['prefix']); } else { - $this->customScriptBuilder['component_php_helper_site'] = ''; + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_site'] = ''; } unset($component->php_helper); // add_site_event @@ -1885,23 +1886,23 @@ class Get CFactory::_('Config')->lang_target = 'site'; // update GUI mapper field $guiMapper['field'] = 'php_site_event'; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->php_site_event, 'component_php_site_event', - false, - false, + null, + null, $guiMapper ); } else { - $this->customScriptBuilder['component_php_site_event'] = ''; + CFactory::_('Customcode.Dispenser')->hub['component_php_site_event'] = ''; } unset($component->php_site_event); // add_sql if ($component->add_sql == 1) { - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->sql, 'sql', 'component_sql' @@ -1911,7 +1912,7 @@ class Get // add_sql_uninstall if ($component->add_sql_uninstall == 1) { - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $component->sql_uninstall, 'sql_uninstall' ); @@ -2259,13 +2260,13 @@ class Get ); // setup token check - if (!isset($this->customScriptBuilder['token'])) + if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'])) { - $this->customScriptBuilder['token'] = array(); + CFactory::_('Customcode.Dispenser')->hub['token'] = []; } - $this->customScriptBuilder['token'][$view->name_single_code] + CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_single_code] = false; - $this->customScriptBuilder['token'][$view->name_list_code] = false; + CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_list_code] = false; // set some placeholders CFactory::_('Placeholder')->active[Placefix::_h('view')] = $view->name_single_code; @@ -2940,11 +2941,11 @@ class Get ); // update GUI mapper field $guiMapper['field'] = $scripter; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->{$scripter}, $scripter_target, $view->name_single_code, - false, + null, $guiMapper, true, true, @@ -2956,9 +2957,9 @@ class Get $view->$scripter, "task=ajax" ) !== false) { - if (!$this->customScriptBuilder['token'][$view->name_single_code]) + if (!CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_single_code]) { - $this->customScriptBuilder['token'][$view->name_single_code] + CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_single_code] = true; } } @@ -2974,11 +2975,11 @@ class Get && $view->{'add_' . $scripter} == 1 && StringHelper::check($view->{$scripter})) { - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->{$scripter}, $scripter, $view->name_single_code, - false, + null, array('prefix' => PHP_EOL), true, true, @@ -3006,11 +3007,11 @@ class Get { // update GUI mapper field $guiMapper['field'] = $scripter; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->{$scripter}, $scripter, $view->name_single_code, - false, + null, $guiMapper ); @@ -3089,11 +3090,11 @@ class Get { $guiMapper['type'] = 'html'; } - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->$importScripter, $importScripter, 'import_' . $view->name_list_code, - false, + null, $guiMapper ); unset($view->$importScripter); @@ -3101,7 +3102,7 @@ class Get else { // load the default - $this->customScriptBuilder[$importScripter]['import_' + CFactory::_('Customcode.Dispenser')->hub[$importScripter]['import_' . $view->name_list_code] = ComponentbuilderHelper::getDynamicScripts( $importScripter, true @@ -3113,7 +3114,7 @@ class Get if (isset($view->add_php_ajax) && $view->add_php_ajax == 1) { // insure the token is added to edit view atleast - $this->customScriptBuilder['token'][$view->name_single_code] + CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_single_code] = true; $addAjaxSite = false; if (isset($this->siteEditView[$id]) && $this->siteEditView[$id]) @@ -3133,10 +3134,10 @@ class Get { if ($addAjaxSite) { - $this->customScriptBuilder['site']['ajax_controller'][$view->name_single_code] + CFactory::_('Customcode.Dispenser')->hub['site']['ajax_controller'][$view->name_single_code] = array_values($view->ajax_input); } - $this->customScriptBuilder['admin']['ajax_controller'][$view->name_single_code] + CFactory::_('Customcode.Dispenser')->hub['admin']['ajax_controller'][$view->name_single_code] = array_values($view->ajax_input); $this->addAjax = true; unset($view->ajax_input); @@ -3147,7 +3148,7 @@ class Get $guiMapper['type'] = 'php'; // update GUI mapper field $guiMapper['field'] = 'php_ajaxmethod'; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->php_ajaxmethod, 'admin', 'ajax_model', @@ -3157,7 +3158,7 @@ class Get if ($addAjaxSite) { - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->php_ajaxmethod, 'site', 'ajax_model', @@ -3215,7 +3216,7 @@ class Get if ($view->source == 1 && isset($view->tables)) { // build and add the SQL dump - $this->customScriptBuilder['sql'][$view->name_single_code] + CFactory::_('Customcode.Dispenser')->hub['sql'][$view->name_single_code] = $this->buildSqlDump( $view->tables, $view->name_single_code, $id ); @@ -3224,7 +3225,7 @@ class Get elseif ($view->source == 2 && isset($view->sql)) { // add the SQL dump string - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->sql, 'sql', $view->name_single_code @@ -3577,7 +3578,7 @@ class Get ? json_decode($view->ajax_input, true) : null; if (ArrayHelper::check($view->ajax_input)) { - $this->customScriptBuilder[$target]['ajax_controller'][$view->code] + CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller'][$view->code] = array_values($view->ajax_input); $setAjax = true; } @@ -3587,7 +3588,7 @@ class Get { // set field $guiMapper['field'] = 'php_ajaxmethod'; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $view->php_ajaxmethod, $target, 'ajax_model', @@ -3931,11 +3932,11 @@ class Get { $convert__ = false; } - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $this->_fieldData[$id]->javascript_view_footer, 'view_footer', $name_single, - false, + null, array( 'table' => 'field', 'id' => (int) $id, @@ -3960,14 +3961,14 @@ class Get "task=ajax" ) !== false) { - if (!isset($this->customScriptBuilder['token'])) + if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'])) { - $this->customScriptBuilder['token'] = array(); + CFactory::_('Customcode.Dispenser')->hub['token'] = []; } - if (!isset($this->customScriptBuilder['token'][$name_single]) - || !$this->customScriptBuilder['token'][$name_single]) + if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'][$name_single]) + || !CFactory::_('Customcode.Dispenser')->hub['token'][$name_single]) { - $this->customScriptBuilder['token'][$name_single] + CFactory::_('Customcode.Dispenser')->hub['token'][$name_single] = true; } } @@ -3982,11 +3983,11 @@ class Get { $convert__ = false; } - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $this->_fieldData[$id]->css_view, 'css_view', $name_single, - false, + null, array('prefix' => PHP_EOL), $convert__, $convert__, @@ -4014,11 +4015,11 @@ class Get { $convert__ = false; } - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $this->_fieldData[$id]->javascript_views_footer, 'views_footer', $name_single, - false, + null, array( 'table' => 'field', 'id' => (int) $id, @@ -4043,14 +4044,14 @@ class Get "task=ajax" ) !== false) { - if (!isset($this->customScriptBuilder['token'])) + if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'])) { - $this->customScriptBuilder['token'] = array(); + CFactory::_('Customcode.Dispenser')->hub['token'] = []; } - if (!isset($this->customScriptBuilder['token'][$name_list]) - || !$this->customScriptBuilder['token'][$name_list]) + if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'][$name_list]) + || !CFactory::_('Customcode.Dispenser')->hub['token'][$name_list]) { - $this->customScriptBuilder['token'][$name_list] + CFactory::_('Customcode.Dispenser')->hub['token'][$name_list] = true; } } @@ -4064,11 +4065,11 @@ class Get { $convert__ = false; } - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $this->_fieldData[$id]->css_views, 'css_views', $name_single, - false, + null, array('prefix' => PHP_EOL), $convert__, $convert__, @@ -4668,11 +4669,11 @@ class Get // set GUI mapper field $guiMapper['field'] = $script; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; - $this->setCustomScriptBuilder( + CFactory::_('Customcode.Dispenser')->set( $result->{$script}, CFactory::_('Config')->build_target . '_' . $script, $view_code, - false, + null, $guiMapper, true, true, @@ -5131,135 +5132,35 @@ class Get } /** - * set the script for the custom script builder + * Set the script for the customcode dispenser * - * @param string $script The script - * @param string $first The first key - * @param string $second The second key (if not set we use only first key) - * @param string $third The third key (if not set we use only first and second key) - * @param array $config The config options - * @param bool $base64 The switch to decode base64 the script - * default: true - * @param bool $dynamic The switch to dynamic update the script - * default: true - * @param bool $add The switch to add to exiting instead of replace - * default: false - * - * @return boolean true on success + * @param string $script The script + * @param string $first The first key + * @param string|null $second The second key (if not set we use only first key) + * @param string|null $third The third key (if not set we use only first and second key) + * @param array $config The config options + * @param bool $base64 The switch to decode base64 the script + * default: true + * @param bool $dynamic The switch to dynamic update the script + * default: true + * @param bool $add The switch to add to exiting instead of replace + * default: false * + * @return bool true on success + * @deprecated 3.3 Use CFactory::_('Customcode.Dispenser')->set($script, $first, $second, $third, $config, $base64, $dynamic, $add); */ - public function setCustomScriptBuilder(&$script, $first, $second = false, - $third = false, $config = array(), $base64 = true, $dynamic = true, - $add = false - ) + public function setCustomScriptBuilder( + &$script, + string $first, + ?string $second = null, + ?string $third = null, + array $config = array(), + bool $base64 = true, + bool $dynamic = true, + bool $add = false + ): bool { - // only load if we have a string - if (!StringHelper::check($script)) - { - return false; - } - // this needs refactoring (TODO) - if (!isset($this->customScriptBuilder[$first]) - || ($second - && !isset($this->customScriptBuilder[$first][$second]))) - { - // check if the script first key is set - if ($second && !isset($this->customScriptBuilder[$first])) - { - $this->customScriptBuilder[$first] = array(); - } - elseif ($add && !$second - && !isset($this->customScriptBuilder[$first])) - { - $this->customScriptBuilder[$first] = ''; - } - // check if the script second key is set - if ($second && $third - && !isset($this->customScriptBuilder[$first][$second])) - { - $this->customScriptBuilder[$first][$second] = array(); - } - elseif ($add && $second && !$third - && !isset($this->customScriptBuilder[$first][$second])) - { - $this->customScriptBuilder[$first][$second] = ''; - } - // check if the script third key is set - if ($add && $second && $third - && !isset($this->customScriptBuilder[$first][$second][$third])) - { - $this->customScriptBuilder[$first][$second][$third] = ''; - } - } - // prep the script string - if ($base64 && $dynamic) - { - $script = CFactory::_('Customcode')->add(base64_decode($script)); - } - elseif ($base64) - { - $script = base64_decode($script); - } - elseif ($dynamic) // this does not happen (just incase) - { - $script = CFactory::_('Customcode')->add($script); - } - // check if we still have a string - if (StringHelper::check($script)) - { - // now load the placeholder snippet if needed - if ($base64 || $dynamic) - { - $script = CFactory::_('Customcode.Gui')->set($script, $config); - } - // add Dynamic HASHING option of a file/string - $script = $this->setDynamicHASHING($script); - // add base64 locking option of a string - $script = $this->setBase64LOCK($script); - // load the script - if ($first && $second && $third) - { - // now act on loading option - if ($add) - { - $this->customScriptBuilder[$first][$second][$third] - .= $script; - } - else - { - $this->customScriptBuilder[$first][$second][$third] - = $script; - } - } - elseif ($first && $second) - { - // now act on loading option - if ($add) - { - $this->customScriptBuilder[$first][$second] .= $script; - } - else - { - $this->customScriptBuilder[$first][$second] = $script; - } - } - else - { - // now act on loading option - if ($add) - { - $this->customScriptBuilder[$first] .= $script; - } - else - { - $this->customScriptBuilder[$first] = $script; - } - } - - return true; - } - - return false; + return CFactory::_('Customcode.Dispenser')->set($script, $first, $second, $third, $config, $base64, $dynamic, $add); } /** @@ -5274,44 +5175,13 @@ class Get * @param string $sufix The sufix to add after the script if found * * @return mix The string/script if found or the default value if not found - * + * @deprecated 3.3 Use CFactory::_('Customcode.Dispenser')->get($first, $second, $prefix, $note, $unset, $default, $sufix); */ public function getCustomScriptBuilder($first, $second, $prefix = '', $note = null, $unset = null, $default = null, $sufix = '' ) { - // default is to return an empty string - $script = ''; - // check if there is any custom script - if (isset($this->customScriptBuilder[$first][$second]) - && StringHelper::check( - $this->customScriptBuilder[$first][$second] - )) - { - // add not if set - if ($note) - { - $script .= $note; - } - // load the actual script - $script .= $prefix . str_replace( - array_keys(CFactory::_('Placeholder')->active), - array_values(CFactory::_('Placeholder')->active), - $this->customScriptBuilder[$first][$second] - ) . $sufix; - // clear some memory - if ($unset) - { - unset($this->customScriptBuilder[$first][$second]); - } - } - // if not found return default - if (!StringHelper::check($script) && $default) - { - return $default; - } - - return $script; + return CFactory::_('Customcode.Dispenser')->get($first, $second, $prefix, $note, $unset, $default, $sufix); } /** @@ -10198,7 +10068,7 @@ class Get * @param string $string The code string * * @return string - * + * @deprecated 3.3 Use CFactory::_('Customcode.Hash')->set($script); */ protected function setDynamicHASHING($script) { @@ -10259,7 +10129,7 @@ class Get * @param string $string The code string * * @return string - * + * @deprecated 3.3 Use CFactory::_('Customcode.LockBase')->set($script); */ protected function setBase64LOCK($script) { diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 5efa2d28a..8f3da1daa 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -754,7 +754,7 @@ class Structure extends Get $module->add_scripts_field = false; $field_script_bucket = array(); // add any css from the fields - if (($css = $this->getCustomScriptBuilder( + if (($css = CFactory::_('Customcode.Dispenser')->get( 'css_view', $module->key )) !== null && StringHelper::check($css)) @@ -789,7 +789,7 @@ class Structure extends Get } } // add any JavaScript from the fields - if (($javascript = $this->getCustomScriptBuilder( + if (($javascript = CFactory::_('Customcode.Dispenser')->get( 'view_footer', $module->key )) !== null && StringHelper::check($javascript)) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 71e0592f4..0bcaa928e 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -4784,7 +4784,7 @@ class Interpretation extends Fields // set main get query $getItem .= $this->setCustomViewQuery($get->main_get, $code); // check if there is any custom script - $getItem .= $this->getCustomScriptBuilder( + $getItem .= CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_getlistquery', $code, '', PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_( __LINE__,__CLASS__ @@ -7403,7 +7403,7 @@ class Interpretation extends Fields $script .= PHP_EOL . Indent::_(3) . "}"; } // add custom php to getitem method - $script .= $this->getCustomScriptBuilder( + $script .= CFactory::_('Customcode.Dispenser')->get( 'php_getitem', $view, PHP_EOL . PHP_EOL ); @@ -7442,7 +7442,7 @@ class Interpretation extends Fields $Component = $this->fileContentStatic[Placefix::_h('Component')]; $component = CFactory::_('Config')->component_code_name; // check if there was script added before modeling of data - $script .= $this->getCustomScriptBuilder( + $script .= CFactory::_('Customcode.Dispenser')->get( 'php_before_save', $view, PHP_EOL . PHP_EOL ); // turn array into JSON string @@ -7627,7 +7627,7 @@ class Interpretation extends Fields } } // add custom PHP to the save method - $script .= $this->getCustomScriptBuilder( + $script .= CFactory::_('Customcode.Dispenser')->get( 'php_save', $view, PHP_EOL . PHP_EOL ); @@ -7901,7 +7901,7 @@ class Interpretation extends Fields . PHP_EOL; } // add the custom script - $script .= $this->getCustomScriptBuilder( + $script .= CFactory::_('Customcode.Dispenser')->get( 'php_postflight', 'install', PHP_EOL . PHP_EOL, null, true ); // add the Intelligent Fix script if needed @@ -7930,7 +7930,7 @@ class Interpretation extends Fields // reset script $script = $this->setComponentToContentTypes('update'); // add the custom script - $script .= $this->getCustomScriptBuilder( + $script .= CFactory::_('Customcode.Dispenser')->get( 'php_postflight', 'update', PHP_EOL . PHP_EOL, null, true ); if (isset($this->componentData->admin_views) @@ -8427,7 +8427,7 @@ class Interpretation extends Fields // add the Intelligent Reversal script if needed $script .= $this->getAssetsTableIntelligentUninstall(); // add the custom uninstall script - $script .= $this->getCustomScriptBuilder( + $script .= CFactory::_('Customcode.Dispenser')->get( 'php_method', 'uninstall', "", null, true, null, PHP_EOL ); @@ -9104,7 +9104,7 @@ class Interpretation extends Fields $category = $this->catCodeBuilder[$nameSingleCode]['code']; } // prepare custom script - $customScript = $this->getCustomScriptBuilder( + $customScript = CFactory::_('Customcode.Dispenser')->get( 'php_batchmove', $nameSingleCode, PHP_EOL . PHP_EOL, null, true ); @@ -9381,7 +9381,7 @@ class Interpretation extends Fields } } // prepare custom script - $customScript = $this->getCustomScriptBuilder( + $customScript = CFactory::_('Customcode.Dispenser')->get( 'php_batchcopy', $nameSingleCode, PHP_EOL . PHP_EOL, null, true ); @@ -10528,13 +10528,13 @@ class Interpretation extends Fields $db .= $db_ . PHP_EOL . PHP_EOL; } // add custom sql dump to the file - if (isset($this->customScriptBuilder['sql']) + if (isset(CFactory::_('Customcode.Dispenser')->hub['sql']) && ArrayHelper::check( - $this->customScriptBuilder['sql'] + CFactory::_('Customcode.Dispenser')->hub['sql'] )) { foreach ( - $this->customScriptBuilder['sql'] as $for => $customSql + CFactory::_('Customcode.Dispenser')->hub['sql'] as $for => $customSql ) { $placeholders = array(Placefix::_('component') => $component, @@ -10543,7 +10543,7 @@ class Interpretation extends Fields $customSql, $placeholders ) . PHP_EOL . PHP_EOL; } - unset($this->customScriptBuilder['sql']); + unset(CFactory::_('Customcode.Dispenser')->hub['sql']); } // WHY DO WE NEED AN ASSET TABLE FIX? @@ -10640,16 +10640,16 @@ class Interpretation extends Fields } } // add custom sql uninstall dump to the file - if (isset($this->customScriptBuilder['sql_uninstall']) + if (isset(CFactory::_('Customcode.Dispenser')->hub['sql_uninstall']) && StringHelper::check( - $this->customScriptBuilder['sql_uninstall'] + CFactory::_('Customcode.Dispenser')->hub['sql_uninstall'] )) { $db .= CFactory::_('Placeholder')->update( - $this->customScriptBuilder['sql_uninstall'], + CFactory::_('Customcode.Dispenser')->hub['sql_uninstall'], $this->placeholders ) . PHP_EOL; - unset($this->customScriptBuilder['sql_uninstall']); + unset(CFactory::_('Customcode.Dispenser')->hub['sql_uninstall']); } // check if this component used larger rules @@ -14528,7 +14528,7 @@ class Interpretation extends Fields . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php - $query .= $this->getCustomScriptBuilder( + $query .= CFactory::_('Customcode.Dispenser')->get( 'php_getlistquery', $nameSingleCode, PHP_EOL . PHP_EOL ); // add the custom fields query @@ -14949,7 +14949,7 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(3) . "}"; } // add custom php to getitems method after all - $query .= $this->getCustomScriptBuilder( + $query .= CFactory::_('Customcode.Dispenser')->get( 'php_getitems_after_all', $nameSingleCode, PHP_EOL . PHP_EOL . Indent::_(1) ); @@ -15213,7 +15213,7 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(3) . "}"; // add custom filtering php - $query .= $this->getCustomScriptBuilder( + $query .= CFactory::_('Customcode.Dispenser')->get( 'php_getlistquery', $nameSingleCode, PHP_EOL . PHP_EOL . Indent::_(1) ); @@ -15337,7 +15337,7 @@ class Interpretation extends Fields $query .= PHP_EOL . Indent::_(3) . "}"; } // add custom php to getItems method after all - $query .= $this->getCustomScriptBuilder( + $query .= CFactory::_('Customcode.Dispenser')->get( 'php_getitems_after_all', $nameSingleCode, PHP_EOL . PHP_EOL . Indent::_(2) ); @@ -15361,7 +15361,7 @@ class Interpretation extends Fields $header = ComponentbuilderHelper::getDynamicScripts('headers'); // add getExImPortHeaders - $query .= $this->getCustomScriptBuilder( + $query .= CFactory::_('Customcode.Dispenser')->get( 'php_import_headers', 'import_' . $nameListCode, PHP_EOL . PHP_EOL, null, true, // set a default script for those with no custom script @@ -15597,40 +15597,40 @@ class Interpretation extends Fields // load the custom script to the files // IMPORT_EXT_METHOD <<>> $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_EXT_METHOD')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_import_ext', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_DISPLAY_METHOD_CUSTOM <<>> $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DISPLAY_METHOD_CUSTOM')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_import_display', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_SETDATA_METHOD <<>> $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SETDATA_METHOD')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_import_setdata', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_METHOD_CUSTOM <<>> $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_METHOD_CUSTOM')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_import', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_SAVE_METHOD <<>> $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SAVE_METHOD')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_import_save', 'import_' . $nameListCode, PHP_EOL, null, true ); // IMPORT_DEFAULT_VIEW_CUSTOM <<>> $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DEFAULT_VIEW_CUSTOM')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'html_import_view', 'import_' . $nameListCode, PHP_EOL, null, true @@ -15700,7 +15700,7 @@ class Interpretation extends Fields . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php - $query .= $this->getCustomScriptBuilder( + $query .= CFactory::_('Customcode.Dispenser')->get( 'php_getlistquery', $nameSingleCode, PHP_EOL . PHP_EOL ); // add the custom fields query @@ -16734,17 +16734,17 @@ class Interpretation extends Fields { $fileScript = ''; } - $fileScript .= $this->getCustomScriptBuilder( + $fileScript .= CFactory::_('Customcode.Dispenser')->get( 'view_file', $nameSingleCode, PHP_EOL . PHP_EOL, null, true, '' ); // add custom script to footer - if (isset($this->customScriptBuilder['view_footer'][$nameSingleCode]) + if (isset(CFactory::_('Customcode.Dispenser')->hub['view_footer'][$nameSingleCode]) && StringHelper::check( - $this->customScriptBuilder['view_footer'][$nameSingleCode] + CFactory::_('Customcode.Dispenser')->hub['view_footer'][$nameSingleCode] )) { $customFooterScript = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update( - $this->customScriptBuilder['view_footer'][$nameSingleCode], + CFactory::_('Customcode.Dispenser')->hub['view_footer'][$nameSingleCode], $this->placeholders ); if (strpos($customFooterScript, 'name_list_code; // add custom script to list view JS file - if (($list_fileScript = $this->getCustomScriptBuilder( + if (($list_fileScript = CFactory::_('Customcode.Dispenser')->get( 'views_file', $nameSingleCode, PHP_EOL . PHP_EOL, null, true, false )) !== false @@ -17733,8 +17733,8 @@ class Interpretation extends Fields public function setAjaxToke(&$view) { $fix = ''; - if (isset($this->customScriptBuilder['token'][$view]) - && $this->customScriptBuilder['token'][$view]) + if (isset(CFactory::_('Customcode.Dispenser')->hub['token'][$view]) + && CFactory::_('Customcode.Dispenser')->hub['token'][$view]) { $fix .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Add Ajax Token"; @@ -17748,14 +17748,14 @@ class Interpretation extends Fields public function setRegisterAjaxTask($target) { $tasks = ''; - if (isset($this->customScriptBuilder[$target]['ajax_controller']) + if (isset(CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller']) && ArrayHelper::check( - $this->customScriptBuilder[$target]['ajax_controller'] + CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller'] )) { $taskArray = array(); foreach ( - $this->customScriptBuilder[$target]['ajax_controller'] as $view + CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller'] as $view ) { foreach ($view as $task) @@ -17779,9 +17779,9 @@ class Interpretation extends Fields public function setAjaxInputReturn($target) { $cases = ''; - if (isset($this->customScriptBuilder[$target]['ajax_controller']) + if (isset(CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller']) && ArrayHelper::check( - $this->customScriptBuilder[$target]['ajax_controller'] + CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller'] )) { $input = array(); @@ -17790,7 +17790,7 @@ class Interpretation extends Fields $getModel = array(); $userCheck = array(); foreach ( - $this->customScriptBuilder[$target]['ajax_controller'] as $view + CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller'] as $view ) { foreach ($view as $task) @@ -17911,13 +17911,13 @@ class Interpretation extends Fields public function setAjaxModelMethods($target) { $methods = ''; - if (isset($this->customScriptBuilder[$target]['ajax_model']) + if (isset(CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_model']) && ArrayHelper::check( - $this->customScriptBuilder[$target]['ajax_model'] + CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_model'] )) { foreach ( - $this->customScriptBuilder[$target]['ajax_model'] as $view => + CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_model'] as $view => $method ) { @@ -19005,7 +19005,7 @@ class Interpretation extends Fields // set component name $component = $this->componentCodeName; // prepare custom permission script - $customAllow = $this->getCustomScriptBuilder( + $customAllow = CFactory::_('Customcode.Dispenser')->get( 'php_allowadd', $nameSingleCode, '', null, true ); // setup correct core target @@ -19162,7 +19162,7 @@ class Interpretation extends Fields // set component name $component = $this->componentCodeName; // prepare custom permission script - $customAllow = $this->getCustomScriptBuilder( + $customAllow = CFactory::_('Customcode.Dispenser')->get( 'php_allowedit', $nameSingleCode, '', null, true ); // setup correct core target @@ -19953,7 +19953,7 @@ class Interpretation extends Fields . "\$form->setValue(\$redirectedField, null, \$redirectedValue);"; $getForm[] = Indent::_(3) . "}"; // load custom script if found - $getForm[] = Indent::_(2) . "}" . $this->getCustomScriptBuilder( + $getForm[] = Indent::_(2) . "}" . CFactory::_('Customcode.Dispenser')->get( 'php_getform', $nameSingleCode, PHP_EOL ); // setup the default script @@ -20117,7 +20117,7 @@ class Interpretation extends Fields // set component name $component = $this->componentCodeName; // prepare custom permission script - $customAllow = $this->getCustomScriptBuilder( + $customAllow = CFactory::_('Customcode.Dispenser')->get( 'php_allowedit', $nameSingleCode, Indent::_(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;" . PHP_EOL @@ -22268,7 +22268,7 @@ class Interpretation extends Fields } // add custom php to getitems method - $fix .= $this->getCustomScriptBuilder( + $fix .= CFactory::_('Customcode.Dispenser')->get( 'php_getitems', $nameSingleCode, PHP_EOL . PHP_EOL . $tab ); @@ -28029,14 +28029,14 @@ function vdm_dkim() { // first add the header $default = PHP_EOL . $module->default_header . PHP_EOL . '?>'; // add any css from the fields - $default .= $this->getCustomScriptBuilder( + $default .= CFactory::_('Customcode.Dispenser')->get( 'css_views', $key, PHP_EOL . '' . PHP_EOL ); // now add the body $default .= PHP_EOL . $module->default . PHP_EOL; // add any JavaScript from the fields - $default .= $this->getCustomScriptBuilder( + $default .= CFactory::_('Customcode.Dispenser')->get( 'views_footer', $key, PHP_EOL . '' . PHP_EOL diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 212fd1a47..65dc4de66 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -216,38 +216,38 @@ class Infusion extends Interpretation // ADMINJS $this->fileContentStatic[Placefix::_h('ADMINJS')] = CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_js'], CFactory::_('Placeholder')->active + CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active ); // SITEJS $this->fileContentStatic[Placefix::_h('SITEJS')] = CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_js'], CFactory::_('Placeholder')->active + CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active ); // ADMINCSS $this->fileContentStatic[Placefix::_h('ADMINCSS')] = CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_css_admin'], + CFactory::_('Customcode.Dispenser')->hub['component_css_admin'], CFactory::_('Placeholder')->active ); // SITECSS $this->fileContentStatic[Placefix::_h('SITECSS')] = CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_css_site'], + CFactory::_('Customcode.Dispenser')->hub['component_css_site'], CFactory::_('Placeholder')->active ); // CUSTOM_HELPER_SCRIPT $this->fileContentStatic[Placefix::_h('CUSTOM_HELPER_SCRIPT')] = CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_php_helper_admin'], + 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( - $this->customScriptBuilder['component_php_helper_both'], + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_both'], CFactory::_('Placeholder')->active ); @@ -284,7 +284,7 @@ class Infusion extends Interpretation .= PHP_EOL . Indent::_(1) . '{'; $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] .= PHP_EOL . CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_php_admin_event'], + CFactory::_('Customcode.Dispenser')->hub['component_php_admin_event'], CFactory::_('Placeholder')->active ); $this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')] @@ -447,7 +447,7 @@ class Infusion extends Interpretation ); // DOCUMENT_CUSTOM_PHP <<>> - if ($phpDocument = $this->getCustomScriptBuilder( + if ($phpDocument = CFactory::_('Customcode.Dispenser')->get( 'php_document', $nameSingleCode, PHP_EOL, null, true, false @@ -512,28 +512,28 @@ class Infusion extends Interpretation // JMODELADMIN_BEFORE_DELETE <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_DELETE')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_before_delete', $nameSingleCode, PHP_EOL ); // JMODELADMIN_AFTER_DELETE <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_DELETE')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_after_delete', $nameSingleCode, PHP_EOL . PHP_EOL ); // JMODELADMIN_BEFORE_DELETE <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_PUBLISH')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_before_publish', $nameSingleCode, PHP_EOL ); // JMODELADMIN_AFTER_DELETE <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_PUBLISH')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_after_publish', $nameSingleCode, PHP_EOL . PHP_EOL ); @@ -552,7 +552,7 @@ class Infusion extends Interpretation // POSTSAVEHOOK <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('POSTSAVEHOOK')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_postsavehook', $nameSingleCode, PHP_EOL, null, true, PHP_EOL . Indent::_(2) . "return;", @@ -561,7 +561,7 @@ class Infusion extends Interpretation // VIEWCSS <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWCSS')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'css_view', $nameSingleCode, '', null, true ); @@ -746,7 +746,7 @@ class Infusion extends Interpretation // GET_ITEMS_METHOD_AFTER_ALL <<>> $this->fileContentDynamic[$nameListCode][Placefix::_h('GET_ITEMS_METHOD_AFTER_ALL')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_getitems_after_all', $nameSingleCode, PHP_EOL ); @@ -912,7 +912,7 @@ class Infusion extends Interpretation // VIEWSCSS <<>> $this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWSCSS')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'css_views', $nameSingleCode, '', null, true ); @@ -927,7 +927,7 @@ class Infusion extends Interpretation $scriptNote = PHP_EOL . '//' . Line::_(__Line__, __Class__) . ' ' . $nameListCode . ' footer script'; - if (($footerScript = $this->getCustomScriptBuilder( + if (($footerScript = CFactory::_('Customcode.Dispenser')->get( 'views_footer', $nameSingleCode, '', $scriptNote, true, false, PHP_EOL @@ -1040,17 +1040,17 @@ class Infusion extends Interpretation // JCONTROLLERFORM_BEFORECANCEL <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_BEFORECANCEL')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_before_cancel', $nameSingleCode, - PHP_EOL, null, null, + PHP_EOL, null, false, '' ); // JCONTROLLERFORM_AFTERCANCEL <<>> $this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_AFTERCANCEL')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_after_cancel', $nameSingleCode, - PHP_EOL, null, null, + PHP_EOL, null, false, '' ); @@ -1280,7 +1280,7 @@ class Infusion extends Interpretation { // CUSTOM_ADMIN_BEFORE_GET_ITEM <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEM')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitem', $view['settings']->code, '', null, true ); @@ -1294,7 +1294,7 @@ class Infusion extends Interpretation // CUSTOM_ADMIN_AFTER_GET_ITEM <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEM')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitem', $view['settings']->code, '', null, true ); @@ -1309,14 +1309,14 @@ class Infusion extends Interpretation // CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true ); // CUSTOM_ADMIN_BEFORE_GET_ITEMS <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEMS')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true ); @@ -1329,7 +1329,7 @@ class Infusion extends Interpretation // CUSTOM_ADMIN_AFTER_GET_ITEMS <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEMS')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true ); @@ -1768,7 +1768,7 @@ class Infusion extends Interpretation // SITE_BEFORE_GET_ITEM <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEM')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitem', $view['settings']->code, '', null, true ); @@ -1782,7 +1782,7 @@ class Infusion extends Interpretation // SITE_AFTER_GET_ITEM <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEM')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitem', $view['settings']->code, '', null, true ); @@ -1800,7 +1800,7 @@ class Infusion extends Interpretation // SITE_BEFORE_GET_ITEMS <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEMS')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true ); @@ -1813,7 +1813,7 @@ class Infusion extends Interpretation // SITE_AFTER_GET_ITEMS <<>> $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEMS')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( CFactory::_('Config')->build_target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true ); @@ -1969,7 +1969,7 @@ class Infusion extends Interpretation // SITE_CUSTOM_HELPER_SCRIPT $this->fileContentStatic[Placefix::_h('SITE_CUSTOM_HELPER_SCRIPT')] = CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_php_helper_site'], + CFactory::_('Customcode.Dispenser')->hub['component_php_helper_site'], CFactory::_('Placeholder')->active ); // SITE_GLOBAL_EVENT_HELPER @@ -2004,7 +2004,7 @@ class Infusion extends Interpretation .= PHP_EOL . Indent::_(1) . '{'; $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] .= PHP_EOL . CFactory::_('Placeholder')->update( - $this->customScriptBuilder['component_php_site_event'], + CFactory::_('Customcode.Dispenser')->hub['component_php_site_event'], CFactory::_('Placeholder')->active ); $this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')] @@ -2014,13 +2014,13 @@ class Infusion extends Interpretation // PREINSTALLSCRIPT $this->fileContentStatic[Placefix::_h('PREINSTALLSCRIPT')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_preflight', 'install', PHP_EOL, null, true ); // PREUPDATESCRIPT $this->fileContentStatic[Placefix::_h('PREUPDATESCRIPT')] - = $this->getCustomScriptBuilder( + = CFactory::_('Customcode.Dispenser')->get( 'php_preflight', 'update', PHP_EOL, null, true ); diff --git a/componentbuilder.xml b/componentbuilder.xml index 3a5f4b84d..32501cb36 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 30th August, 2022 + 31st August, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Dispenser.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Dispenser.php new file mode 100644 index 000000000..cb851db07 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Dispenser.php @@ -0,0 +1,283 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Hash; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\LockBase; + + +/** + * Compiler Custom Code Dispenser + * + * @since 3.2.0 + */ +class Dispenser +{ + /** + * Customcode Dispenser Hub + * + * @var array + * @since 3.2.0 + **/ + public array $hub; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + **/ + protected Customcode $customcode; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Compiler Customcode in Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Customcode to Hash + * + * @var Hash + * @since 3.2.0 + **/ + protected Hash $hash; + + /** + * Compiler Customcode to LockBase + * + * @var LockBase + * @since 3.2.0 + **/ + protected LockBase $base64; + + /** + * Constructor. + * + * @param Customcode|null $customcode The compiler customcode object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Gui|null $gui The compiler customcode gui object. + * @param Hash|null $hash The compiler customcode hash object. + * @param LockBase|null $base64 The compiler customcode lock base64 object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null, ?Customcode $customcode = null, + ?Gui $gui = null, ?Hash $hash = null, ?LockBase $base64 = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->hash = $hash ?: Compiler::_('Customcode.Hash'); + $this->base64 = $base64 ?: Compiler::_('Customcode.LockBase'); + } + + /** + * Set the script for the customcode dispenser + * + * @param string $script The script + * @param string $first The first key + * @param string|null $second The second key (if not set we use only first key) + * @param string|null $third The third key (if not set we use only first and second key) + * @param array $config The config options + * @param bool $base64 The switch to decode base64 the script + * default: true + * @param bool $dynamic The switch to dynamic update the script + * default: true + * @param bool $add The switch to add to exiting instead of replace + * default: false + * + * @return bool true on success + * @since 3.2.0 + */ + public function set(&$script, string $first, ?string $second = null, ?string $third = null, + array $config = array(), bool $base64 = true, bool $dynamic = true, bool $add = false): bool + { + // only load if we have a string + if (!StringHelper::check($script)) + { + return false; + } + // this needs refactoring (TODO) + if (!isset($this->hub[$first]) + || ($second + && !isset($this->hub[$first][$second]))) + { + // check if the script first key is set + if ($second && !isset($this->hub[$first])) + { + $this->hub[$first] = array(); + } + elseif ($add && !$second + && !isset($this->hub[$first])) + { + $this->hub[$first] = ''; + } + // check if the script second key is set + if ($second && $third + && !isset($this->hub[$first][$second])) + { + $this->hub[$first][$second] = array(); + } + elseif ($add && $second && !$third + && !isset($this->hub[$first][$second])) + { + $this->hub[$first][$second] = ''; + } + // check if the script third key is set + if ($add && $second && $third + && !isset($this->hub[$first][$second][$third])) + { + $this->hub[$first][$second][$third] = ''; + } + } + // prep the script string + if ($base64 && $dynamic) + { + $script = $this->customcode->add(base64_decode($script)); + } + elseif ($base64) + { + $script = base64_decode($script); + } + elseif ($dynamic) // this does not happen (just incase) + { + $script = $this->customcode->add($script); + } + // check if we still have a string + if (StringHelper::check($script)) + { + // now load the placeholder snippet if needed + if ($base64 || $dynamic) + { + $script = $this->gui->set($script, $config); + } + // add Dynamic HASHING option of a file/string + $script = $this->hash->set($script); + // add base64 locking option of a string + $script = $this->base64->set($script); + // load the script + if ($first && $second && $third) + { + // now act on loading option + if ($add) + { + $this->hub[$first][$second][$third] + .= $script; + } + else + { + $this->hub[$first][$second][$third] + = $script; + } + } + elseif ($first && $second) + { + // now act on loading option + if ($add) + { + $this->hub[$first][$second] .= $script; + } + else + { + $this->hub[$first][$second] = $script; + } + } + else + { + // now act on loading option + if ($add) + { + $this->hub[$first] .= $script; + } + else + { + $this->hub[$first] = $script; + } + } + + return true; + } + + return false; + } + + /** + * Get the script from the customcode dispenser + * + * @param string $first The first key + * @param string $second The second key + * @param string $prefix The prefix to add in front of the script if found + * @param string|null $note The switch/note to add to the script + * @param bool $unset The switch to unset the value if found + * @param mixed|null $default The switch/string to use as default return if script not found + * @param string $suffix The suffix to add after the script if found + * + * @return mixed The string/script if found or the default value if not found + * + * @since 3.2.0 + */ + public function get(string $first, string $second, string $prefix = '', ?string $note = null, + bool $unset = false, $default = null, string $suffix = '') + { + // default is to return an empty string + $script = ''; + // check if there is any custom script + if (isset($this->hub[$first][$second]) + && StringHelper::check( + $this->hub[$first][$second] + )) + { + // add not if set + if ($note) + { + $script .= $note; + } + // load the actual script + $script .= $prefix . str_replace( + array_keys($this->placeholder->active), + array_values($this->placeholder->active), + $this->hub[$first][$second] + ) . $suffix; + // clear some memory + if ($unset) + { + unset($this->hub[$first][$second]); + } + } + // if not found return default + if (!StringHelper::check($script) && $default) + { + return $default; + } + + return $script; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Hash.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Hash.php new file mode 100644 index 000000000..bca67e38d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Hash.php @@ -0,0 +1,110 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; + + +/** + * Compiler Custom Code MD5 + * + * @since 3.2.0 + */ +class Hash +{ + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The compiler placeholder object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + } + + /** + * Set the the MD5 hashed string or file or string + * + * @param string $script The code string + * + * @return string + * @since 3.2.0 + */ + public function set(string $script): string + { + // check if we should hash a string + if (\strpos($script, 'HASH' . 'STRING((((') !== false) + { + // get the strings + $values = GetHelper::allBetween( + $script, 'HASH' . 'STRING((((', '))))' + ); + $locker = array(); + // convert them + foreach ($values as $value) + { + $locker['HASH' . 'STRING((((' . $value . '))))'] + = \md5($value); + } + + // update the script + return $this->placeholder->update($script, $locker); + } + // check if we should hash a file + if (\strpos($script, 'HASH' . 'FILE((((') !== false) + { + // get the strings + $values = GetHelper::allBetween( + $script, 'HASH' . 'FILE((((', '))))' + ); + $locker = array(); + // convert them + foreach ($values as $path) + { + // we first get the file if it exist + if ($value = FileHelper::getContent($path)) + { + // now we hash the file content + $locker['HASH' . 'FILE((((' . $path . '))))'] + = \md5($value); + } + else + { + // could not retrieve the file so we show error + $locker['HASH' . 'FILE((((' . $path . '))))'] + = 'ERROR'; + } + } + + // update the script + return $this->placeholder->update($script, $locker); + } + + return $script; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/LockBase.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/LockBase.php new file mode 100644 index 000000000..d7243967e --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/LockBase.php @@ -0,0 +1,85 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Customcode; + + +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; + + +/** + * Compiler Custom Code Base64 + * + * @since 3.2.0 + */ +class LockBase +{ + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $placeholder; + + /** + * Constructor. + * + * @param Placeholder|null $placeholder The compiler placeholder object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + } + + /** + * Set a string as bsae64 (basic) + * + * @param string $script The code string + * + * @return string + * @since 3.2.0 + */ + public function set(string $script): string + { + if (\strpos($script, 'LOCK'.'BASE64((((') !== false) + { + // get the strings + $values = GetHelper::allBetween( + $script, 'LOCK'.'BASE64((((', '))))' + ); + $locker = array(); + // convert them + foreach ($values as $value) + { + $locker['LOCK'.'BASE64((((' . $value . '))))'] + = "base64_decode( preg_replace('/\s+/', ''," . + PHP_EOL . Indent::_(2) . "'" . + \wordwrap( + \base64_encode($value), 64, PHP_EOL . Indent::_(2), true + ) . + "'))"; + } + + // update the script + return $this->placeholder->update($script, $locker); + } + + return $script; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php index ad55c797e..424445438 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php @@ -17,6 +17,9 @@ use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Customcode as CompilerCustomcode; use VDM\Joomla\Componentbuilder\Compiler\Customcode\External; use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Hash; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\LockBase; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; /** @@ -44,6 +47,15 @@ class Customcode implements ServiceProviderInterface $container->alias(Gui::class, 'Customcode.Gui') ->share('Customcode.Gui', [$this, 'getGui'], true); + + $container->alias(Hash::class, 'Customcode.Hash') + ->share('Customcode.Hash', [$this, 'getHash'], true); + + $container->alias(LockBase::class, 'Customcode.LockBase') + ->share('Customcode.LockBase', [$this, 'getLockBase'], true); + + $container->alias(Dispenser::class, 'Customcode.Dispenser') + ->share('Customcode.Dispenser', [$this, 'getDispenser'], true); } /** @@ -94,6 +106,55 @@ class Customcode implements ServiceProviderInterface $container->get('Placeholder.Reverse') ); } + + /** + * Get the Customcode Hash + * + * @param Container $container The DI container. + * + * @return Hash + * @since 3.2.0 + */ + public function getHash(Container $container): Hash + { + return new Hash( + $container->get('Placeholder') + ); + } + + /** + * Get the Customcode LockBase64 + * + * @param Container $container The DI container. + * + * @return LockBase + * @since 3.2.0 + */ + public function getLockBase(Container $container): LockBase + { + return new LockBase( + $container->get('Placeholder') + ); + } + + /** + * Get the Customcode Dispenser + * + * @param Container $container The DI container. + * + * @return Dispenser + * @since 3.2.0 + */ + public function getDispenser(Container $container): Dispenser + { + return new Dispenser( + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Customcode.Hash'), + $container->get('Customcode.LockBase') + ); + } } -- 2.45.1 From 0512af0f33083f17bf0944e89e69c495741493e8 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 2 Sep 2022 07:51:08 +0200 Subject: [PATCH 07/49] Adds the customcode extractor class --- README.md | 8 +- admin/README.txt | 8 +- admin/helpers/compiler/a_Get.php | 1244 +++-------------- admin/helpers/componentbuilder.php | 52 +- .../en-GB/en-GB.com_componentbuilder.ini | 2 + componentbuilder.xml | 2 +- .../Compiler/Customcode/Dispenser.php | 18 +- .../Compiler/Customcode/Extractor.php | 927 ++++++++++++ .../Compiler/Customcode/Extractor/Paths.php | 429 ++++++ .../Compiler/Customcode/Extractor/index.html | 1 + .../Compiler/Placeholder/Reverse.php | 16 +- .../Compiler/Service/Customcode.php | 46 + .../Compiler/Utilities/Path.php | 61 + site/helpers/componentbuilder.php | 52 +- .../en-GB/en-GB.com_componentbuilder.ini | 2 + 15 files changed, 1735 insertions(+), 1133 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Extractor.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Extractor/Paths.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Customcode/Extractor/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php diff --git a/README.md b/README.md index 6f5a0b002..c881984d4 100644 --- a/README.md +++ b/README.md @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 31st August, 2022 ++ *Last Build*: 2nd September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **319873** ++ *Line count*: **321348** + *Field count*: **2002** -+ *File count*: **2090** -+ *Folder count*: **359** ++ *File count*: **2094** ++ *Folder count*: **360** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 6f5a0b002..c881984d4 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 31st August, 2022 ++ *Last Build*: 2nd September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **319873** ++ *Line count*: **321348** + *Field count*: **2002** -+ *File count*: **2090** -+ *Folder count*: **359** ++ *File count*: **2094** ++ *Folder count*: **360** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index bafeb57cf..037d28d42 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -277,6 +277,8 @@ class Get * ////////23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!! * * @var array + * + * @deprecated 3.3 */ protected $customCodePlaceholders = array( @@ -322,6 +324,7 @@ class Get * The custom code in local files that already exist in system * * @var array + * @deprecated 3.3 */ protected $existingCustomCode = array(); @@ -329,6 +332,7 @@ class Get * The custom code in local files this are new * * @var array + * @deprecated 3.3 */ protected $newCustomCode = array(); @@ -336,6 +340,7 @@ class Get * The index of code already loaded * * @var array + * @deprecated 3.3 */ protected $codeAreadyDone = array(); @@ -972,7 +977,6 @@ class Get */ public function __construct() { - echo '
    ';
     		// we do not yet have this set as an option
     		$config['remove_line_breaks']
     			= 2; // 2 is global (use the components value)
    @@ -1042,14 +1046,10 @@ class Get
     		$this->db = JFactory::getDbo();
     		// get global placeholders @deprecated
     		$this->globalPlaceholders = CFactory::_('Component.Placeholder')->get();
    -		// check if this component is installed on the current website
    -		if ($paths = $this->getLocalInstallPaths())
    -		{
    -			// start Automatic import of custom code
    -			$today = JFactory::getDate()->toSql();
    -			// get the custom code from installed files
    -			$this->customCodeFactory($paths, $today);
    -		}
    +
    +		// get the custom code from installed files
    +		CFactory::_('Customcode.Extractor')->run();
    +
     		// Trigger Event: jcb_ce_onBeforeGetComponentData
     		CFactory::_J('Event')->trigger(
     			'jcb_ce_onBeforeGetComponentData',
    @@ -6907,11 +6907,11 @@ class Get
     	{
     		// set notice that we could not get a valid string from the target
     		$this->app->enqueueMessage(
    -			JText::_('

    External Code Warning

    '), 'Error' + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' ); $this->app->enqueueMessage( - JText::_( - 'Use of a deprecated method (getExternalCodeString)!' + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ ), 'Error' ); } @@ -6930,11 +6930,11 @@ class Get { // set notice that we could not get a valid string from the target $this->app->enqueueMessage( - JText::_('

    External Code Warning

    '), 'Error' + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' ); $this->app->enqueueMessage( - JText::_( - 'Use of a deprecated method (cutExternalCodeString)!' + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ ), 'Error' ); @@ -6968,11 +6968,11 @@ class Get { // set notice that we could not get a valid string from the target $this->app->enqueueMessage( - JText::_('

    External Code Warning

    '), 'Error' + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' ); $this->app->enqueueMessage( - JText::_( - 'Use of a deprecated method (insertCustomCode)!' + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ ), 'Error' ); @@ -6992,11 +6992,11 @@ class Get { // set notice that we could not get a valid string from the target $this->app->enqueueMessage( - JText::_('

    External Code Warning

    '), 'Error' + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' ); $this->app->enqueueMessage( - JText::_( - 'Use of a deprecated method (buildCustomCodePlaceholders)!' + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ ), 'Error' ); @@ -7579,23 +7579,15 @@ class Get */ protected function checkCustomCodeMemory($ids) { - // reset custom code - CFactory::_('Customcode')->active = array(); - foreach ($ids as $pointer => $id) - { - if (isset(CFactory::_('Customcode')->memory[$id])) - { - CFactory::_('Customcode')->active[] = CFactory::_('Customcode')->memory[$id]; - unset($ids[$pointer]); - } - } - // check if any ids left to fetch - if (ArrayHelper::check($ids)) - { - return $ids; - } - - return false; + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** @@ -7630,127 +7622,57 @@ class Get { // set notice that we could not get a valid string from the target $this->app->enqueueMessage( - JText::_('

    Power building error

    '), 'Error' + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' ); $this->app->enqueueMessage( - JText::_( - 'Use of a deprecated method (setPower)!' + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); + + return false; + } + + /** + * get the Joomla module path + * + * @return string of module path and target site area on success + * @deprecated 3.3 + */ + protected function getModulePath($id) + { + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ ), 'Error' ); return ''; } - /** - * get the Joomla module path - * - * @return array of module path and target site area on success - * - */ - protected function getModulePath($id) - { - if (is_numeric($id) && $id > 0) - { - // Create a new query object. - $query = $this->db->getQuery(true); - - $query->select('a.*'); - $query->select( - $this->db->quoteName( - array( - 'a.name', - 'a.target' - ), array( - 'name', - 'target' - ) - ) - ); - // from these tables - $query->from('#__componentbuilder_joomla_module AS a'); - $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); - $this->db->setQuery($query); - $this->db->execute(); - if ($this->db->getNumRows()) - { - // get the module data - $module = $this->db->loadObject(); - // update the name if it has dynamic values - $module->name = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->add($module->name), - $this->globalPlaceholders - ); - // set safe class function name - $module->code_name - = ClassfunctionHelper::safe( - $module->name - ); - // set module folder name - $module->folder_name = 'mod_' . strtolower($module->code_name); - // set the lang key - CFactory::_('Language.Extractor')->langKeys[strtoupper($module->folder_name)] = $module->id - . '_M0dU|3'; - // return the path - if ($module->target == 2) - { - // administrator client area - return JPATH_ADMINISTRATOR . '/modules/' - . $module->folder_name; - } - else - { - // default is the site client area - return JPATH_ROOT . '/modules/' . $module->folder_name; - } - } - } - - return false; - } - /** * get the Joomla Modules IDs * * @return array of IDs on success - * + * @deprecated 3.3 */ protected function getModuleIDs() { - if (($addjoomla_modules = GetHelper::var( - 'component_modules', CFactory::_('Config')->component_id, 'joomla_component', - 'addjoomla_modules' - )) !== false) - { - $addjoomla_modules = (JsonHelper::check( - $addjoomla_modules - )) ? json_decode($addjoomla_modules, true) : null; - if (ArrayHelper::check($addjoomla_modules)) - { - $joomla_modules = array_filter( - array_values($addjoomla_modules), - function ($array) { - // only load the modules whose target association call for it - if (!isset($array['target']) || $array['target'] != 2) - { - return true; - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); - return false; - } - ); - // if we have values we return IDs - if (ArrayHelper::check($joomla_modules)) - { - return array_map( - function ($array) { - return (int) $array['module']; - }, $joomla_modules - ); - } - } - } - - return false; + return []; } /** @@ -8620,113 +8542,42 @@ class Get * get the Joomla plugins IDs * * @return array of IDs on success - * + * @deprecated 3.3 */ protected function getPluginIDs() { - if (($addjoomla_plugins = GetHelper::var( - 'component_plugins', CFactory::_('Config')->component_id, 'joomla_component', - 'addjoomla_plugins' - )) !== false) - { - $addjoomla_plugins = (JsonHelper::check( - $addjoomla_plugins - )) ? json_decode($addjoomla_plugins, true) : null; - if (ArrayHelper::check($addjoomla_plugins)) - { - $joomla_plugins = array_filter( - array_values($addjoomla_plugins), - function ($array) { - // only load the plugins whose target association call for it - if (!isset($array['target']) || $array['target'] != 2) - { - return true; - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); - return false; - } - ); - // if we have values we return IDs - if (ArrayHelper::check($joomla_plugins)) - { - return array_map( - function ($array) { - return (int) $array['plugin']; - }, $joomla_plugins - ); - } - } - } - - return false; + return []; } /** * get the Joomla plugin path * * @return string of plugin path on success - * + * @deprecated 3.3 */ protected function getPluginPath($id) { - if (is_numeric($id) && $id > 0) - { - // Create a new query object. - $query = $this->db->getQuery(true); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); - $query->select('a.*'); - $query->select( - $this->db->quoteName( - array( - 'a.name', - 'g.name' - ), array( - 'name', - 'group' - ) - ) - ); - // from these tables - $query->from('#__componentbuilder_joomla_plugin AS a'); - $query->join( - 'LEFT', $this->db->quoteName( - '#__componentbuilder_joomla_plugin_group', 'g' - ) . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') - . ' = ' . $this->db->quoteName('g.id') . ')' - ); - $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); - $this->db->setQuery($query); - $this->db->execute(); - if ($this->db->getNumRows()) - { - // get the plugin data - $plugin = $this->db->loadObject(); - // update the name if it has dynamic values - $plugin->name = CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->add($plugin->name), - $this->globalPlaceholders - ); - // update the name if it has dynamic values - $plugin->code_name - = ClassfunctionHelper::safe( - $plugin->name - ); - // set plugin folder name - $plugin->group = strtolower($plugin->group); - // set plugin file name - $plugin->file_name = strtolower($plugin->code_name); - // set the lang key - CFactory::_('Language.Extractor')->langKeys['PLG_' . strtoupper( - $plugin->group . '_' . $plugin->file_name - )] - = $plugin->id . '_P|uG!n'; - - // return the path - return $plugin->group . '/' . $plugin->file_name; - } - } - - return false; + return ''; } /** @@ -9496,46 +9347,19 @@ class Get * * @return void * + * @deprecated 3.3 */ protected function setNewCustomCode($when = 1) { - if (count((array) $this->newCustomCode) >= $when) - { - // Create a new query object. - $query = $this->db->getQuery(true); - $continue = false; - // Insert columns. - $columns = array('path', 'type', 'target', 'comment_type', - 'component', 'published', 'created', 'created_by', - 'version', 'access', 'hashtarget', 'from_line', - 'to_line', 'code', 'hashendtarget'); - // Prepare the insert query. - $query->insert( - $this->db->quoteName('#__componentbuilder_custom_code') - ); - $query->columns($this->db->quoteName($columns)); - foreach ($this->newCustomCode as $values) - { - if (count((array) $values) == 15) - { - $query->values(implode(',', $values)); - $continue = true; - } - else - { - // TODO line mismatch... should not happen - } - } - // clear the values array - $this->newCustomCode = array(); - if (!$continue) - { - return false; // insure we dont continue if no values were loaded - } - // Set the query using our newly populated query object and execute it. - $this->db->setQuery($query); - $this->db->execute(); - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** @@ -9545,26 +9369,19 @@ class Get * * @return void * + * @deprecated 3.3 */ protected function setExistingCustomCode($when = 1) { - if (count((array) $this->existingCustomCode) >= $when) - { - foreach ($this->existingCustomCode as $code) - { - // Create a new query object. - $query = $this->db->getQuery(true); - // Prepare the update query. - $query->update( - $this->db->quoteName('#__componentbuilder_custom_code') - )->set($code['fields'])->where($code['conditions']); - // Set the query using our newly populated query object and execute it. - $this->db->setQuery($query); - $this->db->execute(); - } - // clear the values array - $this->existingCustomCode = array(); - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** @@ -9574,79 +9391,11 @@ class Get * @param string $today The date for today * * @return void - * + * @deprecated 3.3 Use CFactory::_('Customcode.Extractor')->run(); */ protected function customCodeFactory(&$paths, &$today) { - // we must first store the current working directory - $joomla = getcwd(); - $counter = array(1 => 0, 2 => 0); - // file types to get - $fileTypes = array('\.php', '\.js', '\.xml'); - - // set some local placeholders - $placeholders = array_flip( - $this->globalPlaceholders - ); - $placeholders[StringHelper::safe( - CFactory::_('Config')->component_code_name, 'F' - ) . 'Helper::'] - = Placefix::_('Component') . 'Helper::'; - $placeholders['COM_' . StringHelper::safe( - CFactory::_('Config')->component_code_name, 'U' - )] - = 'COM_' . Placefix::_('COMPONENT'); - $placeholders['com_' . CFactory::_('Config')->component_code_name] = 'com_' . Placefix::_('component'); - // putt the last first - $placeholders = array_reverse($placeholders, true); - - foreach ($paths as $target => $path) - { - // we are changing the working directory to the component path - chdir($path); - foreach ($fileTypes as $type) - { - // get a list of files in the current directory tree (only PHP, JS and XML for now) - $files = Folder::files('.', $type, true, true); - // check if files found - if (ArrayHelper::check($files)) - { - foreach ($files as $file) - { - $this->searchFileContent( - $counter, $file, $target, - $this->customCodePlaceholders, $placeholders, $today - ); - // insert new code - if (ArrayHelper::check( - $this->newCustomCode - )) - { - $this->setNewCustomCode(100); - } - // update existing custom code - if (ArrayHelper::check( - $this->existingCustomCode - )) - { - $this->setExistingCustomCode(30); - } - } - } - } - } - // change back to Joomla working directory - chdir($joomla); - // make sure all code is stored - if (ArrayHelper::check($this->newCustomCode)) - { - $this->setNewCustomCode(); - } - // update existing custom code - if (ArrayHelper::check($this->existingCustomCode)) - { - $this->setExistingCustomCode(); - } + CFactory::_('Customcode.Extractor')->run(); } /** @@ -9660,406 +9409,23 @@ class Get * * @return array on success * + * @deprecated 3.3 */ protected function searchFileContent(&$counter, &$file, &$target, &$searchArray, &$placeholders, &$today ) { - // we add a new search for the GUI CODE Blocks - CFactory::_('Customcode.Gui')->search($file, $placeholders, $today, $target); - // reset each time per file - $loadEndFingerPrint = false; - $endFingerPrint = array(); - $fingerPrint = array(); - $codeBucket = array(); - $pointer = array(); - $reading = array(); - $reader = 0; - // reset found Start type - $commentType = 0; - // make sure we have the path correct (the script file is not in admin path for example) - // there may be more... will nead to keep our eye on this... since files could be moved during install - $file = str_replace('./', '', $file); # TODO (windows path issues) - if ($file !== 'script.php') - { - $path = $target . '/' . $file; - } - else - { - $path = $file; - } - // now we go line by line - foreach (new SplFileObject($file) as $lineNumber => $lineContent) - { - // we musk keep last few lines to dynamic find target entry later - $fingerPrint[$lineNumber] = trim($lineContent); - // load the end fingerprint - if ($loadEndFingerPrint) - { - $endFingerPrint[$lineNumber] = trim($lineContent); - } - foreach ($searchArray as $type => $search) - { - $i = (int) ($type == 3 || $type == 4) ? 2 : 1; - $_type = (int) ($type == 1 || $type == 3) ? 1 : 2; - if ($reader === 0 || $reader === $i) - { - $targetKey = $type; - $start = '/***[' . $search . '***/'; - $end = '/***[/' . $search . '***/'; - $startHTML = ''; - $endHTML = ''; - // check if the ending place holder was found - if (isset($reading[$targetKey]) && $reading[$targetKey] - && ((trim($lineContent) === $end - || strpos( - $lineContent, $end - ) !== false) - || (trim($lineContent) === $endHTML - || strpos( - $lineContent, $endHTML - ) !== false))) - { - // trim the placeholder and if there is still data then load it - if (isset($endReplace) - && ($_line - = $this->addLineChecker( - $endReplace, 2, $lineContent - )) !== false) - { - $codeBucket[$pointer[$targetKey]][] = $_line; - } - // deactivate the reader - $reading[$targetKey] = false; - if ($_type == 2) - { - // deactivate search - $reader = 0; - } - else - { - // activate fingerPrint for replacement end target - $loadEndFingerPrint = true; - $backupTargetKey = $targetKey; - $backupI = $i; - } - // all new records we can do a bulk insert - if ($i === 1) - { - // end the bucket info for this code block - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - (int) $lineNumber - ); // 'toline' - // first reverse engineer this code block - $c0de = CFactory::_('Placeholder.Reverse')->engine( - implode('', $codeBucket[$pointer[$targetKey]]), - $placeholders, $target - ); - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - base64_encode($c0de) - ); // 'code' - if ($_type == 2) - { - // load the last value - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote(0); // 'hashendtarget' - } - } - // the record already exist so we must update instead - elseif ($i === 2) - { - // end the bucket info for this code block - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('to_line') . ' = ' - . $this->db->quote($lineNumber); - // first reverse engineer this code block - $c0de = CFactory::_('Placeholder.Reverse')->engine( - implode('', $codeBucket[$pointer[$targetKey]]), - $placeholders, $target, - $this->existingCustomCode[$pointer[$targetKey]]['id'] - ); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('code') . ' = ' - . $this->db->quote(base64_encode($c0de)); - if ($_type == 2) - { - // load the last value - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('hashendtarget') - . ' = ' . $this->db->quote(0); - } - } - } - // check if the endfingerprint is ready to save - if (count((array) $endFingerPrint) === 3) - { - $hashendtarget = '3__' . md5( - implode('', $endFingerPrint) - ); - // all new records we can do a bulk insert - if ($i === 1) - { - // load the last value - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - $hashendtarget - ); // 'hashendtarget' - } - // the record already exist so we must use module to update - elseif ($i === 2) - { - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('hashendtarget') . ' = ' - . $this->db->quote($hashendtarget); - } - // reset the needed values - $endFingerPrint = array(); - $loadEndFingerPrint = false; - // deactivate reader (to allow other search) - $reader = 0; - } - // then read in the code - if (isset($reading[$targetKey]) && $reading[$targetKey]) - { - $codeBucket[$pointer[$targetKey]][] = $lineContent; - } - // see if the custom code line starts now with PHP/JS comment type - if ((!isset($reading[$targetKey]) || !$reading[$targetKey]) - && (($i === 1 && trim($lineContent) === $start) - || strpos($lineContent, $start) !== false)) - { - $commentType = 1; // PHP/JS type - $startReplace = $start; - $endReplace = $end; - } - // see if the custom code line starts now with HTML comment type - elseif ((!isset($reading[$targetKey]) - || !$reading[$targetKey]) - && (($i === 1 && trim($lineContent) === $startHTML) - || strpos($lineContent, $startHTML) !== false)) - { - $commentType = 2; // HTML type - $startReplace = $startHTML; - $endReplace = $endHTML; - } - // check if the starting place holder was found - if ($commentType > 0) - { - // if we have all on one line we have a problem (don't load it TODO) - if (strpos($lineContent, $endReplace) !== false) - { - // reset found comment type - $commentType = 0; - $this->app->enqueueMessage( - JText::_('

    Custom Codes Warning

    '), - 'Warning' - ); - $this->app->enqueueMessage( - JText::sprintf( - 'We found dynamic code all in one line, and ignored it! Please review (%s) for more details!', - $path - ), 'Warning' - ); - continue; - } - // do a quick check to insure we have an id - $id = false; - if ($i === 2) - { - $id = $this->getSystemID( - $lineContent, - array(1 => $start, 2 => $startHTML), - $commentType - ); - } - if ($i === 2 && $id > 0) - { - // make sure we update it only once even if found again. - if (isset($this->codeAreadyDone[$id])) - { - // reset found comment type - $commentType = 0; - continue; - } - // store the id to avoid duplication - $this->codeAreadyDone[$id] = (int) $id; - } - // start replace - $startReplace = $this->setStartReplace( - $id, $commentType, $startReplace - ); - // set active reader (to lock out other search) - $reader = $i; - // set pointer - $pointer[$targetKey] = $counter[$i]; - // activate the reader - $reading[$targetKey] = true; - // start code bucket - $codeBucket[$pointer[$targetKey]] = array(); - // trim the placeholder and if there is still data then load it - if ($_line = $this->addLineChecker( - $startReplace, 1, $lineContent - )) - { - $codeBucket[$pointer[$targetKey]][] = $_line; - } - // get the finger print around the custom code - $inFinger = count($fingerPrint); - $getFinger = $inFinger - 1; - $hasharray = array_slice( - $fingerPrint, -$inFinger, $getFinger, true - ); - $hasleng = count($hasharray); - $hashtarget = $hasleng . '__' . md5( - implode('', $hasharray) - ); - // for good practice - ComponentbuilderHelper::fixPath($path); - // all new records we can do a bulk insert - if ($i === 1 || !$id) - { - // start the bucket for this code - $this->newCustomCode[$pointer[$targetKey]] - = array(); - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - $path - ); // 'path' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - (int) $_type - ); // 'type' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - 1 - ); // 'target' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - $commentType - ); // 'comment_type' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - (int) CFactory::_('Config')->component_id - ); // 'component' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - 1 - ); // 'published' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - $today - ); // 'created' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - (int) $this->user->id - ); // 'created_by' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - 1 - ); // 'version' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - 1 - ); // 'access' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - $hashtarget - ); // 'hashtarget' - $this->newCustomCode[$pointer[$targetKey]][] - = $this->db->quote( - (int) $lineNumber - ); // 'fromline' - } - // the record already exist so we must update instead - elseif ($i === 2 && $id > 0) - { - // start the bucket for this code - $this->existingCustomCode[$pointer[$targetKey]] - = array(); - $this->existingCustomCode[$pointer[$targetKey]]['id'] - = (int) $id; - $this->existingCustomCode[$pointer[$targetKey]]['conditions'] - = array(); - $this->existingCustomCode[$pointer[$targetKey]]['conditions'][] - = $this->db->quoteName('id') . ' = ' - . $this->db->quote($id); - $this->existingCustomCode[$pointer[$targetKey]]['fields'] - = array(); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('path') . ' = ' - . $this->db->quote($path); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('type') . ' = ' - . $this->db->quote($_type); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('comment_type') . ' = ' - . $this->db->quote($commentType); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('component') . ' = ' - . $this->db->quote(CFactory::_('Config')->component_id); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('from_line') . ' = ' - . $this->db->quote($lineNumber); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('modified') . ' = ' - . $this->db->quote($today); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('modified_by') . ' = ' - . $this->db->quote($this->user->id); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] - = $this->db->quoteName('hashtarget') . ' = ' - . $this->db->quote($hashtarget); - } - else // this should actualy never happen - { - // de activate the reader - $reading[$targetKey] = false; - $reader = 0; - } - // reset found comment type - $commentType = 0; - // update the counter - $counter[$i]++; - } - } - } - // make sure only a few lines is kept at a time - if (count((array) $fingerPrint) > 10) - { - $fingerPrint = array_slice($fingerPrint, -6, 6, true); - } - } - // if the code is at the end of the page and there were not three more lines - if (count((array) $endFingerPrint) > 0 || $loadEndFingerPrint) - { - if (count((array) $endFingerPrint) > 0) - { - $leng = count($endFingerPrint); - $hashendtarget = $leng . '__' . md5( - implode('', $endFingerPrint) - ); - } - else - { - $hashendtarget = 0; - } - // all new records we can do a buldk insert - if ($backupI === 1) - { - // load the last value - $this->newCustomCode[$pointer[$backupTargetKey]][] - = $this->db->quote($hashendtarget); // 'hashendtarget' - } - // the record already exist so we must use module to update - elseif ($backupI === 2) - { - $this->existingCustomCode[$pointer[$backupTargetKey]]['fields'][] - = $this->db->quoteName('hashendtarget') . ' = ' - . $this->db->quote($hashendtarget); - } - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); + + return []; } /** @@ -10072,55 +9438,7 @@ class Get */ protected function setDynamicHASHING($script) { - // check if we should hash a string - if (strpos($script, 'HASHSTRING((((') !== false) - { - // get the strings - $values = GetHelper::allBetween( - $script, 'HASHSTRING((((', '))))' - ); - $locker = array(); - // convert them - foreach ($values as $value) - { - $locker['HASHSTRING((((' . $value . '))))'] - = md5($value); - } - - // update the script - return CFactory::_('Placeholder')->update($script, $locker); - } - // check if we should hash a file - if (strpos($script, 'HASHFILE((((') !== false) - { - // get the strings - $values = GetHelper::allBetween( - $script, 'HASHFILE((((', '))))' - ); - $locker = array(); - // convert them - foreach ($values as $path) - { - // we first get the file if it exist - if ($value = FileHelper::getContent($path)) - { - // now we hash the file content - $locker['HASHFILE((((' . $path . '))))'] - = md5($value); - } - else - { - // could not retrieve the file so we show error - $locker['HASHFILE((((' . $path . '))))'] - = 'ERROR'; - } - } - - // update the script - return CFactory::_('Placeholder')->update($script, $locker); - } - - return $script; + return CFactory::_('Customcode.Hash')->set($script); } /** @@ -10133,30 +9451,7 @@ class Get */ protected function setBase64LOCK($script) { - if (strpos($script, 'LOCKBASE64((((') !== false) - { - // get the strings - $values = GetHelper::allBetween( - $script, 'LOCKBASE64((((', '))))' - ); - $locker = array(); - // convert them - foreach ($values as $value) - { - $locker['LOCKBASE64((((' . $value . '))))'] - = "base64_decode( preg_replace('/\s+/', ''," . - PHP_EOL . Indent::_(2) . "'" . - wordwrap( - base64_encode($value), 64, PHP_EOL . Indent::_(2), true - ) . - "'))"; - } - - // update the script - return CFactory::_('Placeholder')->update($script, $locker); - } - - return $script; + return CFactory::_('Customcode.LockBase')->set($script); } /** @@ -10184,15 +9479,17 @@ class Get */ protected function canAddGuiCodePlaceholder(&$code) { - // check for customcode placeholders - if (strpos($code, '$$$$') !== false) - { - // we do not add GUI wrapper placeholder to code - // that already has any customcode placeholders - return false; - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); - return true; + return false; } /** @@ -10220,29 +9517,19 @@ class Get * * @return bool true on success * + * @deprecated 3.3 */ protected function addLineChecker($replaceKey, $type, $lineContent) { - $check = explode($replaceKey, $lineContent); - switch ($type) - { - case 1: - // beginning of code - $i = trim($check[1]); - if (StringHelper::check($i)) - { - return $check[1]; - } - break; - case 2: - // end of code - $i = trim($check[0]); - if (StringHelper::check($i)) - { - return $check[0]; - } - break; - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); return false; } @@ -10256,23 +9543,21 @@ class Get * * @return array on success * + * @deprecated 3.3 */ protected function setStartReplace($id, $commentType, $startReplace) { - if ($id > 0) - { - switch ($commentType) - { - case 1: // the PHP & JS type - $startReplace .= '/*' . $id . '*/'; - break; - case 2: // the HTML type - $startReplace .= ''; - break; - } - } + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); - return $startReplace; + return []; } /** @@ -10282,33 +9567,23 @@ class Get * @param string $placeholders The values to search for * @param int $commentType The comment type * - * @return array on success + * @return int on success * + * @deprecated 3.3 */ protected function getSystemID(&$lineContent, $placeholders, $commentType) { - $trim = '/'; - if ($commentType == 2) - { - $trim = ' PHP/JS ---#################################### + * + * New Insert Code = /xxx[INSERT>$$$$]xxx/ /xxx[/INSERT>$$$$]xxx/ + * New Replace Code = /xxx[REPLACE>$$$$]xxx/ /xxx[/REPLACE>$$$$]xxx/ + * + * //////////////////////////////// when JCB adds it back ////////////////////////////////// + * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx//xx23xx/ /xxx[/INSERTED$$$$]xxx/ + * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx//xx25xx/ /xxx[/REPLACED$$$$]xxx/ + * + * /////////////////////////////// changeing existing custom code ///////////////////////// + * Update Inserted Code = /xxx[INSERTED>$$$$]xxx//xx23xx/ /xxx[/INSERTED>$$$$]xxx/ + * Update Replaced Code = /xxx[REPLACED>$$$$]xxx//xx25xx/ /xxx[/REPLACED>$$$$]xxx/ + * + * The custom script placeholders - we use the (==) to avoid detection it should be (--) + * ###################################---> HTML ---##################################### + * + * New Insert Code = !==[INSERT>$$$$]==> !==[/INSERT>$$$$]==> + * New Replace Code = !==[REPLACE>$$$$]==> !==[/REPLACE>$$$$]==> + * + * ///////////////////////////////// when JCB adds it back /////////////////////////////// + * JCB Add Inserted Code = + * JCB Add Replaced Code = + * + * //////////////////////////// changeing existing custom code /////////////////////////// + * Update Inserted Code = !==[INSERTED>$$$$]==> !==[/INSERTED>$$$$]==> + * Update Replaced Code = !==[REPLACED>$$$$]==> !==[/REPLACED>$$$$]==> + * + * ////////23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * More info read: https://git.vdm.dev/joomla/Component-Builder/wiki/TIPS:-Custom-Code + * + * @since 3.2.0 + */ +class Extractor +{ + /** + * The placeholder keys + * + * @var array + * @since 3.2.0 + */ + protected array $PKeys + = [ + 1 => 'REPLACE<>$$$$]', + 2 => 'INSERT<>$$$$]', + 3 => 'REPLACED<>$$$$]', + 4 => 'INSERTED<>$$$$]' + ]; + + /** + * The custom code in local files that already exist in system + * + * @var array + * @since 3.2.0 + */ + protected array $existing = []; + + /** + * The custom code in local files that are new + * + * @var array + * @since 3.2.0 + */ + protected array $new = []; + + /** + * The index of code already loaded + * + * @var array + * @since 3.2.0 + */ + protected array $done = []; + + /** + * The search counter + * + * @var array + * @since 3.2.0 + */ + protected array $counter = [1 => 0, 2 => 0]; + + /** + * The file types to search + * + * @var array + * @since 3.2.0 + */ + protected array $fileTypes = ['\.php', '\.js', '\.xml']; + + /** + * The local placeholders + * + * @var array + * @since 3.2.0 + */ + protected array $placeholders; + + /** + * Today's date in SQL format + * + * @var string + * @since 3.2.0 + */ + protected string $today; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + **/ + protected Config $config; + + /** + * Compiler Customcode Gui + * + * @var Gui + * @since 3.2.0 + **/ + protected Gui $gui; + + /** + * Compiler Customcode Extractor Paths + * + * @var Paths + * @since 3.2.0 + **/ + protected Paths $paths; + + /** + * Compiler Placeholder Reverse + * + * @var Reverse + * @since 3.2.0 + **/ + protected Reverse $reverse; + + /** + * Compiler Component Placeholder + * + * @var Placeholder + * @since 3.2.0 + **/ + protected Placeholder $componentPlaceholder; + + /** + * Current User Object + * + * @var User + * @since 3.2.0 + **/ + protected User $user; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Database object to query local DB + * + * @var CMSApplication + * @since 3.2.0 + **/ + protected CMSApplication $app; + + /** + * Constructor. + * + * @param Config|null $config The compiler config object. + * @param Gui|null $gui The compiler customcode gui object. + * @param Paths|null $paths The compiler customcode extractor paths object. + * @param Reverse|null $reverse The compiler placeholder reverse object. + * @param Placeholder|null $placeholder The compiler component placeholder object. + * @param User|null $user The current User object. + * @param \JDatabaseDriver|null $db The Database Driver object. + * @param CMSApplication|null $app The CMS Application object. + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Gui $gui = null, ?Paths $paths = null, + ?Reverse $reverse = null, ?Placeholder $placeholder = null, + ?User $user = null, ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->paths = $paths ?: Compiler::_('Customcode.Extractor.Paths'); + $this->reverse = $reverse ?: Compiler::_('Placeholder.Reverse'); + $this->componentPlaceholder = $placeholder ?: Compiler::_('Component.Placeholder'); + $this->user = $user ?: Factory::getUser(); + $this->db = $db ?: Factory::getDbo(); + $this->app = $app ?: Factory::getApplication(); + + // set today's date + $this->today = Factory::getDate()->toSql(); + + // set some local placeholders + $placeholders = array_flip( + $this->componentPlaceholder->get() + ); + + $placeholders[StringHelper::safe( + $this->config->component_code_name, 'F' + ) . 'Helper::'] = Placefix::_('Component') . 'Helper::'; + + $placeholders['COM_' . StringHelper::safe( + $this->config->component_code_name, 'U' + )] = 'COM_' . Placefix::_('COMPONENT'); + + $placeholders['com_' . $this->config->component_code_name] = 'com_' . Placefix::_('component'); + + // set the local placeholders + $this->placeholders = array_reverse($placeholders, true); + } + + /** + * get the custom code from the local files + * + * @return void + * @since 3.2.0 + */ + public function run() + { + // we must first store the current working directory + $joomla = getcwd(); + + foreach ($this->paths->active as $target => $path) + { + // we are changing the working directory to the component path + chdir($path); + foreach ($this->fileTypes as $type) + { + // get a list of files in the current directory tree (only PHP, JS and XML for now) + $files = Folder::files('.', $type, true, true); + + // check if files found + if (ArrayHelper::check($files)) + { + foreach ($files as $file) + { + // search the file + $this->searchFileContent($file, $target); + + // insert new code + $this->insert(100); + + // update existing custom code + $this->update(30); + } + } + } + } + + // change back to Joomla working directory + chdir($joomla); + + // make sure all code is stored + $this->insert(); + // update existing custom code + $this->update(); + } + + /** + * search a file for placeholders and store result + * + * @param string $file The file path to search + * + * @return array on success + * @since 3.2.0 + */ + protected function searchFileContent(&$file, &$target) + { + // we add a new search for the GUI CODE Blocks + $this->gui->search($file, $this->placeholders, $this->today, $target); + + // reset each time per file + $loadEndFingerPrint = false; + $endFingerPrint = []; + $fingerPrint = []; + $codeBucket = []; + $pointer = []; + $reading = []; + $reader = 0; + + // reset found Start type + $commentType = 0; + + // make sure we have the path correct (the script file is not in admin path for example) + // there may be more... will nead to keep our eye on this... since files could be moved during install + $file = str_replace('./', '', $file); # TODO (windows path issues) + + if ($file !== 'script.php') + { + $path = $target . '/' . $file; + } + else + { + $path = $file; + } + + // now we go line by line + foreach (new \SplFileObject($file) as $lineNumber => $lineContent) + { + // we must keep last few lines to dynamic find target entry later + $fingerPrint[$lineNumber] = trim($lineContent); + + // load the end fingerprint + if ($loadEndFingerPrint) + { + $endFingerPrint[$lineNumber] = trim($lineContent); + } + + foreach ($this->PKeys as $type => $search) + { + $i = (int) ($type == 3 || $type == 4) ? 2 : 1; + $_type = (int) ($type == 1 || $type == 3) ? 1 : 2; + + if ($reader === 0 || $reader === $i) + { + $targetKey = $type; + + $start = '/***[' . $search . '***/'; + $end = '/***[/' . $search . '***/'; + $startHTML = ''; + $endHTML = ''; + + // check if the ending placeholder was found + if (isset($reading[$targetKey]) && $reading[$targetKey] + && ((trim($lineContent) === $end + || strpos($lineContent, $end) !== false) + || (trim($lineContent) === $endHTML + || strpos($lineContent, $endHTML) !== false))) + { + // trim the placeholder and if there is still data then load it + if (isset($endReplace) + && ($_line = $this->addLineChecker($endReplace, 2, $lineContent)) !== false) + { + $codeBucket[$pointer[$targetKey]][] = $_line; + } + + // deactivate the reader + $reading[$targetKey] = false; + + if ($_type == 2) + { + // deactivate search + $reader = 0; + } + else + { + // activate fingerPrint for replacement end target + $loadEndFingerPrint = true; + $backupTargetKey = $targetKey; + $backupI = $i; + } + + // all new records we can do a bulk insert + if ($i === 1) + { + // end the bucket info for this code block + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $lineNumber + ); // 'toline' + + // first reverse engineer this code block + $c0de = $this->reverse->engine( + implode('', $codeBucket[$pointer[$targetKey]]), + $this->placeholders, $target + ); + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + base64_encode($c0de) + ); // 'code' + + if ($_type == 2) + { + // load the last value + $this->new[$pointer[$targetKey]][] + = $this->db->quote(0); // 'hashendtarget' + } + } + // the record already exist so we must update instead + elseif ($i === 2) + { + // end the bucket info for this code block + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('to_line') . ' = ' + . $this->db->quote($lineNumber); + + // first reverse engineer this code block + $c0de = $this->reverse->engine( + implode('', $codeBucket[$pointer[$targetKey]]), + $this->placeholders, $target, + $this->existing[$pointer[$targetKey]]['id'] + ); + + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('code') . ' = ' + . $this->db->quote(base64_encode($c0de)); + + if ($_type == 2) + { + // load the last value + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') + . ' = ' . $this->db->quote(0); + } + } + } + + // check if the endfingerprint is ready to save + if (count((array) $endFingerPrint) === 3) + { + $hashendtarget = '3__' . md5( + implode('', $endFingerPrint) + ); + + // all new records we can do a bulk insert + if ($i === 1) + { + // load the last value + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $hashendtarget + ); // 'hashendtarget' + } + // the record already exist so we must update + elseif ($i === 2) + { + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') . ' = ' + . $this->db->quote($hashendtarget); + } + + // reset the needed values + $endFingerPrint = []; + $loadEndFingerPrint = false; + + // deactivate reader (to allow other search) + $reader = 0; + } + + // then read in the code + if (isset($reading[$targetKey]) && $reading[$targetKey]) + { + $codeBucket[$pointer[$targetKey]][] = $lineContent; + } + + // see if the custom code line starts now with PHP/JS comment type + if ((!isset($reading[$targetKey]) || !$reading[$targetKey]) + && (($i === 1 && trim($lineContent) === $start) + || strpos($lineContent, $start) !== false)) + { + $commentType = 1; // PHP/JS type + $startReplace = $start; + $endReplace = $end; + } + // see if the custom code line starts now with HTML comment type + elseif ((!isset($reading[$targetKey]) + || !$reading[$targetKey]) + && (($i === 1 && trim($lineContent) === $startHTML) + || strpos($lineContent, $startHTML) !== false)) + { + $commentType = 2; // HTML type + $startReplace = $startHTML; + $endReplace = $endHTML; + } + + // check if the starting place holder was found + if ($commentType > 0) + { + // if we have all on one line we have a problem (don't load it TODO) + if (strpos($lineContent, $endReplace) !== false) + { + // reset found comment type + $commentType = 0; + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE'), + 'Warning' + ); + $this->app->enqueueMessage( + Text::sprintf('COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS', + $path + ), 'Warning' + ); + continue; + } + + // do a quick check to insure we have an id + $id = false; + if ($i === 2) + { + $id = $this->getSystemID( + $lineContent, + array(1 => $start, 2 => $startHTML), + $commentType + ); + } + + if ($i === 2 && $id > 0) + { + // make sure we update it only once even if found again. + if (isset($this->done[$id])) + { + // reset found comment type + $commentType = 0; + continue; + } + // store the id to avoid duplication + $this->done[$id] = (int) $id; + } + + // start replace + $startReplace = $this->setStartReplace( + $id, $commentType, $startReplace + ); + + // set active reader (to lock out other search) + $reader = $i; + + // set pointer + $pointer[$targetKey] = $this->counter[$i]; + + // activate the reader + $reading[$targetKey] = true; + + // start code bucket + $codeBucket[$pointer[$targetKey]] = []; + + // trim the placeholder and if there is still data then load it + if ($_line = $this->addLineChecker( + $startReplace, 1, $lineContent + )) + { + $codeBucket[$pointer[$targetKey]][] = $_line; + } + + // get the finger print around the custom code + $inFinger = count($fingerPrint); + $getFinger = $inFinger - 1; + $hasharray = array_slice( + $fingerPrint, -$inFinger, $getFinger, true + ); + $hasleng = count($hasharray); + $hashtarget = $hasleng . '__' . md5( + implode('', $hasharray) + ); + + // for good practice + Path::fix($path); + + // all new records we can do a bulk insert + if ($i === 1 || !$id) + { + // start the bucket for this code + $this->new[$pointer[$targetKey]] = []; + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $path + ); // 'path' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $_type + ); // 'type' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'target' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $commentType + ); // 'comment_type' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $this->config->component_id + ); // 'component' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'published' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $this->today + ); // 'created' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $this->user->id + ); // 'created_by' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'version' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + 1 + ); // 'access' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + $hashtarget + ); // 'hashtarget' + + $this->new[$pointer[$targetKey]][] + = $this->db->quote( + (int) $lineNumber + ); // 'fromline' + + } + // the record already exist so we must update instead + elseif ($i === 2 && $id > 0) + { + // start the bucket for this code + $this->existing[$pointer[$targetKey]] = []; + $this->existing[$pointer[$targetKey]]['id'] + = (int) $id; + $this->existing[$pointer[$targetKey]]['conditions'] = []; + $this->existing[$pointer[$targetKey]]['conditions'][] + = $this->db->quoteName('id') . ' = ' + . $this->db->quote($id); + $this->existing[$pointer[$targetKey]]['fields'] = []; + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('path') . ' = ' + . $this->db->quote($path); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('type') . ' = ' + . $this->db->quote($_type); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('comment_type') . ' = ' + . $this->db->quote($commentType); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('component') . ' = ' + . $this->db->quote($this->config->component_id); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('from_line') . ' = ' + . $this->db->quote($lineNumber); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('modified') . ' = ' + . $this->db->quote($this->today); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('modified_by') . ' = ' + . $this->db->quote($this->user->id); + $this->existing[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashtarget') . ' = ' + . $this->db->quote($hashtarget); + } + else // this should actualy never happen + { + // de activate the reader + $reading[$targetKey] = false; + $reader = 0; + } + + // reset found comment type + $commentType = 0; + // update the counter + $this->counter[$i]++; + } + } + } + + // make sure only a few lines is kept at a time + if (count((array) $fingerPrint) > 10) + { + $fingerPrint = array_slice($fingerPrint, -6, 6, true); + } + } + + // if the code is at the end of the page and there were not three more lines + if (count((array) $endFingerPrint) > 0 || $loadEndFingerPrint) + { + if (count((array) $endFingerPrint) > 0) + { + $leng = count($endFingerPrint); + $hashendtarget = $leng . '__' . md5( + implode('', $endFingerPrint) + ); + } + else + { + $hashendtarget = 0; + } + + // all new records we can do a buldk insert + if ($backupI === 1) + { + // load the last value + $this->new[$pointer[$backupTargetKey]][] + = $this->db->quote($hashendtarget); // 'hashendtarget' + } + // the record already exist so we must use module to update + elseif ($backupI === 2) + { + $this->existing[$pointer[$backupTargetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') . ' = ' + . $this->db->quote($hashendtarget); + } + } + } + + /** + * Insert the code + * + * @param int $when To set when to update + * + * @return void + * @since 3.2.0 + */ + protected function insert(int $when = 1) + { + if (ArrayHelper::check($this->new) >= $when) + { + // Create a new query object. + $query = $this->db->getQuery(true); + $continue = false; + // Insert columns. + $columns = array('path', 'type', 'target', 'comment_type', + 'component', 'published', 'created', 'created_by', + 'version', 'access', 'hashtarget', 'from_line', + 'to_line', 'code', 'hashendtarget'); + // Prepare the insert query. + $query->insert( + $this->db->quoteName('#__componentbuilder_custom_code') + ); + $query->columns($this->db->quoteName($columns)); + foreach ($this->new as $values) + { + if (count((array) $values) == 15) + { + $query->values(implode(',', $values)); + $continue = true; + } + else + { + // TODO line mismatch... should not happen + } + } + // clear the values array + $this->new = []; + if (!$continue) + { + return; // insure we don't continue if no values were loaded + } + // Set the query using our newly populated query object and execute it. + $this->db->setQuery($query); + $this->db->execute(); + } + } + + /** + * Update the code + * + * @param int $when To set when to update + * + * @return void + * @since 3.2.0 + */ + protected function update(int $when = 1) + { + if (ArrayHelper::check($this->existing) >= $when) + { + foreach ($this->existing as $code) + { + // Create a new query object. + $query = $this->db->getQuery(true); + // Prepare the update query. + $query->update( + $this->db->quoteName('#__componentbuilder_custom_code') + )->set($code['fields'])->where($code['conditions']); + // Set the query using our newly populated query object and execute it. + $this->db->setQuery($query); + $this->db->execute(); + } + // clear the values array + $this->existing = []; + } + } + + /** + * set the start replace placeholder + * + * @param int $id The comment id + * @param int $commentType The comment type + * @param string $startReplace The main replace string + * + * @return string on success + * @since 3.2.0 + */ + protected function setStartReplace(int $id, int $commentType, string $startReplace): string + { + if ($id > 0) + { + switch ($commentType) + { + case 1: // the PHP & JS type + $startReplace .= '/*' . $id . '*/'; + break; + case 2: // the HTML type + $startReplace .= ''; + break; + } + } + + return $startReplace; + } + + /** + * Check if this line should be added + * + * @param string $replaceKey The key to remove from line + * @param int $type The line type + * @param string $lineContent The line to check + * + * @return bool|int true on success + * @since 3.2.0 + */ + protected function addLineChecker(string $replaceKey, int $type, string $lineContent) + { + $check = explode($replaceKey, $lineContent); + switch ($type) + { + case 1: + // beginning of code + if (isset($check[1]) && StringHelper::check($check[1])) + { + return trim($check[1]); + } + break; + case 2: + // end of code + if (isset($check[0]) && StringHelper::check($check[0])) + { + return trim($check[0]); + } + break; + } + + return false; + } + + /** + * search for the system id in the line given + * + * @param string $lineContent The file path to search + * @param array $placeholders The values to search for + * @param int $commentType The comment type + * + * @return mixed on success + * @since 3.2.0 + */ + protected function getSystemID(string &$lineContent, array $placeholders, int $commentType) + { + $trim = '/'; + if ($commentType == 2) + { + $trim = ' @@ -228,10 +221,6 @@ class Placeholder 'end' => '' ]; } - else - { - return [ 'start' => "", 'end' => ""]; - } break; case 22: // @@ -242,10 +231,6 @@ class Placeholder 'end' => '' ]; } - else - { - return [ 'start' => "", 'end' => ""]; - } break; case 33: return ['start' => Placefix::h(), 'end' => Placefix::h()]; @@ -255,8 +240,9 @@ class Placeholder break; } - return false; + return [ 'start' => "", 'end' => ""]; } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php index 3afc35771..852ec1f5c 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php @@ -26,6 +26,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Placeholder; use VDM\Joomla\Componentbuilder\Compiler\Customcode; use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\PowerInterface; /** @@ -33,7 +34,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; * * @since 3.2.0 */ -class Power +class Power implements PowerInterface { /** * All loaded powers @@ -207,7 +208,7 @@ class Power $this->active[$guid]->key = $this->active[$guid]->id . '_' . $this->active[$guid]->target_type; // now set the name $this->active[$guid]->name = $this->placeholder->update( - $this->customcode->add($this->active[$guid]->name), + $this->customcode->update($this->active[$guid]->name), $this->placeholder->active ); // now set the code_name and class name @@ -382,7 +383,7 @@ class Power && StringHelper::check($this->active[$guid]->implements_custom)) { $this->active[$guid]->implement_names[] = $this->placeholder->update( - $this->customcode->add($this->active[$guid]->implements_custom), + $this->customcode->update($this->active[$guid]->implements_custom), $this->placeholder->active ); // just add this once @@ -409,7 +410,7 @@ class Power && StringHelper::check($this->active[$guid]->extends_custom)) { $this->active[$guid]->extends_name = $this->placeholder->update( - $this->customcode->add($this->active[$guid]->extends_custom), + $this->customcode->update($this->active[$guid]->extends_custom), $this->placeholder->active ); // just add once @@ -437,7 +438,7 @@ class Power // base64 Decode code $this->active[$guid]->head = $this->gui->set( $this->placeholder->update( - $this->customcode->add( + $this->customcode->update( base64_decode( $this->active[$guid]->head ) @@ -472,7 +473,7 @@ class Power } // now set the description $this->active[$guid]->description = (StringHelper::check($this->active[$guid]->description)) ? $this->placeholder->update( - $this->customcode->add($this->active[$guid]->description), + $this->customcode->update($this->active[$guid]->description), $this->placeholder->active ) : ''; // add the main code if set @@ -483,7 +484,7 @@ class Power // base64 Decode code $this->active[$guid]->main_class_code = $this->gui->set( $this->placeholder->update( - $this->customcode->add( + $this->customcode->update( base64_decode( $this->active[$guid]->main_class_code ) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php index 9273ae05b..c9364af28 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Customcode.php @@ -15,6 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Customcode as CompilerCustomcode; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\CustomcodeInterface; use VDM\Joomla\Componentbuilder\Compiler\Customcode\External; use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; use VDM\Joomla\Componentbuilder\Compiler\Customcode\Hash; @@ -71,10 +72,10 @@ class Customcode implements ServiceProviderInterface * * @param Container $container The DI container. * - * @return CompilerCustomcode + * @return CustomcodeInterface * @since 3.2.0 */ - public function getCustomcode(Container $container): CompilerCustomcode + public function getCustomcode(Container $container): CustomcodeInterface { return new CompilerCustomcode( $container->get('Config'), -- 2.45.1 From c5a85f167e3bc4e8fc1c2d6dc769cbe8770c9faa Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 10 Sep 2022 10:12:13 +0200 Subject: [PATCH 09/49] Moved many field related get methods to its own classes --- .../src/Componentbuilder/Compiler/Config.php | 33 ++ .../src/Componentbuilder/Compiler/Factory.php | 6 +- .../src/Componentbuilder/Compiler/Field.php | 142 ++++++++ .../Compiler/Field/Customcode.php | 232 ++++++++++++ .../Componentbuilder/Compiler/Field/Data.php | 329 ++++++++++++++++++ .../Compiler/Field/DatabaseName.php | 102 ++++++ .../Field/JoomlaThree/CoreValidation.php | 114 ++++++ .../Compiler/Field/JoomlaThree/index.html | 1 + .../Componentbuilder/Compiler/Field/Name.php | 234 +++++++++++++ .../Compiler/Field/TypeName.php | 127 +++++++ .../Compiler/Field/UniqueName.php | 112 ++++++ .../Compiler/Field/Validation.php | 168 +++++++++ .../Compiler/Field/index.html | 1 + .../Component/PlaceholderInterface.php | 4 +- .../Customcode/DispenserInterface.php | 4 +- .../Customcode/ExternalInterface.php | 4 +- .../Customcode/ExtractorInterface.php | 4 +- .../Interfaces/Customcode/GuiInterface.php | 4 +- .../Customcode/LockBaseInterface.php | 4 +- .../Compiler/Interfaces/EventInterface.php | 2 +- .../Interfaces/Extension/InstallInterface.php | 4 +- .../Field/CoreValidationInterface.php | 32 ++ .../Compiler/Interfaces/Field/index.html | 1 + .../Compiler/Interfaces/HistoryInterface.php | 34 ++ .../Compiler/JoomlaThree/Event.php | 6 +- .../Compiler/JoomlaThree/History.php | 232 ++++++++++++ .../Componentbuilder/Compiler/Placeholder.php | 5 +- .../Componentbuilder/Compiler/Registry.php | 48 +++ .../Service/{Config.php => Compiler.php} | 34 +- .../Compiler/Service/Event.php | 39 ++- .../Compiler/Service/Extension.php | 36 +- .../Compiler/Service/Field.php | 250 +++++++++++++ .../Compiler/Service/History.php | 88 +++++ .../Compiler/Utilities/Indent.php | 2 +- 34 files changed, 2406 insertions(+), 32 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Customcode.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Data.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/DatabaseName.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/CoreValidation.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Name.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/TypeName.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/UniqueName.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Validation.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/CoreValidationInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/HistoryInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/History.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/{Config.php => Compiler.php} (57%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php index 933ff6bc4..c1c5a3f05 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -498,6 +498,39 @@ class Config extends Registry implements \JsonSerializable, \ArrayAccess, \Itera // but this is a switch value and is changed many times return 'admin'; } + + /** + * get basic encryption switch + * + * @return bool Switch to control the encryption + * @since 3.2.0 + */ + protected function getBasicencryption(): bool + { + return false; + } + + /** + * get medium encryption switch + * + * @return bool Switch to control the encryption + * @since 3.2.0 + */ + protected function getMediumencryption(): bool + { + return false; + } + + /** + * get whmcs encryption switch + * + * @return bool Switch to control the encryption + * @since 3.2.0 + */ + protected function getWhmcsencryption(): bool + { + return false; + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php index 28da40a9e..5e48237dd 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php @@ -94,14 +94,16 @@ abstract class Factory protected static function createContainer(): Container { $container = (new Container()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Config()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Compiler()) ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Event()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\History()) ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Language()) ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder()) ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Customcode()) ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Power()) ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Component()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Extension()); + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Extension()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Field()); return $container; } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field.php new file mode 100644 index 000000000..ef1e36683 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field.php @@ -0,0 +1,142 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Field\Data; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name; +use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName; +use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; + + +/** + * Compiler Field + * + * @since 3.2.0 + */ +class Field +{ + /** + * Compiler Field Data + * + * @var Data + * @since 3.2.0 + **/ + protected Data $data; + + /** + * Compiler Field Name + * + * @var Name + * @since 3.2.0 + **/ + protected Name $name; + + /** + * Compiler Field Type Name + * + * @var TypeName + * @since 3.2.0 + **/ + protected TypeName $typeName; + + /** + * Compiler Field Unique Name + * + * @var UniqueName + * @since 3.2.0 + **/ + protected UniqueName $uniqueName; + + /** + * Constructor + * + * @param Data|null $data The compiler field data object. + * @param Name|null $name The compiler field name object. + * @param TypeName|null $typeName The compiler field type name object. + * @param UniqueName|null $uniqueName The compiler field unique name object. + * + * @since 3.2.0 + */ + public function __construct(?Data $data = null, ?Name $name = null, ?TypeName $typeName = null, ?UniqueName $uniqueName = null) + { + $this->data = $data ?: Compiler::_('Field.Data'); + $this->name = $name ?: Compiler::_('Field.Name'); + $this->typeName = $typeName ?: Compiler::_('Field.Type.Name'); + $this->uniqueName = $uniqueName ?: Compiler::_('Field.Unique.Name'); + } + + /** + * set Field details + * + * @param array $field The field array. + * @param string|null $singleViewName The single view name. + * @param string|null $listViewName The list view name. + * @param string $amicably The peaceful resolve. + * + * @return void + * @since 3.2.0 + */ + public function set(array &$field, ?string $singleViewName = null, ?string $listViewName = null, string $amicably = '') + { + // set hash + static $hash = 123467890; + + // load hash if not found + if (!isset($field['hash'])) + { + $field['hash'] = \md5($field['field'] . $hash); + // increment hash + $hash++; + } + + // set the settings + if (!isset($field['settings'])) + { + $field['settings'] = $this->data->get( + $field['field'], $singleViewName, $listViewName + ); + } + + // set real field name + if (!isset($field['base_name'])) + { + $field['base_name'] = $this->name->get($field); + } + + // set code name for field type + if (!isset($field['type_name'])) + { + $field['type_name'] = $this->typeName->get($field); + } + + // check if value is array + if (isset($field['permission']) + && !ArrayHelper::check($field['permission']) + && is_numeric($field['permission']) && $field['permission'] > 0) + { + $field['permission'] = array($field['permission']); + } + + // set unique name keeper + if ($listViewName) + { + $this->uniqueName->set( + $field['base_name'], $listViewName . $amicably + ); + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Customcode.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Customcode.php new file mode 100644 index 000000000..45961edb6 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Customcode.php @@ -0,0 +1,232 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; + + +/** + * Compiler Field Customcode + * + * @since 3.2.0 + */ +class Customcode +{ + /** + * Tracking the update of fields per/view + * + * @var array + * @since 3.2.0 + */ + protected array $views; + + /** + * Compiler Customcode Dispenser + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * Constructor + * + * @param Dispenser|null $dispenser The compiler customcode dispenser object. + * + * @since 3.2.0 + */ + public function __construct(?Dispenser $dispenser = null) + { + $this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser'); + } + + /** + * Update field customcode + * + * @param int $id The field id + * @param object $field The field object + * @param string|null $singleViewName The view edit or single name + * @param string|null $listViewName The view list name + * + * @return void + * @since 3.2.0 + */ + public function update(int $id, object &$field, $singleViewName = null, $listViewName = null) + { + // check if we should load scripts for single view + if ($singleViewName && StringHelper::check($singleViewName) + && !isset($this->views[$singleViewName][$id])) + { + // add_javascript_view_footer + if ($field->add_javascript_view_footer == 1 + && StringHelper::check( + $field->javascript_view_footer + )) + { + $convert__ = true; + if (isset($field->javascript_view_footer_decoded) + && $field->javascript_view_footer_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->javascript_view_footer, + 'view_footer', + $singleViewName, + null, + array( + 'table' => 'field', + 'id' => (int) $id, + 'field' => 'javascript_view_footer', + 'type' => 'js', + 'prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->javascript_view_footer_decoded)) + { + $field->javascript_view_footer_decoded + = true; + } + + if (strpos($field->javascript_view_footer, "token") !== false + || strpos($field->javascript_view_footer, "task=ajax") !== false) + { + if (!isset($this->dispenser->hub['token'])) + { + $this->dispenser->hub['token'] = []; + } + if (!isset($this->dispenser->hub['token'][$singleViewName]) + || !$this->dispenser->hub['token'][$singleViewName]) + { + $this->dispenser->hub['token'][$singleViewName] + = true; + } + } + } + + // add_css_view + if ($field->add_css_view == 1) + { + $convert__ = true; + if (isset($field->css_view_decoded) + && $field->css_view_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->css_view, + 'css_view', + $singleViewName, + null, + array('prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->css_view_decoded)) + { + $field->css_view_decoded = true; + } + } + + // add this only once to single view. + $this->views[$singleViewName][$id] = true; + } + + // check if we should load scripts for list views + if ($listViewName && StringHelper::check($listViewName) + && !isset($this->views[$listViewName][$id])) + { + // add_javascript_views_footer + if ($field->add_javascript_views_footer == 1 + && StringHelper::check( + $field->javascript_views_footer + )) + { + $convert__ = true; + if (isset($field->javascript_views_footer_decoded) + && $field->javascript_views_footer_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->javascript_views_footer, + 'views_footer', + $singleViewName, + null, + array( + 'table' => 'field', + 'id' => (int) $id, + 'field' => 'javascript_views_footer', + 'type' => 'js', + 'prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->javascript_views_footer_decoded)) + { + $field->javascript_views_footer_decoded = true; + } + if (strpos($field->javascript_views_footer, "token") !== false + || strpos($field->javascript_views_footer, "task=ajax") !== false) + { + if (!isset($this->dispenser->hub['token'])) + { + $this->dispenser->hub['token'] = []; + } + if (!isset($this->dispenser->hub['token'][$listViewName]) + || !$this->dispenser->hub['token'][$listViewName]) + { + $this->dispenser->hub['token'][$listViewName] + = true; + } + } + } + + // add_css_views + if ($field->add_css_views == 1) + { + $convert__ = true; + if (isset($field->css_views_decoded) + && $field->css_views_decoded) + { + $convert__ = false; + } + $this->dispenser->set( + $field->css_views, + 'css_views', + $singleViewName, + null, + array('prefix' => PHP_EOL), + $convert__, + $convert__, + true + ); + if (!isset($field->css_views_decoded)) + { + $field->css_views_decoded = true; + } + } + + // add this only once to list view. + $this->views[$listViewName][$id] = true; + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Data.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Data.php new file mode 100644 index 000000000..8b8230939 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Data.php @@ -0,0 +1,329 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode as FieldCustomcode; +use VDM\Joomla\Componentbuilder\Compiler\Field\Validation; + + +/** + * Compiler Field Data + * + * @since 3.2.0 + */ +class Data +{ + /** + * Compiler Fields + * + * @var array + * @since 3.2.0 + */ + protected array $fields; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Compiler Event + * + * @var EventInterface + * @since 3.2.0 + */ + protected EventInterface $event; + + /** + * Compiler History + * + * @var HistoryInterface + * @since 3.2.0 + */ + protected HistoryInterface $history; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Field Customcode + * + * @var FieldCustomcode + * @since 3.2.0 + */ + protected FieldCustomcode $fieldCustomcode; + + /** + * Compiler Field Validation + * + * @var Validation + * @since 3.2.0 + */ + protected Validation $validation; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param EventInterface|null $event The compiler event api object. + * @param HistoryInterface|null $history The compiler history object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * @param FieldCustomcode|null $fieldCustomcode The field customcode object. + * @param Validation|null $validation The field validation rule object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?EventInterface $event = null, ?HistoryInterface $history = null, + ?Placeholder $placeholder = null, ?Customcode $customcode = null, ?FieldCustomcode $fieldCustomcode = null, + ?Validation $validation = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->event = $event ?: Compiler::_('Event'); + $this->history = $history ?: Compiler::_('History'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->fieldCustomcode = $fieldCustomcode ?: Compiler::_('Field.Customcode'); + $this->validation = $validation ?: Compiler::_('Field.Validation'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get all Field Data + * + * @param int $id The field ID + * @param string|null $singleViewName The view edit or single name + * @param string|null $listViewName The view list name + * + * @return object|null The field data + * @since 3.2.0 + */ + public function get(int $id, ?string $singleViewName = null, ?string $listViewName = null): ?object + { + if ($id > 0 && !isset($this->fields[$id])) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select all the values in the field + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array('c.name', 'c.properties'), + array('type_name', 'properties') + ) + ); + $query->from('#__componentbuilder_field AS a'); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_fieldtype', 'c') + . ' ON (' . $this->db->quoteName('a.fieldtype') . ' = ' + . $this->db->quoteName('c.id') . ')' + ); + $query->where( + $this->db->quoteName('a.id') . ' = ' . $this->db->quote($id) + ); + + // TODO we need to update the event signatures + $context = $this->config->component_context; + + // Trigger Event: jcb_ce_onBeforeQueryFieldData + $this->event->trigger( + 'jcb_ce_onBeforeQueryFieldData', + array(&$context, &$id, &$query, &$this->db) + ); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // Load the results as a list of stdClass objects (see later for more options on retrieving data). + $field = $this->db->loadObject(); + + // Trigger Event: jcb_ce_onBeforeModelFieldData + $this->event->trigger( + 'jcb_ce_onBeforeModelFieldData', + array(&$context, &$field) + ); + + // adding a fix for the changed name of type to fieldtype + $field->type = $field->fieldtype; + + // load the values form params + $field->xml = $this->customcode->update(json_decode($field->xml)); + + // check if we have validate (validation rule and set it if found) + $this->validation->set($id, $field->xml); + + // load the type values form type params + $field->properties = (isset($field->properties) + && JsonHelper::check($field->properties)) + ? json_decode($field->properties, true) : null; + if (ArrayHelper::check($field->properties)) + { + $field->properties = array_values($field->properties); + } + + // check if we have WHMCS encryption + if (4 == $field->store + && !$this->config->whmcs_encryption) + { + $this->config->whmcs_encryption = true; + } + // check if we have basic encryption + elseif (3 == $field->store + && !$this->config->basic_encryption) + { + $this->config->basic_encryption = true; + } + // check if we have better encryption + elseif (5 == $field->store + && $this->config->medium_encryption) + { + $this->config->medium_encryption = true; + } + // check if we have better encryption + elseif (6 == $field->store + && StringHelper::check( + $field->on_get_model_field + ) + && StringHelper::check( + $field->on_save_model_field + )) + { + // add only if string lenght found + if (StringHelper::check( + $field->initiator_on_save_model + )) + { + $field->initiator_save_key = md5( + $field->initiator_on_save_model + ); + $field->initiator_save = explode( + PHP_EOL, $this->placeholder->update( + $this->customcode->update( + base64_decode( + $field->initiator_on_save_model + ) + ), $this->placeholder->active + ) + ); + } + if (StringHelper::check( + $field->initiator_on_save_model + )) + { + $field->initiator_get_key = md5( + $field->initiator_on_get_model + ); + $field->initiator_get = explode( + PHP_EOL, $this->placeholder->update( + $this->customcode->update( + base64_decode( + $field->initiator_on_get_model + ) + ), $this->placeholder->active + ) + ); + } + // set the field modeling + $field->model_field['save'] = explode( + PHP_EOL, $this->placeholder->update( + $this->customcode->update( + base64_decode($field->on_save_model_field) + ), $this->placeholder->active + ) + ); + $field->model_field['get'] = explode( + PHP_EOL, $this->placeholder->update( + $this->customcode->update( + base64_decode($field->on_get_model_field) + ), $this->placeholder->active + ) + ); + // remove the original values + unset( + $field->on_save_model_field, + $field->on_get_model_field, + $field->initiator_on_save_model, + $field->initiator_on_get_model + ); + } + + // get the last used version + $field->history = $this->history->get('field', $id); + + // Trigger Event: jcb_ce_onAfterModelFieldData + $this->event->trigger( + 'jcb_ce_onAfterModelFieldData', + array(&$context, &$field) + ); + + $this->fields[$id] = $field; + } + else + { + return null; + } + } + + if ($id > 0 && isset($this->fields[$id])) + { + // update the customcode of the field + $this->fieldCustomcode->update($id, $this->fields[$id], $singleViewName, $listViewName); + + // return the field + return $this->fields[$id]; + } + + return null; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/DatabaseName.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/DatabaseName.php new file mode 100644 index 000000000..045147446 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/DatabaseName.php @@ -0,0 +1,102 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Registry; + + +/** + * Compiler Field Database Name + * + * @since 3.2.0 + */ +class DatabaseName +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Registry|null $config The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * get the field database name and AS prefix + * + * @param string $nameListCode The list view name + * @param int $fieldId The field ID + * @param string $targetArea The area being targeted + * + * @return string|null + * @since 3.2.0 + */ + public function get(string $nameListCode, int $fieldId, string $targetArea = 'builder.list'): ?string + { + if (($fields = $this->registry->get("${targetArea}.${nameListCode}")) !== null) + { + if ($fieldId < 0) + { + switch ($fieldId) + { + case -1: + return 'a.id'; + case -2: + return 'a.ordering'; + case -3: + return 'a.published'; + } + } + foreach ($fields as $field) + { + if ($field['id'] == $fieldId) + { + // now check if this is a category + if ($field['type'] === 'category') + { + return 'c.title'; + } + // set the custom code + elseif (ArrayHelper::check( + $field['custom'] + )) + { + return $field['custom']['db'] . "." + . $field['custom']['text']; + } + else + { + return 'a.' . $field['code']; + } + } + } + } + + return null; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/CoreValidation.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/CoreValidation.php new file mode 100644 index 000000000..60a9658c0 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/CoreValidation.php @@ -0,0 +1,114 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree; + + +use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; + + +/** + * Core Joomla Field Validation Rules + * + * @since 3.2.0 + */ +class CoreValidation implements CoreValidationInterface +{ + /** + * Local Core Joomla Rules + * + * @var array|null + * @since 3.2.0 + **/ + protected ?array $rules = null; + + /** + * Local Core Joomla Rules Path + * + * @var string + * @since 3.2.0 + **/ + protected string $path; + + /** + * Constructor + * + * @since 3.2.0 + */ + public function __construct() + { + // set the path to the form validation rules + $this->path = JPATH_LIBRARIES . '/src/Form/Rule'; + } + + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array + { + if (!$this->rules) + { + // check if the path exist + if (!Folder::exists($this->path)) + { + return []; + } + + // we must first store the current working directory + $joomla = getcwd(); + + // go to that folder + chdir($this->path); + + // load all the files in this path + $rules = Folder::files('.', '\.php', true, true); + + // change back to Joomla working directory + chdir($joomla); + + // make sure we have an array + if (!ArrayHelper::check($rules)) + { + return false; + } + + // remove the Rule.php from the name + $this->rules = array_map( function ($name) { + return str_replace(array('./','Rule.php'), '', $name); + }, $rules); + } + + // return rules if found + if (is_array($this->rules)) + { + // check if the names should be all lowercase + if ($lowercase) + { + return array_map( function($item) { + return strtolower($item); + }, $this->rules); + } + return $this->rules; + } + + // return empty array + return []; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/JoomlaThree/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Name.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Name.php new file mode 100644 index 000000000..6eba81148 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Name.php @@ -0,0 +1,234 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\String\TypeHelper; +use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; +use VDM\Joomla\Componentbuilder\Compiler\Registry; + + +/** + * Compiler Field Name + * + * @since 3.2.0 + */ +class Name +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Unique Field Names + * + * @var array + * @since 3.2.0 + */ + protected array $unique; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Field Unique Name + * + * @var UniqueName + * @since 3.2.0 + */ + protected UniqueName $uniqueName; + + /** + * Constructor + * + * @param Placeholder|null $placeholder The compiler component placeholder object. + * @param UniqueName|null $uniqueName The compiler field unique name object. + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Placeholder $placeholder = null, ?UniqueName $uniqueName = null, ?Registry $registry = null) + { + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->uniqueName = $uniqueName ?: Compiler::_('Field.Unique.Name'); + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Get the field's actual name + * + * @param array $field The field array + * @param string|null $listViewName The list view name + * @param string $amicably The peaceful resolve (for fields in subforms in same view :) + * + * @return string Success returns field name + * @since 3.2.0 + */ + public function get(array &$field, ?string $listViewName = null, string $amicably = ''): string + { + // return the unique name if already set + if ($listViewName && StringHelper::check($listViewName) + && isset($field['hash']) + && isset( + $this->unique[$listViewName . $amicably . $field['hash']] + )) + { + return $this->unique[$listViewName . $amicably . $field['hash']]; + } + + // always make sure we have a field name and type + if (!isset($field['settings']) || !isset($field['settings']->type_name) + || !isset($field['settings']->name)) + { + return 'error'; + } + + // set the type name + $type_name = TypeHelper::safe( + $field['settings']->type_name + ); + + // set the name of the field + $name = FieldHelper::safe($field['settings']->name); + + // check that we have the properties + if (ArrayHelper::check($field['settings']->properties)) + { + foreach ($field['settings']->properties as $property) + { + if ($property['name'] === 'name') + { + // if category then name must be catid (only one per view) + if ($type_name === 'category') + { + // quick check if this is a category linked to view page + $requeSt_id = GetHelper::between( + $field['settings']->xml, 'name="', '"' + ); + if (strpos($requeSt_id, '_request_id') !== false + || strpos($requeSt_id, '_request_catid') !== false) + { + // keep it then, don't change + $name = $this->placeholder->update( + $requeSt_id, $this->placeholder->active + ); + } + else + { + $name = 'catid'; + } + + // if list view name is set + if (StringHelper::check($listViewName)) + { + // check if we should use another Text Name as this views name + $otherName = $this->placeholder->update( + GetHelper::between( + $field['settings']->xml, 'othername="', '"' + ), $this->placeholder->active + ); + $otherViews = $this->placeholder->update( + GetHelper::between( + $field['settings']->xml, 'views="', '"' + ), $this->placeholder->active + ); + $otherView = $this->placeholder->update( + GetHelper::between( + $field['settings']->xml, 'view="', '"' + ), $this->placeholder->active + ); + // This is to link other view category + if (StringHelper::check($otherName) + && StringHelper::check( + $otherViews + ) && StringHelper::check( + $otherView + )) + { + // set other category details + $this->registry->set("category.other.name.${listViewName}", [ + 'name' => FieldHelper::safe( + $otherName + ), + 'views' => StringHelper::safe( + $otherViews + ), + 'view' => StringHelper::safe( + $otherView + ) + ]); + } + } + } + // if tag is set then enable all tag options for this view (only one per view) + elseif ($type_name === 'tag') + { + $name = 'tags'; + } + // if the field is set as alias it must be called alias + elseif (isset($field['alias']) && $field['alias']) + { + $name = 'alias'; + } + else + { + // get value from xml + $xml = FieldHelper::safe( + $this->placeholder->update( + GetHelper::between( + $field['settings']->xml, 'name="', '"' + ), $this->placeholder->active + ) + ); + // check if a value was found + if (StringHelper::check($xml)) + { + $name = $xml; + } + } + // exit foreach loop + break; + } + } + } + + // return the value unique + if (StringHelper::check($listViewName) && isset($field['hash'])) + { + $this->unique[$listViewName . $amicably . $field['hash']] + = $this->uniqueName->get($name, $listViewName . $amicably); + + // now return the unique name + return $this->unique[$listViewName . $amicably . $field['hash']]; + } + + // fall back to global + return $name; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/TypeName.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/TypeName.php new file mode 100644 index 000000000..c8148acc9 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/TypeName.php @@ -0,0 +1,127 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\String\TypeHelper; + + +/** + * Compiler Field Type Name + * + * @since 3.2.0 + */ +class TypeName +{ + /** + * Get the field's actual type + * + * @param object $field The field object + * + * @return string Success returns field type + * @since 3.2.0 + */ + public function get(&$field) + { + // check if we have done this already + if (isset($field['type_name'])) + { + return $field['type_name']; + } + + // check that we have the properties + if (isset($field['settings']) + && ObjectHelper::check( + $field['settings'] + ) + && isset($field['settings']->properties) + && ArrayHelper::check( + $field['settings']->properties + )) + { + // search for own custom fields + if (strpos($field['settings']->type_name, '@') !== false) + { + // set own custom field + $field['settings']->own_custom = $field['settings']->type_name; + $field['settings']->type_name = 'Custom'; + } + + // set the type name + $type_name = TypeHelper::safe( + $field['settings']->type_name + ); + + // if custom (we must use the xml value) + if (strtolower($type_name) === 'custom' + || strtolower($type_name) === 'customuser') + { + $type = TypeHelper::safe( + GetHelper::between( + $field['settings']->xml, 'type="', '"' + ) + ); + } + else + { + // loop over properties looking for the type value + foreach ($field['settings']->properties as $property) + { + if ($property['name'] + === 'type') // type field is never adjustable (unless custom) + { + // force the default value + if (isset($property['example']) + && StringHelper::check( + $property['example'] + )) + { + $type = TypeHelper::safe( + $property['example'] + ); + } + // fall back on the xml settings (not ideal) + else + { + $type = TypeHelper::safe( + GetHelper::between( + $field['settings']->xml, 'type="', '"' + ) + ); + } + // exit foreach loop + break; + } + } + } + // check if the value is set + if (isset($type) && StringHelper::check($type)) + { + return $type; + } + // fallback on type name set in name field (not ideal) + else + { + return $type_name; + } + } + + // fall back to text + return 'text'; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/UniqueName.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/UniqueName.php new file mode 100644 index 000000000..62db3c49a --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/UniqueName.php @@ -0,0 +1,112 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Componentbuilder\Compiler\Registry; + + +/** + * Compiler Field Unique Name + * + * @since 3.2.0 + */ +class UniqueName +{ + /** + * The compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + } + + /** + * Count how many times the same field is used per view + * + * @param string $name The name of the field + * @param string $view The name of the view + * + * @return void + * @since 3.2.0 + */ + public function set(string $name, string $view) + { + if (($number = $this->registry->get("unique.names.${view}.counter.${name}")) === null) + { + $this->registry->set("unique.names.${view}.counter.${name}", 1); + + return; + } + + // count how many times the field is used + $this->registry->set("unique.names.${view}.counter.${name}", ++$number); + + return; + } + + /** + * Naming each field with an unique name + * + * @param string $name The name of the field + * @param string $view The name of the view + * + * @return string the name + * @since 3.2.0 + */ + public function get(string $name, string $view): string + { + // only increment if the field name is used multiple times + if ($this->registry->get("unique.names.${view}.counter.${name}") > 1) + { + $counter = 1; + // set the unique name + $unique_name = FieldHelper::safe( + $name . '_' . $counter + ); + + while ($this->registry->get("unique.names.${view}.names.${unique_name}") !== null) + { + // increment the number + $counter++; + // try again + $unique_name = FieldHelper::safe( + $name . '_' . $counter + ); + } + + // set the new name number + $this->registry->set("unique.names.${view}.names.${unique_name}", $counter); + + // return the unique name + return $unique_name; + } + + return $name; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Validation.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Validation.php new file mode 100644 index 000000000..f22a3c838 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/Validation.php @@ -0,0 +1,168 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Field; + + +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Compiler\Registry; +use VDM\Joomla\Componentbuilder\Compiler\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; + + +/** + * Compiler Field Validation Rules + * + * @since 3.2.0 + */ +class Validation +{ + /** + * Compiler registry + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $registry; + + /** + * Compiler Gui + * + * @var Gui + * @since 3.2.0 + */ + protected Gui $gui; + + /** + * Compiler Placeholder + * + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * Compiler Customcode + * + * @var Customcode + * @since 3.2.0 + */ + protected Customcode $customcode; + + /** + * Compiler Field Core Validation + * + * @var CoreValidationInterface + * @since 3.2.0 + */ + protected CoreValidationInterface $validation; + + /** + * Constructor + * + * @param Registry|null $registry The compiler registry object. + * @param Gui|null $gui The compiler customcode gui object. + * @param Placeholder|null $placeholder The compiler placeholder object. + * @param Customcode|null $customcode The compiler customcode object. + * @param CoreValidationInterface|null $validation The core validation rule object. + * + * @since 3.2.0 + */ + public function __construct(?Registry $registry = null, ?Gui $gui = null, ?Placeholder $placeholder = null, + ?Customcode $customcode = null, ?CoreValidationInterface $validation = null) + { + $this->registry = $registry ?: Compiler::_('Registry'); + $this->gui = $gui ?: Compiler::_('Customcode.Gui'); + $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); + $this->customcode = $customcode ?: Compiler::_('Customcode'); + $this->validation = $validation ?: Compiler::_('Field.Core.Validation'); + } + + /** + * Set the validation rule + * + * @param int $id The field id + * @param string $field The field string + * + * @return void + * @since 3.2.0 + */ + public function set(int $id, string $field) + { + // check if we have validate (validation rule set) + $validation_rule = GetHelper::between( + $field, 'validate="', '"' + ); + + if (StringHelper::check($validation_rule)) + { + // make sure it is lowercase + $validation_rule = StringHelper::safe( + $validation_rule + ); + + // link this field to this validation (don't move this down) + $this->registry->set("validation.linked.${id}", $validation_rule); + + // make sure it is not already set + if ($this->registry->get("validation.rules.${validation_rule}") === null) + { + // get joomla core validation names and make sure this rule is not a core validation rule + if (!in_array($validation_rule, (array) $this->validation->get(true))) + { + // get the class methods for this rule if it exists + if (($php_code = GetHelper::var( + 'validation_rule', $validation_rule, 'name', 'php' + )) !== false) + { + // open and set the validation rule + $this->registry->set("validation.rules.${validation_rule}", + $this->gui->set( + $this->placeholder->update( + $this->customcode->update( + base64_decode( + $php_code + ) + ), $this->placeholder->active + ), + array( + 'table' => 'validation_rule', + 'field' => 'php', + 'id' => GetHelper::var( + 'validation_rule', + $validation_rule, 'name', 'id' + ), + 'type' => 'php' + ) + ) + ); + } + else + { + // TODO set the notice that this validation rule is custom and was not found + $this->registry->remove("validation.linked.${id}"); + } + } + else + { + // remove link (we only want custom validations linked) + $this->registry->remove("validation.linked.${id}"); + } + } + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Field/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php index ccb1c3d8d..c90737faa 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php @@ -13,7 +13,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component; /** - * Component Placeholder Interface + * Component Placeholder Interface + * + * @since 3.2.0 */ interface PlaceholderInterface { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/DispenserInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/DispenserInterface.php index 1b272ec19..38c3d2eea 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/DispenserInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/DispenserInterface.php @@ -13,7 +13,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; /** - * Customcode Dispenser Interface + * Customcode Dispenser Interface + * + * @since 3.2.0 */ interface DispenserInterface { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExternalInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExternalInterface.php index 8b2d0297f..d293921a2 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExternalInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExternalInterface.php @@ -13,7 +13,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; /** - * Customcode External Interface + * Customcode External Interface + * + * @since 3.2.0 */ interface ExternalInterface { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExtractorInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExtractorInterface.php index 4cfde81c0..f02f7ba8e 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExtractorInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/ExtractorInterface.php @@ -13,7 +13,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; /** - * Customcode Extractor Interface + * Customcode Extractor Interface + * + * @since 3.2.0 */ interface ExtractorInterface { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/GuiInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/GuiInterface.php index 7b4760040..c06cd055d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/GuiInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/GuiInterface.php @@ -13,7 +13,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; /** - * Customcode Gui Interface + * Customcode Gui Interface + * + * @since 3.2.0 */ interface GuiInterface { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/LockBaseInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/LockBaseInterface.php index fc5429d27..3a82e5565 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/LockBaseInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Customcode/LockBaseInterface.php @@ -13,7 +13,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode; /** - * Customcode LockBase Interface + * Customcode LockBase Interface + * + * @since 3.2.0 */ interface LockBaseInterface { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php index e9e67c911..548734d54 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/EventInterface.php @@ -23,7 +23,7 @@ interface EventInterface * Trigger an event * * @param string $event The event to trigger - * @param mix $data The values to pass to the event/plugin + * @param mixed $data The values to pass to the event/plugin * * @return void * @since 3.2.0 diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Extension/InstallInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Extension/InstallInterface.php index b19945f23..4f4e44fcb 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Extension/InstallInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Extension/InstallInterface.php @@ -13,7 +13,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension; /** - * The properties an extension should have to be passed to the InstallScript class + * The properties an extension should have to be passed to the InstallScript class + * + * @since 3.2.0 */ interface InstallInterface { diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/CoreValidationInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/CoreValidationInterface.php new file mode 100644 index 000000000..1b520382a --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/CoreValidationInterface.php @@ -0,0 +1,32 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field; + + +/** + * Field Joomla Core Validation Interface + * + * @since 3.2.0 + */ +interface CoreValidationInterface +{ + /** + * Get the Array of Existing Validation Rule Names + * + * @param bool $lowercase Switch to set rules lowercase + * + * @return array + * @since 3.2.0 + */ + public function get(bool $lowercase = false): array; +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Field/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/HistoryInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/HistoryInterface.php new file mode 100644 index 000000000..870e217fb --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/HistoryInterface.php @@ -0,0 +1,34 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces; + + +/** + * Compiler History Interface + * + * @since 3.2.0 + */ +interface HistoryInterface +{ + /** + * Get Item History object + * + * @param string $type The type of item + * @param int $id The item ID + * + * @return ?object The history item object + * @since 3.2.0 + */ + public function get(string $type, int $id): ?object; + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php index 8e1264f8c..ed413656a 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/Event.php @@ -12,6 +12,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaThree; +use Joomla\Registry\Registry; use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; @@ -64,12 +65,13 @@ class Event implements EventInterface * Trigger and event * * @param string $event The event to trigger - * @param mix $data The values to pass to the event/plugin + * @param mixed $data The values to pass to the event/plugin * * @return void + * @throws \Exception * @since 3.2.0 */ - public function trigger($event, $data) + public function trigger(string $event, $data) { // only execute if plugins were loaded (active) if ($this->activePlugins) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/History.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/History.php new file mode 100644 index 000000000..e600ff60b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaThree/History.php @@ -0,0 +1,232 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\JoomlaThree; + + +use Joomla\CMS\Factory; +use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; + + +/** + * Compiler History + * + * @since 3.2.0 + */ +class History implements HistoryInterface +{ + /** + * History Item Object + * + * @var object|null + * @since 3.2.0 + */ + protected ?object $tmp; + + /** + * Compiler Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + */ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The compiler config object. + * @param \JDatabaseDriver|null $db The Database Driver object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Compiler::_('Config'); + $this->db = $db ?: Factory::getDbo(); + } + + /** + * Get Item History object + * + * @param string $type The type of item + * @param int $id The item ID + * + * @return ?object The history + * @since 3.2.0 + */ + public function get(string $type, int $id): ?object + { + // quick class object to store old history object + $this->tmp = null; + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__ucm_history AS h'); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); + // Join over the content type for the type id + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); + $query->order('h.save_date DESC'); + $this->db->setQuery($query, 0, 1); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // new version of this item found + // so we need to mark it as the last compiled version + $newActive = $this->db->loadObject(); + // set the new version watch + $this->set($newActive, 1); + } + // Get last compiled verion + $query = $this->db->getQuery(true); + + $query->select('h.*'); + $query->from('#__ucm_history AS h'); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); + $query->where('h.keep_forever = 1'); + $query->where('h.version_note LIKE ' . $this->db->quote('%component%')); + // make sure it does not return the active version + if (isset($newActive) && isset($newActive->version_id)) + { + $query->where('h.version_id != ' . (int) $newActive->version_id); + } + // Join over the content type for the type id + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); + $query->order('h.save_date DESC'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // the old active version was found + // so we may need to do an SQL update + // and unmark the old compiled version + $oldActives = $this->db->loadObjectList(); + foreach ($oldActives as $oldActive) + { + // remove old version watch + $this->set($oldActive, 0); + } + } + + // return the last used history record or null. + return $this->tmp; + } + + /** + * Set Item History Watch + * + * @param Object $object The history object + * @param int $action The action to take + * 0 = remove watch + * 1 = add watch + * + * @return bool + * @since 3.2.0 + */ + protected function set(object $object, int $action): bool + { + // check the note + if (JsonHelper::check($object->version_note)) + { + $version_note = json_decode($object->version_note, true); + } + else + { + $version_note = array('component' => array()); + } + // set watch + switch ($action) + { + case 0: + // remove watch + if (isset($version_note['component']) + && ($key = array_search( + $this->config->component_id, $version_note['component'] + )) !== false) + { + // last version that was used to build/compile + $this->tmp = json_decode($object->version_data); + // remove it from this component + unset($version_note['component'][$key]); + } + else + { + // since it was not found, no need to update anything + return true; + } + break; + case 1: + // add watch + if (!in_array($this->config->component_id, $version_note['component'])) + { + $version_note['component'][] = $this->config->component_id; + } + else + { + // since it is there already, no need to update anything + return true; + } + break; + } + // check if we need to still keep this locked + if (isset($version_note['component']) + && ArrayHelper::check($version_note['component'])) + { + // insure component ids are only added once per item + $version_note['component'] = array_unique( + $version_note['component'] + ); + // we may change this, little risky (but since JCB does not have history notes it should be okay for now) + $object->version_note = json_encode($version_note); + $object->keep_forever = '1'; + } + else + { + $object->version_note = ''; + $object->keep_forever = '0'; + } + + // run the update + return $this->db->updateObject('#__ucm_history', $object, 'version_id'); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php index a99bef647..f7e54ca4d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Placeholder.php @@ -124,7 +124,7 @@ class Placeholder implements PlaceholderInterface // make sure the placeholders is an array if (!ArrayHelper::check($placeholder)) { - // This is an error, (TODO) actualy we need to add a kind of log here to know that this happened + // This is an error, TODO actually we need to add a kind of log here to know that this happened return $data; } // continue with the work of replacement @@ -189,9 +189,6 @@ class Placeholder implements PlaceholderInterface { switch ($type) { - case 3: - return [ 'start' => "", 'end' => ""]; - break; case 11: //***[REPLACED$$$$]***//**1**/ if ($this->config->get('add_placeholders', false) === true) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php new file mode 100644 index 000000000..5e188777d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php @@ -0,0 +1,48 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler; + + +use Joomla\Registry\Registry as JoomlaRegistry; + + +/** + * Compiler Registry + * + * So we have full control over this class + * + * @since 3.2.0 + */ +class Registry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable +{ + /** + * Method to iterate over any part of the registry + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * + * @return \ArrayIterator This object represented as an ArrayIterator. + * + * @since 3.4.0 + */ + public function _($path) + { + $data = $this->extract($path); + + if ($data === null) + { + return null; + } + + return $data->getIterator(); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Compiler.php similarity index 57% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Config.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Compiler.php index 08372e34a..1cd1da451 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Compiler.php @@ -14,15 +14,16 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Config as CompilerConfig; +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Registry; /** - * Compiler Config Service Provider + * Compiler Service Provider * * @since 3.2.0 */ -class Config implements ServiceProviderInterface +class Compiler implements ServiceProviderInterface { /** * Registers the service provider with a DI container. @@ -34,8 +35,11 @@ class Config implements ServiceProviderInterface */ public function register(Container $container) { - $container->alias(CompilerConfig::class, 'Config') + $container->alias(Config::class, 'Config') ->share('Config', [$this, 'getConfig'], true); + + $container->alias(Registry::class, 'Registry') + ->share('Registry', [$this, 'getRegistry'], true); } /** @@ -43,12 +47,26 @@ class Config implements ServiceProviderInterface * * @param Container $container The DI container. * - * @return CompilerConfig + * @return Config * @since 3.2.0 */ - public function getConfig(Container $container): CompilerConfig + public function getConfig(Container $container): Config { - return new CompilerConfig(); - } + return new Config(); + } + + /** + * Get the Compiler Registry + * + * @param Container $container The DI container. + * + * @return Registry + * @since 3.2.0 + */ + public function getRegistry(Container $container): Registry + { + return new Registry(); + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php index 4f892f35d..71ceb4e51 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php @@ -13,7 +13,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; -use Joomla\DI\ServiceProviderInterface; +use Joomla\DI\ServiceProviderInterface; +use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; @@ -25,6 +26,14 @@ use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; */ class Event implements ServiceProviderInterface { + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + /** * Registers the service provider with a DI container. * @@ -37,6 +46,27 @@ class Event implements ServiceProviderInterface { $container->alias(J3Event::class, 'J3.Event') ->share('J3.Event', [$this, 'getJ3Event'], true); + + $container->alias(EventInterface::class, 'Event') + ->share('Event', [$this, 'getEvent'], true); + } + + /** + * Get the Event + * + * @param Container $container The DI container. + * + * @return EventInterface + * @since 3.2.0 + */ + public function getEvent(Container $container): EventInterface + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Event'); } /** @@ -44,12 +74,13 @@ class Event implements ServiceProviderInterface * * @param Container $container The DI container. * - * @return EventInterface + * @return J3Event * @since 3.2.0 */ - public function getJ3Event(Container $container): EventInterface + public function getJ3Event(Container $container): J3Event { return new J3Event(); - } + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php index 72b6c0445..79f4e7f8d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php @@ -25,6 +25,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as */ class Extension implements ServiceProviderInterface { + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + /** * Registers the service provider with a DI container. * @@ -35,6 +43,9 @@ class Extension implements ServiceProviderInterface */ public function register(Container $container) { + $container->alias(GetScriptInterface::class, 'Extension.InstallScript') + ->share('Extension.InstallScript', [$this, 'getExtensionInstallScript'], true); + $container->alias(J3InstallScript::class, 'J3.Extension.InstallScript') ->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true); } @@ -44,12 +55,31 @@ class Extension implements ServiceProviderInterface * * @param Container $container The DI container. * + * @return J3InstallScript + * @since 3.2.0 + */ + public function getJ3ExtensionInstallScript(Container $container): J3InstallScript + { + return new J3InstallScript(); + } + + /** + * Get the Joomla Extension Install Script + * + * @param Container $container The DI container. + * * @return GetScriptInterface * @since 3.2.0 */ - public function getJ3ExtensionInstallScript(Container $container): GetScriptInterface + public function getExtensionInstallScript(Container $container): GetScriptInterface { - return new J3InstallScript(); - } + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Extension.InstallScript'); + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php new file mode 100644 index 000000000..0f225ad5d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php @@ -0,0 +1,250 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Field as CompilerField; +use VDM\Joomla\Componentbuilder\Compiler\Field\Data; +use VDM\Joomla\Componentbuilder\Compiler\Field\Name; +use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName; +use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; +use VDM\Joomla\Componentbuilder\Compiler\Field\Validation; +use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreValidation as J3CoreValidation; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; + + +/** + * Compiler Field + * + * @since 3.2.0 + */ +class Field implements ServiceProviderInterface +{ + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(CompilerField::class, 'Field') + ->share('Field', [$this, 'getField'], true); + + $container->alias(Data::class, 'Field.Data') + ->share('Field.Data', [$this, 'getData'], true); + + $container->alias(Validation::class, 'Field.Validation') + ->share('Field.Validation', [$this, 'getValidation'], true); + + $container->alias(J3CoreValidation::class, 'J3.Field.Core.Validation') + ->share('J3.Field.Core.Validation', [$this, 'getJ3CoreValidation'], true); + + $container->alias(CoreValidationInterface::class, 'Field.Core.Validation') + ->share('Field.Core.Validation', [$this, 'getCoreValidation'], true); + + $container->alias(Customcode::class, 'Field.Customcode') + ->share('Field.Customcode', [$this, 'getCustomcode'], true); + + $container->alias(Name::class, 'Field.Name') + ->share('Field.Name', [$this, 'getFieldName'], true); + + $container->alias(TypeName::class, 'Field.Type.Name') + ->share('Field.Type.Name', [$this, 'getFieldTypeName'], true); + + $container->alias(UniqueName::class, 'Field.Unique.Name') + ->share('Field.Unique.Name', [$this, 'getFieldUniqueName'], true); + + $container->alias(DatabaseName::class, 'Field.Database.Name') + ->share('Field.Database.Name', [$this, 'getFieldDatabaseName'], true); + } + + /** + * Get the Compiler Field + * + * @param Container $container The DI container. + * + * @return CompilerField + * @since 3.2.0 + */ + public function getField(Container $container): CompilerField + { + return new CompilerField( + $container->get('Field.Data'), + $container->get('Field.Name'), + $container->get('Field.Type.Name'), + $container->get('Field.Unique.Name') + ); + } + + /** + * Get the Compiler Field Data + * + * @param Container $container The DI container. + * + * @return Data + * @since 3.2.0 + */ + public function getData(Container $container): Data + { + return new Data( + $container->get('Config'), + $container->get('Event'), + $container->get('History'), + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Field.Customcode'), + $container->get('Field.Validation') + ); + } + + /** + * Get the Compiler Field Validation + * + * @param Container $container The DI container. + * + * @return Validation + * @since 3.2.0 + */ + public function getValidation(Container $container): Validation + { + return new Validation( + $container->get('Registry'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Customcode'), + $container->get('Field.Core.Validation') + ); + } + + /** + * Get the Compiler Field Joomla 3 Validation + * + * @param Container $container The DI container. + * + * @return J3CoreValidation + * @since 3.2.0 + */ + public function getJ3CoreValidation(Container $container): J3CoreValidation + { + return new J3CoreValidation(); + } + + /** + * Get the Compiler Field Core Validation + * + * @param Container $container The DI container. + * + * @return CoreValidationInterface + * @since 3.2.0 + */ + public function getCoreValidation(Container $container): CoreValidationInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Field.Core.Validation'); + } + + /** + * Get the Compiler Field Customcode + * + * @param Container $container The DI container. + * + * @return Customcode + * @since 3.2.0 + */ + public function getCustomcode(Container $container): Customcode + { + return new Customcode( + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get the Compiler Field Name + * + * @param Container $container The DI container. + * + * @return Name + * @since 3.2.0 + */ + public function getFieldName(Container $container): Name + { + return new Name( + $container->get('Placeholder'), + $container->get('Field.Unique.Name'), + $container->get('Registry') + ); + } + + /** + * Get the Compiler Field Type Name + * + * @param Container $container The DI container. + * + * @return TypeName + * @since 3.2.0 + */ + public function getFieldTypeName(Container $container): TypeName + { + return new TypeName(); + } + + /** + * Get the Compiler Field Unique Name + * + * @param Container $container The DI container. + * + * @return UniqueName + * @since 3.2.0 + */ + public function getFieldUniqueName(Container $container): UniqueName + { + return new UniqueName( + $container->get('Registry') + ); + } + + /** + * Get the Compiler Field Database Name + * + * @param Container $container The DI container. + * + * @return DatabaseName + * @since 3.2.0 + */ + public function getFieldDatabaseName(Container $container): DatabaseName + { + return new DatabaseName( + $container->get('Registry') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php new file mode 100644 index 000000000..8d92f41a7 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php @@ -0,0 +1,88 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\CMS\Version; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History; + + +/** + * History Service Provider + * + * @since 3.2.0 + */ +class History implements ServiceProviderInterface +{ + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3History::class, 'J3.History') + ->share('J3.History', [$this, 'getJ3History'], true); + + $container->alias(HistoryInterface::class, 'History') + ->share('History', [$this, 'getHistory'], true); + } + + /** + * Get the History + * + * @param Container $container The DI container. + * + * @return HistoryInterface + * @since 3.2.0 + */ + public function getHistory(Container $container): HistoryInterface + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.History'); + } + + /** + * Get the Joomla 3 History + * + * @param Container $container The DI container. + * + * @return J3History + * @since 3.2.0 + */ + public function getJ3History(Container $container): J3History + { + return new J3History( + $container->get('Config') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php index ff3422f1b..446ab04fe 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Indent.php @@ -46,7 +46,7 @@ abstract class Indent * @return string * @since 3.2.0 */ - public function _(int $nr): string + public static function _(int $nr): string { // check if we already have the string if (!isset(self::$bucket[$nr])) -- 2.45.1 From 1dddba0fc82dbae07021a85f568335fbbe2bd30b Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 10 Sep 2022 10:16:44 +0200 Subject: [PATCH 10/49] Moved some arrays to the Registry, and marked and updated deprecated class methods and values in the compiler. --- README.md | 8 +- admin/README.txt | 8 +- admin/config.xml | 10 - admin/helpers/compiler.php | 50 +- admin/helpers/compiler/a_Get.php | 1088 ++--------------- admin/helpers/compiler/b_Structure.php | 22 +- admin/helpers/compiler/c_Fields.php | 94 +- admin/helpers/compiler/e_Interpretation.php | 278 ++--- admin/helpers/compiler/f_Infusion.php | 45 +- admin/helpers/extrusion/b_builder.php | 2 +- .../en-GB/en-GB.com_componentbuilder.ini | 5 - admin/layouts/power/code_left.php | 6 +- admin/models/power.php | 6 +- admin/sql/install.mysql.utf8.sql | 4 +- componentbuilder.xml | 2 +- 15 files changed, 340 insertions(+), 1288 deletions(-) diff --git a/README.md b/README.md index 79fdd2705..f6a473d39 100644 --- a/README.md +++ b/README.md @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 3rd September, 2022 ++ *Last Build*: 10th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **321830** ++ *Line count*: **324186** + *Field count*: **2002** -+ *File count*: **2107** -+ *Folder count*: **363** ++ *File count*: **2125** ++ *Folder count*: **366** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 79fdd2705..f6a473d39 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 3rd September, 2022 ++ *Last Build*: 10th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **321830** ++ *Line count*: **324186** + *Field count*: **2002** -+ *File count*: **2107** -+ *Folder count*: **363** ++ *File count*: **2125** ++ *Folder count*: **366** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/config.xml b/admin/config.xml index 974a94e8f..ea930586a 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -678,16 +678,6 @@ size="60" default="" /> - -
    writeFile($xmlPath, $componentXML); } // Trigger Event: jcb_ce_onBeforeUpdateFiles - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeUpdateFiles', array(&$this->componentContext, &$this) ); @@ -133,7 +133,7 @@ class Compiler extends Infusion return false; } // Trigger Event: jcb_ce_onBeforeGetCustomCode - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeGetCustomCode', array(&$this->componentContext, &$this) ); @@ -141,7 +141,7 @@ class Compiler extends Infusion if (CFactory::_('Customcode')->get()) { // Trigger Event: jcb_ce_onBeforeAddCustomCode - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeAddCustomCode', array(&$this->componentContext, &$this) ); @@ -149,7 +149,7 @@ class Compiler extends Infusion $this->addCustomCode(); } // Trigger Event: jcb_ce_onBeforeSetLangFileData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeSetLangFileData', array(&$this->componentContext, &$this) ); @@ -627,7 +627,7 @@ class Compiler extends Infusion protected function setFileContent(&$name, &$path, &$bom, $view = null) { // Trigger Event: jcb_ce_onBeforeSetFileContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeSetFileContent', array(&$this->componentContext, &$name, &$path, &$bom, &$view) ); @@ -642,7 +642,7 @@ class Compiler extends Infusion // get content of the file $string = ComponentbuilderHelper::getFileContents($path); // Trigger Event: jcb_ce_onGetFileContents - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onGetFileContents', array(&$this->componentContext, &$string, &$name, &$path, &$bom, &$view) @@ -670,7 +670,7 @@ class Compiler extends Infusion $answer = CFactory::_('Customcode')->update($answer); } // Trigger Event: jcb_ce_onBeforeSetFileContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeWriteFileContent', array(&$this->componentContext, &$answer, &$name, &$path, &$bom, &$view) @@ -983,7 +983,7 @@ class Compiler extends Infusion . $this->componentData->sales_name . '__joomla_' . CFactory::_('Config')->get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData) @@ -993,7 +993,7 @@ class Compiler extends Infusion // set the new data Folder::copy($this->componentPath, $repoFullPath, '', true); // Trigger Event: jcb_ce_onAfterUpdateRepo - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData) @@ -1014,7 +1014,7 @@ class Compiler extends Infusion . $module->folder_name . '__joomla_' . CFactory::_('Config')->get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module) @@ -1028,7 +1028,7 @@ class Compiler extends Infusion $module->folder_path, $repoFullPath, '', true ); // Trigger Event: jcb_ce_onAfterUpdateRepo - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module) @@ -1051,7 +1051,7 @@ class Compiler extends Infusion . $plugin->folder_name . '__joomla_' . CFactory::_('Config')->get('version', 3); // Trigger Event: jcb_ce_onBeforeUpdateRepo - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeUpdateRepo', array(&$plugin_context, &$plugin->folder_path, &$repoFullPath, &$plugin) @@ -1065,7 +1065,7 @@ class Compiler extends Infusion $plugin->folder_path, $repoFullPath, '', true ); // Trigger Event: jcb_ce_onAfterUpdateRepo - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterUpdateRepo', array(&$plugin_context, &$plugin->folder_path, &$repoFullPath, &$plugin) @@ -1084,7 +1084,7 @@ class Compiler extends Infusion $this->filepath['component'] = $this->tempPath . '/' . $this->filepath['component-folder'] . '.zip'; // Trigger Event: jcb_ce_onBeforeZipComponent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeZipComponent', array(&$this->componentContext, &$this->componentPath, &$this->filepath['component'], &$this->tempPath, @@ -1099,7 +1099,7 @@ class Compiler extends Infusion if ($this->backupPath && $this->dynamicIntegration) { // Trigger Event: jcb_ce_onBeforeBackupZip - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBackupZip', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, @@ -1121,7 +1121,7 @@ class Compiler extends Infusion if (isset($this->componentData->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeMoveToServer', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, @@ -1137,7 +1137,7 @@ class Compiler extends Infusion } } // Trigger Event: jcb_ce_onAfterZipComponent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterZipComponent', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, &$this->componentFolderName, @@ -1176,7 +1176,7 @@ class Compiler extends Infusion $this->filepath['modules'][$module->id] = $this->tempPath . '/' . $module->zip_name . '.zip'; // Trigger Event: jcb_ce_onBeforeZipModule - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeZipModule', array(&$module_context, &$module->folder_path, &$this->filepath['modules'][$module->id], @@ -1193,7 +1193,7 @@ class Compiler extends Infusion { $__module_context = 'module.' . $module_context; // Trigger Event: jcb_ce_onBeforeBackupZip - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBackupZip', array(&$__module_context, &$this->filepath['modules'][$module->id], @@ -1215,7 +1215,7 @@ class Compiler extends Infusion if (isset($module->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeMoveToServer', array(&$__module_context, &$this->filepath['modules'][$module->id], @@ -1232,7 +1232,7 @@ class Compiler extends Infusion } } // Trigger Event: jcb_ce_onAfterZipModule - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterZipModule', array(&$module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, @@ -1270,7 +1270,7 @@ class Compiler extends Infusion $this->filepath['plugins'][$plugin->id] = $this->tempPath . '/' . $plugin->zip_name . '.zip'; // Trigger Event: jcb_ce_onBeforeZipPlugin - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeZipPlugin', array(&$plugin_context, &$plugin->folder_path, &$this->filepath['plugins'][$plugin->id], @@ -1287,7 +1287,7 @@ class Compiler extends Infusion { $__plugin_context = 'plugin.' . $plugin_context; // Trigger Event: jcb_ce_onBeforeBackupZip - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBackupZip', array(&$__plugin_context, &$this->filepath['plugins'][$plugin->id], @@ -1309,7 +1309,7 @@ class Compiler extends Infusion if (isset($plugin->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeMoveToServer', array(&$__plugin_context, &$this->filepath['plugins'][$plugin->id], @@ -1326,7 +1326,7 @@ class Compiler extends Infusion } } // Trigger Event: jcb_ce_onAfterZipPlugin - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterZipPlugin', array(&$plugin_context, &$this->filepath['plugins'][$plugin->id], &$this->tempPath, diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index a19c91efb..6e3f2769b 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -682,6 +682,7 @@ class Get * The validation rules that should be added * * @var array + * @deprecated 3.3 Use CFactory::_('Registry')->get('validation.rules'); */ public $validationRules = array(); @@ -689,6 +690,7 @@ class Get * The validation linked to fields * * @var array + * @deprecated 3.3 Use CFactory::_('Registry')->get('validation.linked'); */ public $validationLinkedFields = array(); @@ -703,6 +705,7 @@ class Get * The field data array * * @var array + * @deprecated 3.3 */ private $_fieldData = array(); @@ -728,6 +731,7 @@ class Get * Set unique Names * * @var array + * @deprecated 3.3 Use CFactory::_('Registry')->get('unique.names'); */ public $uniqueNames = array(); @@ -735,6 +739,7 @@ class Get * Set unique Names * * @var array + * @deprecated */ protected $uniqueFieldNames = array(); @@ -742,6 +747,7 @@ class Get * Category other name bucket * * @var array + * @deprecated 3.3 Use CFactory::_('Registry')->get('category.other.name'); */ public $catOtherName = array(); @@ -749,6 +755,7 @@ class Get * The field relations values * * @var array + * @deprecate Use CFactory::_('Registry')->get('builder.field_relations'); */ public $fieldRelations = array(); @@ -772,6 +779,7 @@ class Get * The list join fields * * @var array + * @deprecate Use CFactory::_('Registry')->get('builder.list_join'); */ public $listJoinBuilder = array(); @@ -779,6 +787,7 @@ class Get * The list head over ride * * @var array + * @deprecate Use CFactory::_('Registry')->get('builder.list_head_override'); */ public $listHeadOverRide = array(); @@ -842,6 +851,7 @@ class Get * The WHMCS Encryption Switch * * @var boolean + * @deprecated 3.3 Use CFactory::_('Config')->whmcs_encryption; */ public $whmcsEncryption = false; @@ -849,6 +859,7 @@ class Get * The Basic Encryption Switch * * @var boolean + * @deprecated 3.3 Use CFactory::_('Config')->basic_encryption; */ public $basicEncryption = false; @@ -856,6 +867,7 @@ class Get * The Medium Encryption Switch * * @var boolean + * @deprecated 3.3 Use CFactory::_('Config')->medium_encryption; */ public $mediumEncryption = false; @@ -863,6 +875,7 @@ class Get * The Custom field Switch per view * * @var array + * @deprecated 3.3 */ public $customFieldScript = array(); @@ -985,7 +998,7 @@ class Get // Set the params $this->params = JComponentHelper::getParams('com_componentbuilder'); // Trigger Event: jcb_ce_onBeforeGet - CFactory::_J('Event')->trigger('jcb_ce_onBeforeGet', array(&$config, &$this)); + CFactory::_('Event')->trigger('jcb_ce_onBeforeGet', array(&$config, &$this)); // set the Joomla version @deprecated $this->joomlaVersion = CFactory::_('Config')->joomla_version; // set the minfy switch of the JavaScript @deprecated @@ -1051,14 +1064,14 @@ class Get CFactory::_('Customcode.Extractor')->run(); // Trigger Event: jcb_ce_onBeforeGetComponentData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeGetComponentData', array(&$this->componentContext, &$this) ); // get the component data $this->componentData = $this->getComponentData(); // Trigger Event: jcb_ce_onAfterGetComponentData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterGetComponentData', array(&$this->componentContext, &$this) ); @@ -1100,7 +1113,7 @@ class Get ); // Trigger Event: jcb_ce_onBeforeGet - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterGet', array(&$this->componentContext, &$this) ); @@ -1113,12 +1126,12 @@ class Get * @param int $nr The number of tag/space * * @return string - * + * @deprecated 3.3 Use Indent::_($nr); */ public function _t($nr) { // use global method for conformity - return ComponentbuilderHelper::_t($nr); + return Indent::_($nr); } /** @@ -1128,11 +1141,11 @@ class Get * @param mix $data The values to pass to the event/plugin * * @return void - * @deprecated 3.3 Use CFactory::_J('Event')->trigger($event, $data); + * @deprecated 3.3 Use CFactory::_('Event')->trigger($event, $data); */ public function triggerEvent($event, $data) { - return CFactory::_J('Event')->trigger($event, $data); + return CFactory::_('Event')->trigger($event, $data); } /** @@ -1217,7 +1230,7 @@ class Get ); // Trigger Event: jcb_ce_onBeforeQueryComponentData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeQueryComponentData', array(&$this->componentContext, &$this->componentID, &$query, &$this->db) @@ -1230,7 +1243,7 @@ class Get $component = $this->db->loadObject(); // Trigger Event: jcb_ce_onBeforeModelComponentData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeModelComponentData', array(&$this->componentContext, &$component) ); @@ -1622,9 +1635,9 @@ class Get $field['alias'] = 0; $field['title'] = 0; // set the field details - $this->setFieldDetails($field); + CFactory::_('Field')->set($field); // set unique name counter - $this->setUniqueNameCounter($field['base_name'], 'configs'); + CFactory::_('Field.Unique.Name')->set($field['base_name'], 'configs'); // return field return $field; @@ -1635,7 +1648,7 @@ class Get foreach ($component->config as $field) { // so first we lock the field name in - $this->getFieldName($field, 'configs'); + CFactory::_('Field.Name')->get($field, 'configs'); } // unset original value unset($component->addconfig); @@ -1666,10 +1679,10 @@ class Get } // build update SQL - $old_admin_views = $this->getHistoryWatch( + $old_admin_views = CFactory::_('History')->get( 'component_admin_views', $component->addadmin_views_id ); - $old_component = $this->getHistoryWatch( + $old_component = CFactory::_('History')->get( 'joomla_component', CFactory::_('Config')->component_id ); if ($old_component || $old_admin_views) @@ -2079,7 +2092,7 @@ class Get unset($component->addjoomla_plugins); // Trigger Event: jcb_ce_onAfterModelComponentData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterModelComponentData', array(&$this->componentContext, &$component) ); @@ -2098,7 +2111,6 @@ class Get * * @return void * @deprecated 3.3 Use CFactory::_('Language')->set($target, $language, $string, $addPrefix); - * */ public function setLangContent($target, $language, $string, $addPrefix = false @@ -2114,7 +2126,6 @@ class Get * * @return string * @deprecated 3.3 - * */ public function fixLangString(&$string) { @@ -2189,7 +2200,7 @@ class Get $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Trigger Event: jcb_ce_onBeforeQueryViewData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeQueryViewData', array(&$this->componentContext, &$id, &$query, &$this->db) ); @@ -2222,7 +2233,7 @@ class Get $name_length = CFactory::_('Config')->component_code_name_length + strlen( $view->name_single_code ) + 5; - // when the name is larger then 49 we need to add the assets table name fix + // when the name is larger than 49 we need to add the assets' table name fix if ($name_length > 49) { $this->addAssetsTableNameFix = true; @@ -2304,7 +2315,7 @@ class Get // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeModelViewData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeModelViewData', array(&$this->componentContext, &$view, &$this->placeholders) ); @@ -2495,7 +2506,7 @@ class Get &$view, &$ignoreFields ) { // set the field details - $this->setFieldDetails( + CFactory::_('Field')->set( $field, $view->name_single_code, $view->name_list_code ); @@ -2516,7 +2527,7 @@ class Get }, array_values($view->addfields) ); // build update SQL - if ($old_view = $this->getHistoryWatch( + if ($old_view = CFactory::_('History')->get( 'admin_fields', $view->addfields_id )) { @@ -2563,7 +2574,7 @@ class Get foreach ($view->fields as $field) { // so first we lock the field name in - $field_name = $this->getFieldName( + $field_name = CFactory::_('Field.Name')->get( $field, $view->name_list_code ); // check if the field changed since the last compilation (default fields never change and are always added) @@ -2624,12 +2635,12 @@ class Get $tmpfield['settings']->type_name = $field['settings']->type_name; // get the old name - $old_field_name = $this->getFieldName( + $old_field_name = CFactory::_('Field.Name')->get( $tmpfield ); // only run this if not a multi field - if (!isset($this->uniqueNames[$view->name_list_code]['names'][$field_name])) + if (CFactory::_('Registry')->get('unique.names.' . $view->name_list_code . '.names.' . $field_name) === null) { // this only works when the field is not multiple of the same field $this->setUpdateSQL( @@ -2664,7 +2675,7 @@ class Get } unset($view->addfields); // build update SQL - if ($old_view = $this->getHistoryWatch('admin_view', $id)) + if ($old_view = CFactory::_('History')->get('admin_view', $id)) { // check if the view name changed if (StringHelper::check($old_view->name_single)) @@ -2755,10 +2766,10 @@ class Get // set the field name $conditionValue['target_field'][$fieldKey] = array( - 'name' => $this->getFieldName( + 'name' => CFactory::_('Field.Name')->get( $fieldValues, $view->name_list_code ), - 'type' => $this->getFieldType( + 'type' => CFactory::_('Field.Type.Name')->get( $fieldValues ), 'required' => $required, @@ -2780,10 +2791,10 @@ class Get == (int) $conditionValue['match_field']) { // set the type - $type = $this->getFieldType($fieldValue); + $type = CFactory::_('Field.Type.Name')->get($fieldValue); // set the field details $conditionValue['match_name'] - = $this->getFieldName( + = CFactory::_('Field.Name')->get( $fieldValue, $view->name_list_code ); $conditionValue['match_type'] = $type; @@ -2813,10 +2824,6 @@ class Get } unset($view->addconditions); - // prep the buckets - $this->fieldRelations[$view->name_list_code] = array(); - $this->listJoinBuilder[$view->name_list_code] = array(); - $this->listHeadOverRide[$view->name_list_code] = array(); // set the relations $view->addrelations = (isset($view->addrelations) && JsonHelper::check($view->addrelations)) @@ -2825,7 +2832,7 @@ class Get { foreach ($view->addrelations as $nr => $relationsValue) { - // only add if list view field is selected and joind fields are set + // only add if list view field is selected and joined fields are set if (isset($relationsValue['listfield']) && is_numeric( $relationsValue['listfield'] @@ -2845,18 +2852,11 @@ class Get $relationsValue['set'] ); } - // check that the arrays are set - if (!isset($this->fieldRelations[$view->name_list_code][(int) $relationsValue['listfield']]) - || !ArrayHelper::check( - $this->fieldRelations[$view->name_list_code][(int) $relationsValue['listfield']] - )) - { - $this->fieldRelations[$view->name_list_code][(int) $relationsValue['listfield']] - = array(); - } + // load the field relations - $this->fieldRelations[$view->name_list_code][(int) $relationsValue['listfield']][(int) $relationsValue['area']] - = $relationsValue; + CFactory::_('Registry')->set('builder.field_relations.' . $view->name_list_code . '.' . (int) $relationsValue['listfield'] + . '.' . (int) $relationsValue['area'], $relationsValue); + // load the list joints if (isset($relationsValue['joinfields']) && ArrayHelper::check( @@ -2865,8 +2865,7 @@ class Get { foreach ($relationsValue['joinfields'] as $join) { - $this->listJoinBuilder[$view->name_list_code][(int) $join] - = (int) $join; + CFactory::_('Registry')->set('builder.list_join.' . $view->name_list_code . '.' . (int) $join, (int) $join); } } // set header over-ride @@ -2892,8 +2891,11 @@ class Get 'admin', $column_name_lang, $relationsValue['column_name'] ); - $this->listHeadOverRide[$view->name_list_code][(int) $relationsValue['listfield']] - = $column_name_lang; + CFactory::_('Registry')->set('builder.list_head_override.' . + $view->name_list_code . '.' . (int) $relationsValue['listfield'], + $column_name_lang + ); + } } } @@ -3201,7 +3203,7 @@ class Get $this->customAliasBuilder[$view->name_single_code] = (array) array_map( function ($field) use (&$view) { - return $this->getFieldName( + return CFactory::_('Field.Name')->get( $field, $view->name_list_code ); }, $alias_fields @@ -3264,7 +3266,7 @@ class Get // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterModelViewData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterModelViewData', array(&$this->componentContext, &$view, &$this->placeholders) ); @@ -3312,7 +3314,7 @@ class Get $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Trigger Event: jcb_ce_onBeforeQueryCustomViewData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeQueryCustomViewData', array(&$this->componentContext, &$id, &$table, &$query, &$this->db) ); @@ -3329,7 +3331,7 @@ class Get $view->Code = StringHelper::safe($view->code, 'F'); $view->CODE = StringHelper::safe($view->code, 'U'); // Trigger Event: jcb_ce_onBeforeModelCustomViewData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeModelCustomViewData', array(&$this->componentContext, &$view, &$id, &$table) ); @@ -3650,7 +3652,7 @@ class Get } // Trigger Event: jcb_ce_onAfterModelCustomViewData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterModelCustomViewData', array(&$this->componentContext, &$view) ); @@ -3667,432 +3669,11 @@ class Get * @param string $name_list The view list name * * @return oject The field data - * + * @deprecated 3.3 Use CFactory::_('Field.Data')->get($id, $name_single, $name_list); */ public function getFieldData($id, $name_single = null, $name_list = null) { - if ($id > 0 && !isset($this->_fieldData[$id])) - { - // Create a new query object. - $query = $this->db->getQuery(true); - - // Select all the values in the field - $query->select('a.*'); - $query->select( - $this->db->quoteName( - array('c.name', 'c.properties'), - array('type_name', 'properties') - ) - ); - $query->from('#__componentbuilder_field AS a'); - $query->join( - 'LEFT', - $this->db->quoteName('#__componentbuilder_fieldtype', 'c') - . ' ON (' . $this->db->quoteName('a.fieldtype') . ' = ' - . $this->db->quoteName('c.id') . ')' - ); - $query->where( - $this->db->quoteName('a.id') . ' = ' . $this->db->quote($id) - ); - - // Trigger Event: jcb_ce_onBeforeQueryFieldData - CFactory::_J('Event')->trigger( - 'jcb_ce_onBeforeQueryFieldData', - array(&$this->componentContext, &$id, &$query, &$this->db) - ); - - // Reset the query using our newly populated query object. - $this->db->setQuery($query); - $this->db->execute(); - if ($this->db->getNumRows()) - { - // Load the results as a list of stdClass objects (see later for more options on retrieving data). - $field = $this->db->loadObject(); - - // Trigger Event: jcb_ce_onBeforeModelFieldData - CFactory::_J('Event')->trigger( - 'jcb_ce_onBeforeModelFieldData', - array(&$this->componentContext, &$field) - ); - - // adding a fix for the changed name of type to fieldtype - $field->type = $field->fieldtype; - - // repeatable fields to update - $searchRepeatables = array( - // repeatablefield => checker - 'properties' => 'name' - ); - // set upater - $updater = array( - 'table' => 'fieldtype', - 'key' => 'id', - 'val' => (int) $id - ); - // update the repeatable fields - $field = ComponentbuilderHelper::convertRepeatableFields( - $field, $searchRepeatables, $updater - ); - - // load the values form params - $field->xml = CFactory::_('Customcode')->update(json_decode($field->xml)); - - // check if we have validate (validation rule set) - $validationRule = GetHelper::between( - $field->xml, 'validate="', '"' - ); - if (StringHelper::check($validationRule)) - { - // make sure it is lowercase - $validationRule = StringHelper::safe( - $validationRule - ); - // link this field to this validation - $this->validationLinkedFields[$id] = $validationRule; - // make sure it is not already set - if (!isset($this->validationRules[$validationRule])) - { - // get joomla core validation names - if ($coreValidationRules - = ComponentbuilderHelper::getExistingValidationRuleNames( - true - )) - { - // make sure this rule is not a core validation rule - if (!in_array( - $validationRule, (array) $coreValidationRules - )) - { - // get the class methods for this rule if it exists - if ($this->validationRules[$validationRule] - = GetHelper::var( - 'validation_rule', $validationRule, 'name', - 'php' - )) - { - // open and set the validation rule - $this->validationRules[$validationRule] - = CFactory::_('Customcode.Gui')->set( - CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update( - base64_decode( - $this->validationRules[$validationRule] - ) - ), CFactory::_('Placeholder')->active - ), - array( - 'table' => 'validation_rule', - 'field' => 'php', - 'id' => GetHelper::var( - 'validation_rule', - $validationRule, 'name', 'id' - ), - 'type' => 'php') - ); - } - else - { - // set the notice that this validation rule is custom and was not found (TODO) - unset($this->validationLinkedFields[$id], $this->validationRules[$validationRule]); - } - } - else - { - // remove link (we only want custom validations linked) - unset($this->validationLinkedFields[$id]); - } - } - } - } - - // load the type values form type params - $field->properties = (isset($field->properties) - && JsonHelper::check($field->properties)) - ? json_decode($field->properties, true) : null; - if (ArrayHelper::check($field->properties)) - { - $field->properties = array_values($field->properties); - } - // check if we have WHMCS encryption - if (4 == $field->store - && (!isset($this->whmcsEncryption) - || !$this->whmcsEncryption)) - { - $this->whmcsEncryption = true; - } - // check if we have basic encryption - elseif (3 == $field->store - && (!isset($this->basicEncryption) - || !$this->basicEncryption)) - { - $this->basicEncryption = true; - } - // check if we have better encryption - elseif (5 == $field->store - && (!isset($this->mediumEncryption) - || !$this->mediumEncryption)) - { - $this->mediumEncryption = true; - } - // check if we have better encryption - elseif (6 == $field->store - && StringHelper::check( - $field->on_get_model_field - ) - && StringHelper::check( - $field->on_save_model_field - )) - { - // add only if string lenght found - if (StringHelper::check( - $field->initiator_on_save_model - )) - { - $field->initiator_save_key = md5( - $field->initiator_on_save_model - ); - $field->initiator_save = explode( - PHP_EOL, CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update( - base64_decode( - $field->initiator_on_save_model - ) - ), CFactory::_('Placeholder')->active - ) - ); - } - if (StringHelper::check( - $field->initiator_on_save_model - )) - { - $field->initiator_get_key = md5( - $field->initiator_on_get_model - ); - $field->initiator_get = explode( - PHP_EOL, CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update( - base64_decode( - $field->initiator_on_get_model - ) - ), CFactory::_('Placeholder')->active - ) - ); - } - // set the field modeling - $field->model_field['save'] = explode( - PHP_EOL, CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update( - base64_decode($field->on_save_model_field) - ), CFactory::_('Placeholder')->active - ) - ); - $field->model_field['get'] = explode( - PHP_EOL, CFactory::_('Placeholder')->update( - CFactory::_('Customcode')->update( - base64_decode($field->on_get_model_field) - ), CFactory::_('Placeholder')->active - ) - ); - // remove the original values - unset($field->on_save_model_field, $field->on_get_model_field, $field->initiator_on_save_model, $field->initiator_on_get_model); - } - - // get the last used version - $field->history = $this->getHistoryWatch('field', $id); - - // Trigger Event: jcb_ce_onAfterModelFieldData - CFactory::_J('Event')->trigger( - 'jcb_ce_onAfterModelFieldData', - array(&$this->componentContext, &$field) - ); - - $this->_fieldData[$id] = $field; - } - else - { - return false; - } - } - // check if the script should be added to the view each time this field is called - if ($id > 0 && isset($this->_fieldData[$id])) - { - // check if we should load scripts for single view - if (StringHelper::check($name_single) - && !isset($this->customFieldScript[$name_single][$id])) - { - // add_javascript_view_footer - if ($this->_fieldData[$id]->add_javascript_view_footer == 1 - && StringHelper::check( - $this->_fieldData[$id]->javascript_view_footer - )) - { - $convert__ = true; - if (isset($this->_fieldData[$id]->javascript_view_footer_decoded) - && $this->_fieldData[$id]->javascript_view_footer_decoded) - { - $convert__ = false; - } - CFactory::_('Customcode.Dispenser')->set( - $this->_fieldData[$id]->javascript_view_footer, - 'view_footer', - $name_single, - null, - array( - 'table' => 'field', - 'id' => (int) $id, - 'field' => 'javascript_view_footer', - 'type' => 'js', - 'prefix' => PHP_EOL), - $convert__, - $convert__, - true - ); - if (!isset($this->_fieldData[$id]->javascript_view_footer_decoded)) - { - $this->_fieldData[$id]->javascript_view_footer_decoded - = true; - } - if (strpos( - $this->_fieldData[$id]->javascript_view_footer, - "token" - ) !== false - || strpos( - $this->_fieldData[$id]->javascript_view_footer, - "task=ajax" - ) !== false) - { - if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'])) - { - CFactory::_('Customcode.Dispenser')->hub['token'] = []; - } - if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'][$name_single]) - || !CFactory::_('Customcode.Dispenser')->hub['token'][$name_single]) - { - CFactory::_('Customcode.Dispenser')->hub['token'][$name_single] - = true; - } - } - } - - // add_css_view - if ($this->_fieldData[$id]->add_css_view == 1) - { - $convert__ = true; - if (isset($this->_fieldData[$id]->css_view_decoded) - && $this->_fieldData[$id]->css_view_decoded) - { - $convert__ = false; - } - CFactory::_('Customcode.Dispenser')->set( - $this->_fieldData[$id]->css_view, - 'css_view', - $name_single, - null, - array('prefix' => PHP_EOL), - $convert__, - $convert__, - true - ); - if (!isset($this->_fieldData[$id]->css_view_decoded)) - { - $this->_fieldData[$id]->css_view_decoded = true; - } - } - } - // check if we should load scripts for list views - if (StringHelper::check($name_list) - && !isset($this->customFieldScript[$name_list][$id])) - { - // add_javascript_views_footer - if ($this->_fieldData[$id]->add_javascript_views_footer == 1 - && StringHelper::check( - $this->_fieldData[$id]->javascript_views_footer - )) - { - $convert__ = true; - if (isset($this->_fieldData[$id]->javascript_views_footer_decoded) - && $this->_fieldData[$id]->javascript_views_footer_decoded) - { - $convert__ = false; - } - CFactory::_('Customcode.Dispenser')->set( - $this->_fieldData[$id]->javascript_views_footer, - 'views_footer', - $name_single, - null, - array( - 'table' => 'field', - 'id' => (int) $id, - 'field' => 'javascript_views_footer', - 'type' => 'js', - 'prefix' => PHP_EOL), - $convert__, - $convert__, - true - ); - if (!isset($this->_fieldData[$id]->javascript_views_footer_decoded)) - { - $this->_fieldData[$id]->javascript_views_footer_decoded - = true; - } - if (strpos( - $this->_fieldData[$id]->javascript_views_footer, - "token" - ) !== false - || strpos( - $this->_fieldData[$id]->javascript_views_footer, - "task=ajax" - ) !== false) - { - if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'])) - { - CFactory::_('Customcode.Dispenser')->hub['token'] = []; - } - if (!isset(CFactory::_('Customcode.Dispenser')->hub['token'][$name_list]) - || !CFactory::_('Customcode.Dispenser')->hub['token'][$name_list]) - { - CFactory::_('Customcode.Dispenser')->hub['token'][$name_list] - = true; - } - } - } - // add_css_views - if ($this->_fieldData[$id]->add_css_views == 1) - { - $convert__ = true; - if (isset($this->_fieldData[$id]->css_views_decoded) - && $this->_fieldData[$id]->css_views_decoded) - { - $convert__ = false; - } - CFactory::_('Customcode.Dispenser')->set( - $this->_fieldData[$id]->css_views, - 'css_views', - $name_single, - null, - array('prefix' => PHP_EOL), - $convert__, - $convert__, - true - ); - if (!isset($this->_fieldData[$id]->css_views_decoded)) - { - $this->_fieldData[$id]->css_views_decoded = true; - } - } - } - // add this only once to single view. - $this->customFieldScript[$name_single][$id] = true; - // add this only once to list view. - $this->customFieldScript[$name_list][$id] = true; - } - if ($id > 0 && isset($this->_fieldData[$id])) - { - // return the found field data - return $this->_fieldData[$id]; - } - - return false; + return CFactory::_('Field.Data')->get($id, $name_single, $name_list); } /** @@ -4104,55 +3685,11 @@ class Get * @param string $amicably The peaceful resolve * * @return void - * + * @deprecated 3.3 Use CFactory::_('Field')->set($field, $singleViewName, $listViewName, $amicably); */ - public function setFieldDetails(&$field, $singleViewName = null, - $listViewName = null, $amicably = '' - ) + public function setFieldDetails(&$field, $singleViewName = null, $listViewName = null, $amicably = '') { - // set hash - static $hash = 123467890; - // load hash if not found - if (!isset($field['hash'])) - { - $field['hash'] = md5($field['field'] . $hash); - // increment hash - $hash++; - } - // set the settings - if (!isset($field['settings'])) - { - $field['settings'] = $this->getFieldData( - $field['field'], $singleViewName, $listViewName - ); - } - // set real field name - if (!isset($field['base_name'])) - { - $field['base_name'] = $this->getFieldName($field); - } - // set code name for field type - if (!isset($field['type_name'])) - { - $field['type_name'] = $this->getFieldType($field); - } - // check if value is array - if (isset($field['permission']) - && !ArrayHelper::check( - $field['permission'] - ) - && is_numeric($field['permission']) - && $field['permission'] > 0) - { - $field['permission'] = array($field['permission']); - } - // set unique name keeper - if ($listViewName) - { - $this->setUniqueNameCounter( - $field['base_name'], $listViewName . $amicably - ); - } + CFactory::_('Field')->set($field, $singleViewName, $listViewName, $amicably); } /** @@ -4174,7 +3711,7 @@ class Get as $order_field ) { - if (($order_field_name = $this->getFieldDatabaseName( + if (($order_field_name = CFactory::_('Field.Database.Name')->get( $nameListCode, $order_field['field'] )) !== false) { @@ -4202,52 +3739,11 @@ class Get * @param string $targetArea The area being targeted * * @return string - * + * @deprecated 3.3 Use CFactory::_('Field.Database.Name')->get($nameListCode, $fieldId, $targetArea); */ - public function getFieldDatabaseName($nameListCode, int $fieldId, - $targetArea = 'listBuilder' - ) + public function getFieldDatabaseName($nameListCode, int $fieldId, $targetArea = 'builder.list') { - if (isset($this->{$targetArea}[$nameListCode])) - { - if ($fieldId < 0) - { - switch ($fieldId) - { - case -1: - return 'a.id'; - case -2: - return 'a.ordering'; - case -3: - return 'a.published'; - } - } - foreach ($this->{$targetArea}[$nameListCode] as $field) - { - if ($field['id'] == $fieldId) - { - // now check if this is a category - if ($field['type'] === 'category') - { - return 'c.title'; - } - // set the custom code - elseif (ArrayHelper::check( - $field['custom'] - )) - { - return $field['custom']['db'] . "." - . $field['custom']['text']; - } - else - { - return 'a.' . $field['code']; - } - } - } - } - - return false; + return CFactory::_('Field.Database.Name')->get($nameListCode, $fieldId, $targetArea); } /** @@ -4256,92 +3752,11 @@ class Get * @param object $field The field object * * @return string Success returns field type - * + * @deprecated 3.3 Use CFactory::_('Field.Type.Name')->get($field); */ public function getFieldType(&$field) { - // check if we have done this already - if (isset($field['type_name'])) - { - return $field['type_name']; - } - // check that we have the poperties - if (isset($field['settings']) - && ObjectHelper::check( - $field['settings'] - ) - && isset($field['settings']->properties) - && ArrayHelper::check( - $field['settings']->properties - )) - { - // search for own custom fields - if (strpos($field['settings']->type_name, '@') !== false) - { - // set own custom field - $field['settings']->own_custom = $field['settings']->type_name; - $field['settings']->type_name = 'Custom'; - } - // set the type name - $type_name = TypeHelper::safe( - $field['settings']->type_name - ); - // if custom (we must use the xml value) - if (strtolower($type_name) === 'custom' - || strtolower($type_name) === 'customuser') - { - $type = TypeHelper::safe( - GetHelper::between( - $field['settings']->xml, 'type="', '"' - ) - ); - } - else - { - // loop over properties looking for the type value - foreach ($field['settings']->properties as $property) - { - if ($property['name'] - === 'type') // type field is never ajustable (unless custom) - { - // force the default value - if (isset($property['example']) - && StringHelper::check( - $property['example'] - )) - { - $type = TypeHelper::safe( - $property['example'] - ); - } - // fall back on the xml settings (not ideal) - else - { - $type = TypeHelper::safe( - GetHelper::between( - $field['settings']->xml, 'type="', '"' - ) - ); - } - // exit foreach loop - break; - } - } - } - // check if the value is set - if (isset($type) && StringHelper::check($type)) - { - return $type; - } - // fallback on type name set in name field (not ideal) - else - { - return $type_name; - } - } - - // fall back to text - return 'text'; + return CFactory::_('Field.Type.Name')->get($field); } /** @@ -4352,147 +3767,11 @@ class Get * @param string $amicably The peaceful resolve (for fields in subforms in same view :) * * @return string Success returns field name - * + * @deprecated 3.3 Use CFactory::_('Field.Name')->get($field, $listViewName, $amicably); */ public function getFieldName(&$field, $listViewName = null, $amicably = '') { - // return the unique name if already set - if (StringHelper::check($listViewName) - && isset($field['hash']) - && isset( - $this->uniqueFieldNames[$listViewName . $amicably - . $field['hash']] - )) - { - return $this->uniqueFieldNames[$listViewName . $amicably - . $field['hash']]; - } - // always make sure we have a field name and type - if (!isset($field['settings']) || !isset($field['settings']->type_name) - || !isset($field['settings']->name)) - { - return 'error'; - } - // set the type name - $type_name = TypeHelper::safe( - $field['settings']->type_name - ); - // set the name of the field - $name = FieldHelper::safe($field['settings']->name); - // check that we have the properties - if (ArrayHelper::check($field['settings']->properties)) - { - foreach ($field['settings']->properties as $property) - { - if ($property['name'] === 'name') - { - // if category then name must be catid (only one per view) - if ($type_name === 'category') - { - // quick check if this is a category linked to view page - $requeSt_id = GetHelper::between( - $field['settings']->xml, 'name="', '"' - ); - if (strpos($requeSt_id, '_request_id') !== false - || strpos($requeSt_id, '_request_catid') !== false) - { - // keep it then, don't change - $name = CFactory::_('Placeholder')->update( - $requeSt_id, CFactory::_('Placeholder')->active - ); - } - else - { - $name = 'catid'; - } - // if list view name is set - if (StringHelper::check($listViewName)) - { - // check if we should use another Text Name as this views name - $otherName = CFactory::_('Placeholder')->update( - GetHelper::between( - $field['settings']->xml, 'othername="', '"' - ), CFactory::_('Placeholder')->active - ); - $otherViews = CFactory::_('Placeholder')->update( - GetHelper::between( - $field['settings']->xml, 'views="', '"' - ), CFactory::_('Placeholder')->active - ); - $otherView = CFactory::_('Placeholder')->update( - GetHelper::between( - $field['settings']->xml, 'view="', '"' - ), CFactory::_('Placeholder')->active - ); - // This is to link other view category - if (StringHelper::check($otherName) - && StringHelper::check( - $otherViews - ) - && StringHelper::check( - $otherView - )) - { - // set other category details - $this->catOtherName[$listViewName] = array( - 'name' => FieldHelper::safe( - $otherName - ), - 'views' => StringHelper::safe( - $otherViews - ), - 'view' => StringHelper::safe( - $otherView - ) - ); - } - } - } - // if tag is set then enable all tag options for this view (only one per view) - elseif ($type_name === 'tag') - { - $name = 'tags'; - } - // if the field is set as alias it must be called alias - elseif (isset($field['alias']) && $field['alias']) - { - $name = 'alias'; - } - else - { - // get value from xml - $xml = FieldHelper::safe( - CFactory::_('Placeholder')->update( - GetHelper::between( - $field['settings']->xml, 'name="', '"' - ), CFactory::_('Placeholder')->active - ) - ); - // check if a value was found - if (StringHelper::check($xml)) - { - $name = $xml; - } - } - // exit foreach loop - break; - } - } - } - // return the value unique - if (StringHelper::check($listViewName) - && isset($field['hash'])) - { - $this->uniqueFieldNames[$listViewName . $amicably . $field['hash']] - = $this->uniqueName($name, $listViewName . $amicably); - - // now return the unique name - return $this->uniqueFieldNames[$listViewName . $amicably - . $field['hash']]; - } - - // fall back to global - return $name; + return CFactory::_('Field.Name')->get($field, $listViewName, $amicably); } /** @@ -4502,26 +3781,11 @@ class Get * @param string $view The name of the view * * @return void - * + * @deprecated Use CFactory::_('Field.Unique.Name')->set($name, $view); */ protected function setUniqueNameCounter($name, $view) { - if (!isset($this->uniqueNames[$view])) - { - $this->uniqueNames[$view] = array(); - $this->uniqueNames[$view]['counter'] = array(); - $this->uniqueNames[$view]['names'] = array(); - } - if (!isset($this->uniqueNames[$view]['counter'][$name])) - { - $this->uniqueNames[$view]['counter'][$name] = 1; - - return; - } - // count how many times the field is used - $this->uniqueNames[$view]['counter'][$name]++; - - return; + CFactory::_('Field.Unique.Name')->set($name, $view); } /** @@ -4531,36 +3795,19 @@ class Get * @param string $view The name of the view * * @return string the name - * + * @deprecated */ protected function uniqueName($name, $view) { - // only increment if the field name is used multiple times - if (isset($this->uniqueNames[$view]['counter'][$name]) - && $this->uniqueNames[$view]['counter'][$name] > 1) - { - $counter = 1; - // set the unique name - $uniqueName = FieldHelper::safe( - $name . '_' . $counter - ); - while (isset($this->uniqueNames[$view]['names'][$uniqueName])) - { - // increment the number - $counter++; - // try again - $uniqueName = FieldHelper::safe( - $name . '_' . $counter - ); - } - // set the new name number - $this->uniqueNames[$view]['names'][$uniqueName] = $counter; - - // return the unique name - return $uniqueName; - } - - return $name; + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** @@ -4602,7 +3849,7 @@ class Get foreach ($results as $_nr => &$result) { // Trigger Event: jcb_ce_onBeforeModelDynamicGetData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeModelDynamicGetData', array(&$this->componentContext, &$result, &$result->id, &$view_code, &$context) ); @@ -5117,7 +4364,7 @@ class Get $result->plugin_events = ''; } // Trigger Event: jcb_ce_onAfterModelDynamicGetData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterModelDynamicGetData', array(&$this->componentContext, &$result, &$result->id, &$view_code, &$context) ); @@ -5475,83 +4722,12 @@ class Get * @param string $type The type of item * @param int $id The item ID * - * @return oject The history - * + * @return object The history + * @deprecated 3.3 Use CFactory::_('History')->get($type, $id); */ protected function getHistoryWatch($type, $id) { - // quick class object to store old history object - $this->tmpHistory = null; - // Create a new query object. - $query = $this->db->getQuery(true); - - $query->select('h.*'); - $query->from('#__ucm_history AS h'); - $query->where( - $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id - ); - // Join over the content type for the type id - $query->join( - 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' - ); - $query->where( - 'ct.type_alias = ' . $this->db->quote( - 'com_componentbuilder.' . $type - ) - ); - $query->order('h.save_date DESC'); - $this->db->setQuery($query, 0, 1); - $this->db->execute(); - if ($this->db->getNumRows()) - { - // new version of this item found - // so we need to mark it as the last compiled version - $newActive = $this->db->loadObject(); - // set the new version watch - $this->setHistoryWatch($newActive, 1); - } - // Get last compiled verion - $query = $this->db->getQuery(true); - - $query->select('h.*'); - $query->from('#__ucm_history AS h'); - $query->where( - $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id - ); - $query->where('h.keep_forever = 1'); - $query->where('h.version_note LIKE ' . $this->db->quote('%component%')); - // make sure it does not return the active version - if (isset($newActive) && isset($newActive->version_id)) - { - $query->where('h.version_id != ' . (int) $newActive->version_id); - } - // Join over the content type for the type id - $query->join( - 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' - ); - $query->where( - 'ct.type_alias = ' . $this->db->quote( - 'com_componentbuilder.' . $type - ) - ); - $query->order('h.save_date DESC'); - $this->db->setQuery($query); - $this->db->execute(); - if ($this->db->getNumRows()) - { - // the old active version was found - // so we may need to do an SQL update - // and unmark the old compiled version - $oldActives = $this->db->loadObjectList(); - foreach ($oldActives as $oldActive) - { - // remove old version watch - $this->setHistoryWatch($oldActive, 0); - } - } - - // return the last used history record or null. - return $this->tmpHistory; + return CFactory::_('History')->get($type, $id); } /** @@ -5564,73 +4740,19 @@ class Get * @param string $type The type of item * * @return bool - * + * @deprecated 3.3 */ protected function setHistoryWatch($object, $action) { - // check the note - if (JsonHelper::check($object->version_note)) - { - $version_note = json_decode($object->version_note, true); - } - else - { - $version_note = array('component' => array()); - } - // set watch - switch ($action) - { - case 0: - // remove watch - if (isset($version_note['component']) - && ($key = array_search( - CFactory::_('Config')->component_id, $version_note['component'] - )) !== false) - { - // last version that was used to build/compile - $this->tmpHistory = json_decode($object->version_data); - // remove it from this component - unset($version_note['component'][$key]); - } - else - { - // since it was not found, no need to update anything - return true; - } - break; - case 1: - // add watch - if (!in_array(CFactory::_('Config')->component_id, $version_note['component'])) - { - $version_note['component'][] = CFactory::_('Config')->component_id; - } - else - { - // since it is there already, no need to update anything - return true; - } - break; - } - // check if we need to still keep this locked - if (isset($version_note['component']) - && ArrayHelper::check($version_note['component'])) - { - // insure component ids are only added once per item - $version_note['component'] = array_unique( - $version_note['component'] - ); - // we may change this, little risky (but since JCB does not have history notes it should be okay for now) - $object->version_note = json_encode($version_note); - $object->keep_forever = '1'; - } - else - { - $object->version_note = ''; - $object->keep_forever = '0'; - } - - // run the update - return $this->db->updateObject('#__ucm_history', $object, 'version_id'); + // set notice that we could not get a valid string from the target + $this->app->enqueueMessage( + JText::sprintf('

    %s Warning

    ', __CLASS__), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Use of a deprecated method (%s)!', __METHOD__ + ), 'Error' + ); } /** @@ -6212,7 +5334,7 @@ class Get function ($array) { $array['alias'] = 0; $array['title'] = 0; - $array['settings'] = $this->getFieldData( + $array['settings'] = CFactory::_('Field.Data')->get( $array['field'] ); @@ -8134,7 +7256,7 @@ class Get $field['alias'] = 0; $field['title'] = 0; // set the field details - $this->setFieldDetails( + CFactory::_('Field')->set( $field, $key, $key, $unique ); // update the default if set @@ -8196,7 +7318,7 @@ class Get foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName( + CFactory::_('Field.Name')->get( $field, $module->key, $unique ); // add the fields to the global form file builder @@ -8223,7 +7345,7 @@ class Get foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName( + CFactory::_('Field.Name')->get( $field, $module->key, $unique ); // add the fields to the config builder @@ -9002,7 +8124,7 @@ class Get $field['alias'] = 0; $field['title'] = 0; // set the field details - $this->setFieldDetails( + CFactory::_('Field')->set( $field, $key, $key, $unique ); // update the default if set @@ -9064,7 +8186,7 @@ class Get foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName( + CFactory::_('Field.Name')->get( $field, $plugin->key, $unique ); // add the fields to the global form file builder @@ -9091,7 +8213,7 @@ class Get foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName( + CFactory::_('Field.Name')->get( $field, $plugin->key, $unique ); // add the fields to the config builder diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 8f3da1daa..44cd7c12f 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -436,7 +436,7 @@ class Structure extends Get // set the Joomla Version Data $this->joomlaVersionData = $this->setJoomlaVersionData(); // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterSetJoomlaVersionData', array(&$this->componentContext, &$this->joomlaVersionData) ); @@ -477,7 +477,7 @@ class Structure extends Get // for plugin event TODO change event api signatures $this->powers = CFactory::_('Power')->active; // Trigger Event: jcb_ce_onBeforeSetModules - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildPowers', array(&$this->componentContext, &$this->powers) ); @@ -590,7 +590,7 @@ class Structure extends Get if (ArrayHelper::check($this->joomlaModules)) { // Trigger Event: jcb_ce_onBeforeSetModules - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildModules', array(&$this->componentContext, &$this->joomlaModules) ); @@ -1171,7 +1171,7 @@ class Structure extends Get if (ArrayHelper::check($this->joomlaPlugins)) { // Trigger Event: jcb_ce_onBeforeSetPlugins - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildPlugins', array(&$this->componentContext, &$this->joomlaPlugins) ); @@ -1587,7 +1587,7 @@ class Structure extends Get if (ArrayHelper::check($this->libraries)) { // Trigger Event: jcb_ce_onBeforeSetLibraries - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeSetLibraries', array(&$this->componentContext, &$this->libraries) ); @@ -2495,11 +2495,11 @@ class Structure extends Get } } // check if this has validation that should be moved - if (isset($this->validationLinkedFields[$field['field']])) + if (CFactory::_('Registry')->get('validation.linked.' . $field['field']) !== null) { $check = md5( $path . 'rule' - . $this->validationLinkedFields[$field['field']] + . CFactory::_('Registry')->get('validation.linked.' . $field['field']) ); // lets check if we already moved this if (!isset($this->extentionTrackingFilesMoved[$check])) @@ -2507,16 +2507,16 @@ class Structure extends Get // check files exist if (File::exists( $this->componentPath . '/admin/models/rules/' - . $this->validationLinkedFields[$field['field']] + . CFactory::_('Registry')->get('validation.linked.' . $field['field']) . '.php' )) { // copy the custom field File::copy( $this->componentPath . '/admin/models/rules/' - . $this->validationLinkedFields[$field['field']] + . CFactory::_('Registry')->get('validation.linked.' . $field['field']) . '.php', $path . '/rules/' - . $this->validationLinkedFields[$field['field']] + . CFactory::_('Registry')->get('validation.linked.' . $field['field']) . '.php' ); } @@ -2555,7 +2555,7 @@ class Structure extends Get // setup the field $field = array(); $field['field'] = $id; - $this->setFieldDetails($field); + CFactory::_('Field')->set($field); // move field and rules if needed $this->moveFieldsRules($field, $path); } diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 9fe5377e4..f158238f3 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -153,6 +153,7 @@ class Fields extends Structure * list builder * * @var array + * @deprecated 3.3 Use CFactory::_('Registry')->get('builder.list'); */ public $listBuilder = array(); @@ -609,7 +610,7 @@ class Fields extends Structure // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFields - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$nameSingleCode, @@ -630,7 +631,7 @@ class Fields extends Structure // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFields - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$nameSingleCode, @@ -1028,7 +1029,7 @@ class Fields extends Structure // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFields - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$nameSingleCode, @@ -1049,7 +1050,7 @@ class Fields extends Structure // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFields - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$nameSingleCode, @@ -1606,8 +1607,8 @@ class Fields extends Structure )) { // reset some values - $name = $this->getFieldName($field, $nameListCode); - $typeName = $this->getFieldType($field); + $name = CFactory::_('Field.Name')->get($field, $nameListCode); + $typeName = CFactory::_('Field.Type.Name')->get($field); $multiple = false; $langLabel = ''; $fieldSet = ''; @@ -2313,7 +2314,7 @@ class Fields extends Structure $field = array(); $field['field'] = $id; // set the field details - $this->setFieldDetails( + CFactory::_('Field')->set( $field, $nameSingleCode, $nameListCode, $_resolverKey ); @@ -2330,10 +2331,10 @@ class Fields extends Structure $fieldData['settings'] )) { - $r_name = $this->getFieldName( + $r_name = CFactory::_('Field.Name')->get( $fieldData, $nameListCode, $_resolverKey ); - $r_typeName = $this->getFieldType($fieldData); + $r_typeName = CFactory::_('Field.Type.Name')->get($fieldData); $r_multiple = false; $r_langLabel = ''; // add the tabs needed @@ -2479,7 +2480,7 @@ class Fields extends Structure $field = array(); $field['field'] = $id; // set the field details - $this->setFieldDetails( + CFactory::_('Field')->set( $field, $nameSingleCode, $nameListCode, $_resolverKey ); @@ -2496,10 +2497,10 @@ class Fields extends Structure $fieldData['settings'] )) { - $r_name = $this->getFieldName( + $r_name = CFactory::_('Field.Name')->get( $fieldData, $nameListCode, $_resolverKey ); - $r_typeName = $this->getFieldType($fieldData); + $r_typeName = CFactory::_('Field.Type.Name')->get($fieldData); $r_multiple = false; $r_langLabel = ''; // add the tabs needed @@ -3309,7 +3310,7 @@ class Fields extends Structure $field = array(); $field['field'] = $id; // set the field details - $this->setFieldDetails( + CFactory::_('Field')->set( $field, $nameSingleCode, $nameListCode, $_resolverKey ); @@ -3326,10 +3327,10 @@ class Fields extends Structure $fieldData['settings'] )) { - $r_name = $this->getFieldName( + $r_name = CFactory::_('Field.Name')->get( $fieldData, $nameListCode, $_resolverKey ); - $r_typeName = $this->getFieldType($fieldData); + $r_typeName = CFactory::_('Field.Type.Name')->get($fieldData); $r_multiple = false; $r_langLabel = ''; // get field values @@ -3493,7 +3494,7 @@ class Fields extends Structure $field = array(); $field['field'] = $id; // set the field details - $this->setFieldDetails( + CFactory::_('Field')->set( $field, $nameSingleCode, $nameListCode, $_resolverKey ); @@ -3510,10 +3511,10 @@ class Fields extends Structure $fieldData['settings'] )) { - $r_name = $this->getFieldName( + $r_name = CFactory::_('Field.Name')->get( $fieldData, $nameListCode, $_resolverKey ); - $r_typeName = $this->getFieldType($fieldData); + $r_typeName = CFactory::_('Field.Type.Name')->get($fieldData); $r_multiple = false; $r_langLabel = ''; // get field values @@ -4047,8 +4048,7 @@ class Fields extends Structure public function buildSiteFieldData($view, $field, $set, $type) { $decode = array('json', 'base64', 'basic_encryption', - 'whmcs_encryption', 'medium_encryption', - 'expert_mode'); + 'whmcs_encryption', 'medium_encryption', 'expert_mode'); $textareas = array('textarea', 'editor'); if (isset($this->siteFields[$view][$field]) && ArrayHelper::check( @@ -4392,11 +4392,11 @@ class Fields extends Structure if ($property['name'] === 'label') { if (isset($fieldAttributes['name']) - && isset($this->uniqueNames[$nameListCode]['names'][$fieldAttributes['name']])) + && CFactory::_('Registry')->get("unique.names.$nameListCode.names." . $fieldAttributes['name']) !== null) { $xmlValue .= ' (' . StringHelper::safe( - $this->uniqueNames[$nameListCode]['names'][$fieldAttributes['name']] + CFactory::_('Registry')->get("unique.names.$nameListCode.names." . $fieldAttributes['name']) ) . ')'; } } @@ -4699,7 +4699,7 @@ class Fields extends Structure || $field['list'] == 4)); // set list join $listJoin - = (isset($this->listJoinBuilder[$nameListCode][(int) $field['field']])); + = CFactory::_('Registry')->exists('builder.list_join.' . $nameListCode . '.' . (int) $field['field']); // add history to this view if (isset($view['history']) && $view['history']) { @@ -4720,12 +4720,9 @@ class Fields extends Structure // category name fix if ($typeName === 'category') { - if (isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if (CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.name')) { - $tempName = $this->catOtherName[$nameListCode]['name']; + $tempName = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.name'); } else { @@ -4786,7 +4783,13 @@ class Fields extends Structure // load to list builder if ($listSwitch) { - $this->listBuilder[$nameListCode][] = array( + // check if it does not exists + if (!CFactory::_('Registry')->exists('builder.list.' . $nameListCode)) + { + CFactory::_('Registry')->set('builder.list.' . $nameListCode, []); + } + // append values + CFactory::_('Registry')->append('builder.list.' . $nameListCode, [ 'id' => (int) $field['field'], 'type' => $typeName, 'code' => $name, @@ -4802,7 +4805,8 @@ class Fields extends Structure 'custom' => $custom, 'multiple' => $multiple, 'options' => $options, - 'target' => (int) $field['list']); + 'target' => (int) $field['list'] + ]); } // build custom builder list if ($listSwitch || $listJoin) @@ -4813,8 +4817,7 @@ class Fields extends Structure // load the list join builder if ($listJoin) { - $this->listJoinBuilder[$nameListCode][(int) $field['field']] - = array( + CFactory::_('Registry')->set('builder.list_join.' . $nameListCode . '.' . (int) $field['field'], [ 'type' => $typeName, 'code' => $name, 'lang' => $listLangName, @@ -4828,24 +4831,21 @@ class Fields extends Structure : false, 'custom' => $custom, 'multiple' => $multiple, - 'options' => $options); + 'options' => $options + ]); } // update the field relations - if (isset($this->fieldRelations[$nameListCode]) - && isset($this->fieldRelations[$nameListCode][(int) $field['field']]) - && ArrayHelper::check( - $this->fieldRelations[$nameListCode][(int) $field['field']] - )) + if (($field_relations = + CFactory::_('Registry')->get('builder.field_relations.' . $nameListCode . '.' . (int) $field['field'])) !== null) { - foreach ( - $this->fieldRelations[$nameListCode][(int) $field['field']] as - $area => &$field_values - ) + $field_relations = (array) $field_relations; + foreach ($field_relations as $area => &$field_values) { $field_values['type'] = $typeName; $field_values['code'] = $name; $field_values['custom'] = $custom; } + CFactory::_('Registry')->set('builder.field_relations.' . $nameListCode . '.' . (int) $field['field'], $field_relations); } // set the hidden field of this view if ($dbSwitch && $typeName === 'hidden') @@ -4943,13 +4943,11 @@ class Fields extends Structure // setup category for this view if ($dbSwitch && $typeName === 'category') { - if (isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if (CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view') + && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { - $otherViews = $this->catOtherName[$nameListCode]['views']; - $otherView = $this->catOtherName[$nameListCode]['view']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); + $otherView = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view'); } else { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 0bcaa928e..17c492f56 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -1192,7 +1192,7 @@ class Interpretation extends Fields $modelJ = ComponentbuilderHelper::getModel('joomla_component'); $modelJ->save($newJ); // <-- to insure the history is also updated // reset the watch here - $this->getHistoryWatch('joomla_component', CFactory::_('Config')->component_id); + CFactory::_('History')->get('joomla_component', CFactory::_('Config')->component_id); // update the component update table $newU = array(); @@ -10700,7 +10700,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('admin'); // Trigger Event: jcb_ce_onBeforeBuildAdminLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -10965,7 +10965,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('admin'); // Trigger Event: jcb_ce_onAfterBuildAdminLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -10993,7 +10993,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('site'); // Trigger Event: jcb_ce_onBeforeBuildSiteLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildSiteLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -11064,7 +11064,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('site'); // Trigger Event: jcb_ce_onAfterBuildSiteLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildSiteLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -11092,7 +11092,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('sitesys'); // Trigger Event: jcb_ce_onBeforeBuildSiteSysLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildSiteSysLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -11124,7 +11124,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('sitesys'); // Trigger Event: jcb_ce_onAfterBuildSiteSysLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildSiteSysLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -11152,7 +11152,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('adminsys'); // Trigger Event: jcb_ce_onBeforeBuildAdminSysLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminSysLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -11173,7 +11173,7 @@ class Interpretation extends Fields // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget('adminsys'); // Trigger Event: jcb_ce_onAfterBuildAdminSysLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminSysLang', array(&$this->componentContext, &$langContent, &$this->langPrefix, &$componentName) @@ -11275,10 +11275,7 @@ class Interpretation extends Fields */ public function setListBody($nameSingleCode, $nameListCode) { - if (isset($this->listBuilder[$nameListCode]) - && ArrayHelper::check( - $this->listBuilder[$nameListCode] - )) + if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null) { // component helper name $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; @@ -11398,7 +11395,7 @@ class Interpretation extends Fields $doNotEscape = true; } // start adding the dynamic - foreach ($this->listBuilder[$nameListCode] as $item) + foreach ($items as $item) { // check if target is admin list if (1 == $item['target'] || 3 == $item['target']) @@ -11524,20 +11521,19 @@ class Interpretation extends Fields ) { // check if we have relation fields - if (isset($this->fieldRelations[$nameListCode]) - && isset($this->fieldRelations[$nameListCode][(int) $item['id']]) - && isset($this->fieldRelations[$nameListCode][(int) $item['id']][2])) + if (($field_relations = + CFactory::_('Registry')->get('builder.field_relations.' . $nameListCode . '.' . (int) $item['id'] . '.2')) !== null) { // set the fields array $field = array(); // use custom code $useCustomCode - = (isset($this->fieldRelations[$nameListCode][(int) $item['id']][2]['join_type']) - && $this->fieldRelations[$nameListCode][(int) $item['id']][2]['join_type'] + = (isset($field_relations['join_type']) + && $field_relations['join_type'] == 2 - && isset($this->fieldRelations[$nameListCode][(int) $item['id']][2]['set']) + && isset($field_relations['set']) && StringHelper::check( - $this->fieldRelations[$nameListCode][(int) $item['id']][2]['set'] + $field_relations['set'] )); // load the main list view field $field['[field=' . (int) $item['id'] . ']'] = $this->getListItem( @@ -11552,34 +11548,28 @@ class Interpretation extends Fields . $item['code']; } // now load the relations - if (isset($this->fieldRelations[$nameListCode][(int) $item['id']][2]['joinfields']) - && ArrayHelper::check( - $this->fieldRelations[$nameListCode][(int) $item['id']][2]['joinfields'] - )) + if (isset($field_relations['joinfields']) + && ArrayHelper::check($field_relations['joinfields'])) { - foreach ( - $this->fieldRelations[$nameListCode][(int) $item['id']][2]['joinfields'] - as $join - ) + foreach ($field_relations['joinfields'] as $join) { $blankClass = ''; - if (isset($this->listJoinBuilder[$nameListCode]) - && isset($this->listJoinBuilder[$nameListCode][(int) $join])) + if (($join_item = + CFactory::_('Registry')->get('builder.list_join.' . $nameListCode . '.' . (int) $join)) !== null) { // code block $field['[field=' . (int) $join . ']'] = $this->getListItem( - $this->listJoinBuilder[$nameListCode][(int) $join], - $nameSingleCode, $nameListCode, $blankClass, + $join_item, $nameSingleCode, $nameListCode, $blankClass, $doNotEscape, $coreLoad, $core, false, $ref, $escape, $user, $refview ); // code name - if (isset($this->listJoinBuilder[$nameListCode][(int) $join]['code']) + if (isset($join_item['code']) && $useCustomCode) { $field['$item->{' . (int) $join . '}'] = '$item->' - . $this->listJoinBuilder[$nameListCode][(int) $join]['code']; + . $join_item['code']; } } } @@ -11592,18 +11582,18 @@ class Interpretation extends Fields . CFactory::_('Placeholder')->update( str_replace( array_keys($field), array_values($field), - $this->fieldRelations[$nameListCode][(int) $item['id']][2]['set'] + $field_relations['set'] ), $this->placeholders ) . PHP_EOL . Indent::_(3) . ""; } - elseif (isset($this->fieldRelations[$nameListCode][(int) $item['id']]['set']) + elseif (isset($field_relations['set']) && StringHelper::check( - $this->fieldRelations[$nameListCode][(int) $item['id']][2]['set'] + $field_relations['set'] )) { // concatenate return PHP_EOL . Indent::_(3) . "
    " . implode( - $this->fieldRelations[$nameListCode][(int) $item['id']][2]['set'], + $field_relations['set'], $field ) . PHP_EOL . Indent::_(3) . "
    "; } @@ -12146,7 +12136,7 @@ class Interpretation extends Fields $body[] = ""; } // Trigger Event: jcb_ce_onSetDefaultViewsBodyTop - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onSetDefaultViewsBodyTop', array(&$this, &$body, @@ -12167,7 +12157,7 @@ class Interpretation extends Fields $body[] = Indent::_(1) . "
    "; $body[] = ""; // Trigger Event: jcb_ce_onSetDefaultViewsFormTop - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onSetDefaultViewsFormTop', array(&$this, &$body, @@ -12263,7 +12253,7 @@ class Interpretation extends Fields . ""; $body[] = Indent::_(1) . ""; // Trigger Event: jcb_ce_onSetDefaultViewsFormBottom - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onSetDefaultViewsFormBottom', array(&$this, &$body, @@ -12272,7 +12262,7 @@ class Interpretation extends Fields ); $body[] = ""; // Trigger Event: jcb_ce_onSetDefaultViewsBodyBottom - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onSetDefaultViewsBodyBottom', array(&$this, &$body, @@ -12293,10 +12283,7 @@ class Interpretation extends Fields */ public function setListHead($nameSingleCode, $nameListCode) { - if (isset($this->listBuilder[$nameListCode]) - && ArrayHelper::check( - $this->listBuilder[$nameListCode] - )) + if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null) { // set the JHtml values based on filter type $jhtml_sort = "grid.sort"; @@ -12354,20 +12341,17 @@ class Interpretation extends Fields // set footer Column number $this->listColnrBuilder[$nameListCode] = 4; // build the dynamic fields - foreach ($this->listBuilder[$nameListCode] as $item) + foreach ($items as $item) { // check if target is admin list if (1 == $item['target'] || 3 == $item['target']) { // check if we have an over-ride - if (isset($this->listHeadOverRide[$nameListCode]) - && ArrayHelper::check( - $this->listHeadOverRide[$nameListCode] - ) - && isset($this->listHeadOverRide[$nameListCode][$item['id']])) + if (($list_head_override = CFactory::_('Registry')->get('builder.list_head_override.' . + $nameListCode . '.' . (int) $item['id'])) + !== null) { - $item['lang'] - = $this->listHeadOverRide[$nameListCode][$item['id']]; + $item['lang'] = $list_head_override; } $class = 'nowrap hidden-phone'; if ($item['link']) @@ -14074,10 +14058,7 @@ class Interpretation extends Fields $refview ) { - if (isset($this->listBuilder[$nameListCode]) - && ArrayHelper::check( - $this->listBuilder[$nameListCode] - )) + if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null) { // component helper name $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; @@ -14112,7 +14093,7 @@ class Interpretation extends Fields $doNotEscape = true; } // start adding the dynamic - foreach ($this->listBuilder[$nameListCode] as $item) + foreach ($items as $item) { // check if target is linked list view if (1 == $item['target'] || 4 == $item['target']) @@ -14267,10 +14248,7 @@ class Interpretation extends Fields $addNewButon, $refview ) { - if (isset($this->listBuilder[$nameListCode]) - && ArrayHelper::check( - $this->listBuilder[$nameListCode] - )) + if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null) { // component helper name $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper'; @@ -14376,20 +14354,17 @@ class Interpretation extends Fields // set controller for data hiding options $controller = 1; // build the dynamic fields - foreach ($this->listBuilder[$nameListCode] as $item) + foreach ($items as $item) { // check if target is linked list view if (1 == $item['target'] || 4 == $item['target']) { // check if we have an over-ride - if (isset($this->listHeadOverRide[$nameListCode]) - && ArrayHelper::check( - $this->listHeadOverRide[$nameListCode] - ) - && isset($this->listHeadOverRide[$nameListCode][$item['id']])) + if (($list_head_override = CFactory::_('Registry')->get('builder.list_head_override.' . + $nameListCode . '.' . (int) $item['id'])) + !== null) { - $item['lang'] - = $this->listHeadOverRide[$nameListCode][$item['id']]; + $item['lang'] = $list_head_override; } $setin = (2 == $this->footableVersion) ? ' data-hide="phone"' : ' data-breakpoints="xs sm"'; @@ -14689,7 +14664,7 @@ class Interpretation extends Fields as $order_field ) { - if (($order_field_name = $this->getFieldDatabaseName( + if (($order_field_name = CFactory::_('Field.Database.Name')->get( $nameListCode, $order_field['field'] // We Removed This 'listJoinBuilder' as targetArea // we will keep an eye on this @@ -15277,7 +15252,7 @@ class Interpretation extends Fields as $order_field ) { - if (($order_field_name = $this->getFieldDatabaseName( + if (($order_field_name = CFactory::_('Field.Database.Name')->get( $nameListCode, $order_field['field'] )) !== false) { @@ -15831,7 +15806,7 @@ class Interpretation extends Fields as $order_field ) { - if (($order_field_name = $this->getFieldDatabaseName( + if (($order_field_name = CFactory::_('Field.Database.Name')->get( $nameListCode, $order_field['field'] )) !== false) { @@ -18924,13 +18899,11 @@ class Interpretation extends Fields $component = $this->componentCodeName; } // check if category has another name - if (isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if (CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view') + && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { - $otherViews = $this->catOtherName[$nameListCode]['views']; - $otherView = $this->catOtherName[$nameListCode]['view']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); + $otherView = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view'); } else { @@ -19019,13 +18992,11 @@ class Interpretation extends Fields if (0) //isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if (CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view') + && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { - $otherViews = $this->catOtherName[$nameListCode]['views']; - $otherView = $this->catOtherName[$nameListCode]['view']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); + $otherView = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view'); } else { @@ -19178,13 +19149,11 @@ class Interpretation extends Fields )) { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if ($coreLoad && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view') + && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { - $otherViews = $this->catOtherName[$nameListCode]['views']; - $otherView = $this->catOtherName[$nameListCode]['view']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); + $otherView = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view'); } else { @@ -19567,13 +19536,11 @@ class Interpretation extends Fields if (0) //isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if ($coreLoad && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view') + && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { - $otherViews = $this->catOtherName[$nameListCode]['views']; - $otherView = $this->catOtherName[$nameListCode]['view']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); + $otherView = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view'); } else { @@ -20184,13 +20151,11 @@ class Interpretation extends Fields if (0) //isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if ($coreLoad && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view') + && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { - $otherViews = $this->catOtherName[$nameListCode]['views']; - $otherView = $this->catOtherName[$nameListCode]['view']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); + $otherView = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view'); } else { @@ -20308,13 +20273,11 @@ class Interpretation extends Fields if (0) // isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name - if (isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if (CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view') + && CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { - $otherViews = $this->catOtherName[$nameListCode]['views']; - $otherView = $this->catOtherName[$nameListCode]['view']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); + $otherView = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.view'); } else { @@ -21703,14 +21666,10 @@ class Interpretation extends Fields $methodName = 'getItemsMethodListStringFixBuilder'; } // load the relations before modeling - if (isset($this->fieldRelations[$nameListCode]) - && ArrayHelper::check( - $this->fieldRelations[$nameListCode] - )) + if (($field_relations = + CFactory::_('Registry')->get('builder.field_relations.' . $nameListCode)) !== null) { - foreach ( - $this->fieldRelations[$nameListCode] as $field_id => $fields - ) + foreach ($field_relations as $field_id => $fields) { foreach ($fields as $area => $field) { @@ -22072,12 +22031,10 @@ class Interpretation extends Fields } } */ // load the relations after modeling - if (isset($this->fieldRelations[$nameListCode]) - && ArrayHelper::check( - $this->fieldRelations[$nameListCode] - )) + if (($field_relations = + CFactory::_('Registry')->get('builder.field_relations.' . $nameListCode)) !== null) { - foreach ($this->fieldRelations[$nameListCode] as $fields) + foreach ($field_relations as $fields) { foreach ($fields as $area => $field) { @@ -22437,7 +22394,7 @@ class Interpretation extends Fields break; } // Trigger Event: jcb_ce_setClassHeader - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_setClassHeader', array(&$this->componentContext, &$context, &$codeName, &$headers) @@ -22602,7 +22559,7 @@ class Interpretation extends Fields foreach ($item['joinfields'] as $join) { $field['$item->{' . (int) $join . '}'] = '$item->' - . $this->listJoinBuilder[$nameListCode][(int) $join]['code']; + . CFactory::_('Registry')->get('builder.list_join.' . $nameListCode . '.' . (int) $join . '.code'); } } // set based on join_type @@ -22917,13 +22874,11 @@ class Interpretation extends Fields $catCode = $this->categoryBuilder[$name_list]['code']; // check if category has another name - if (isset($this->catOtherName[$name_list]) - && ArrayHelper::check( - $this->catOtherName[$name_list] - )) + if (CFactory::_('Registry')->get('category.other.name.' . $name_list . '.views') + && CFactory::_('Registry')->get('category.other.name.' . $name_list . '.name')) { - $otherViews = $this->catOtherName[$name_list]['views']; - $otherNames = $this->catOtherName[$name_list]['name']; + $otherViews = CFactory::_('Registry')->get('category.other.name.' . $name_list . '.views'); + $otherNames = CFactory::_('Registry')->get('category.other.name.' . $name_list . '.name'); // build lang $langName = StringHelper::safe( $otherNames, 'W' @@ -23503,13 +23458,10 @@ class Interpretation extends Fields $view['settings']->name_list ); // check if category has another name - if (isset($this->catOtherName[$nameListCode]) - && ArrayHelper::check( - $this->catOtherName[$nameListCode] - )) + if (CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views')) { $otherViews - = $this->catOtherName[$nameListCode]['views']; + = CFactory::_('Registry')->get('category.other.name.' . $nameListCode . '.views'); } else { @@ -24171,7 +24123,7 @@ class Interpretation extends Fields // set the custom table key $dbkey = 'g'; // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, @@ -24248,7 +24200,7 @@ class Interpretation extends Fields elseif (2 == $timer) // this is after the admin views are build { // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, @@ -24267,7 +24219,7 @@ class Interpretation extends Fields $this->setCustomControlConfigFieldsets($lang); } // Trigger Event: jcb_ce_onAfterSetConfigFieldsets - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->extensionsParams, @@ -26629,9 +26581,9 @@ function vdm_dkim() { // enable the loading of dynamic field sets $dynamicAddFields = array(); // Add encryption if needed - if ((isset($this->basicEncryption) && $this->basicEncryption) - || (isset($this->whmcsEncryption) && $this->whmcsEncryption) - || (isset($this->mediumEncryption) && $this->mediumEncryption) + if (CFactory::_('Config')->basic_encryption + || CFactory::_('Config')->whmcs_encryption + || CFactory::_('Config')->medium_encryption || $this->componentData->add_license || (isset($this->configFieldSetsCustomField['Encryption Settings']) && ArrayHelper::check( @@ -26649,11 +26601,9 @@ function vdm_dkim() { . '_ENCRYPTION_DESC">'; // set tab lang - if (((isset($this->basicEncryption) && $this->basicEncryption) - || (isset($this->mediumEncryption) - && $this->mediumEncryption) - || (isset($this->whmcsEncryption) - && $this->whmcsEncryption)) + if ((CFactory::_('Config')->basic_encryption + || CFactory::_('Config')->medium_encryption + || CFactory::_('Config')->whmcs_encryption) && $this->componentData->add_license && $this->componentData->license_type == 3) { @@ -26668,11 +26618,9 @@ function vdm_dkim() { // add the next dynamic option $dynamicAddFields[] = "License & Encryption Settings"; } - elseif (((isset($this->basicEncryption) && $this->basicEncryption) - || (isset($this->mediumEncryption) - && $this->mediumEncryption) - || (isset($this->whmcsEncryption) - && $this->whmcsEncryption)) + elseif ((CFactory::_('Config')->basic_encryption + || CFactory::_('Config')->medium_encryption + || CFactory::_('Config')->whmcs_encryption) && $this->componentData->add_license && $this->componentData->license_type == 2) { @@ -26725,7 +26673,7 @@ function vdm_dkim() { ); } - if (isset($this->basicEncryption) && $this->basicEncryption) + if (CFactory::_('Config')->basic_encryption) { // set field lang CFactory::_('Language')->set( @@ -26759,7 +26707,7 @@ function vdm_dkim() { $this->configFieldSets[] = Indent::_(3) . 'default=""'; $this->configFieldSets[] = Indent::_(2) . "/>"; } - if (isset($this->mediumEncryption) && $this->mediumEncryption) + if (CFactory::_('Config')->medium_encryption) { // set field lang CFactory::_('Language')->set( @@ -26802,7 +26750,7 @@ function vdm_dkim() { "Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component." ); } - if (isset($this->whmcsEncryption) && $this->whmcsEncryption + if (CFactory::_('Config')->whmcs_encryption || $this->componentData->add_license) { // set field lang label and description @@ -26863,7 +26811,7 @@ function vdm_dkim() { } else { - if (isset($this->whmcsEncryption) && $this->whmcsEncryption) + if (CFactory::_('Config')->whmcs_encryption) { CFactory::_('Language')->set( CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_LABEL', @@ -26880,7 +26828,7 @@ function vdm_dkim() { } } // add the description based on global settings - if (isset($this->whmcsEncryption) && $this->whmcsEncryption) + if (CFactory::_('Config')->whmcs_encryption) { CFactory::_('Language')->set( CFactory::_('Config')->lang_target, $lang . '_WHMCS_KEY_NOTE_DESC', @@ -27010,7 +26958,7 @@ function vdm_dkim() { $this->permissionViews = array(); // Trigger Event: jcb_ce_onBeforeBuildAccessSections - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAccessSections', array(&$this->componentContext, &$this) ); @@ -27372,8 +27320,8 @@ function vdm_dkim() { $field['settings']->properties )) { - $fieldType = $this->getFieldType($field); - $fieldName = $this->getFieldName( + $fieldType = CFactory::_('Field.Type.Name')->get($field); + $fieldName = CFactory::_('Field.Name')->get( $field, $nameViews ); // loop the permission options @@ -27447,7 +27395,7 @@ function vdm_dkim() { } // Trigger Event: jcb_ce_onAfterBuildAccessSections - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAccessSections', array(&$this->componentContext, &$this) ); @@ -28175,7 +28123,7 @@ function vdm_dkim() { // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget($module->key); // Trigger Event: jcb_ce_onBeforeBuildModuleLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildModuleLang', array(&$this->componentContext, &$module, &$langContent, &$module->lang_prefix, &$module->official_name) @@ -28197,7 +28145,7 @@ function vdm_dkim() { $total = count($values); unset($values); // Trigger Event: jcb_ce_onBeforeBuildModuleLangFiles - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildModuleLangFiles', array(&$this->componentContext, &$module, &$this->languages['modules'], @@ -28563,7 +28511,7 @@ function vdm_dkim() { // for plugin event TODO change event api signatures $langContent = CFactory::_('Language')->getTarget($plugin->key); // Trigger Event: jcb_ce_onBeforeBuildPluginLang - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildPluginLang', array(&$this->componentContext, &$plugin, &$langContent, @@ -28586,7 +28534,7 @@ function vdm_dkim() { $total = count($values); unset($values); // Trigger Event: jcb_ce_onBeforeBuildPluginLangFiles - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildPluginLangFiles', array(&$this->componentContext, &$plugin, &$this->languages['plugins'], diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 65dc4de66..fd9707e04 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -67,7 +67,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildFilesContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, @@ -391,7 +391,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -641,7 +641,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -666,7 +666,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAdminListViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -982,7 +982,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildAdminListViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminListViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -1156,7 +1156,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildAdminViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildAdminViewContent', array(&$this->componentContext, &$view, &$nameSingleCode, @@ -1241,7 +1241,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -1430,7 +1430,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -1624,10 +1624,9 @@ class Infusion extends Interpretation } // build the validation rules - if (isset($this->validationRules) - && ArrayHelper::check($this->validationRules)) + if (($validationRules = CFactory::_('Registry')->_('validation.rules')) !== null) { - foreach ($this->validationRules as $rule => $_php) + foreach ($validationRules as $rule => $_php) { // setup rule file $target = array('admin' => 'a_rule_zi'); @@ -1716,7 +1715,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onBeforeBuildSiteViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -1933,7 +1932,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildSiteViewContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, @@ -2089,7 +2088,7 @@ class Infusion extends Interpretation if (ObjectHelper::check($power)) { // Trigger Event: jcb_ce_onBeforeInfusePowerData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeInfusePowerData', array(&$this->componentContext, &$power, &$this) ); @@ -2099,7 +2098,7 @@ class Infusion extends Interpretation // build the autoloader $autoloader[implode('.', $power->_namespace_prefix)] = $power->_namespace_prefix; // Trigger Event: jcb_ce_onAfterInfusePowerData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterInfusePowerData', array(&$this->componentContext, &$power, &$this) ); @@ -2120,7 +2119,7 @@ class Infusion extends Interpretation if (ObjectHelper::check($module)) { // Trigger Event: jcb_ce_onBeforeInfuseModuleData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeInfuseModuleData', array(&$this->componentContext, &$module, &$this) ); @@ -2150,7 +2149,7 @@ class Infusion extends Interpretation { // INSTALLCLASS $this->fileContentDynamic[$module->key][Placefix::_h('INSTALLCLASS')] - = CFactory::_J('Extension.InstallScript')->get($module); + = CFactory::_('Extension.InstallScript')->get($module); } // FIELDSET if (isset($module->form_files) @@ -2178,7 +2177,7 @@ class Infusion extends Interpretation $this->fileContentDynamic[$module->key][Placefix::_h('MAINXML')] = $this->getModuleMainXML($module); // Trigger Event: jcb_ce_onAfterInfuseModuleData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterInfuseModuleData', array(&$this->componentContext, &$module, &$this) ); @@ -2193,7 +2192,7 @@ class Infusion extends Interpretation if (ObjectHelper::check($plugin)) { // Trigger Event: jcb_ce_onBeforeInfusePluginData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeInfusePluginData', array(&$this->componentContext, &$plugin, &$this) ); @@ -2209,7 +2208,7 @@ class Infusion extends Interpretation { // INSTALLCLASS $this->fileContentDynamic[$plugin->key][Placefix::_h('INSTALLCLASS')] - = CFactory::_J('Extension.InstallScript')->get($plugin); + = CFactory::_('Extension.InstallScript')->get($plugin); } // FIELDSET if (isset($plugin->form_files) @@ -2237,7 +2236,7 @@ class Infusion extends Interpretation $this->fileContentDynamic[$plugin->key][Placefix::_h('MAINXML')] = $this->getPluginMainXML($plugin); // Trigger Event: jcb_ce_onAfterInfusePluginData - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterInfusePluginData', array(&$this->componentContext, &$plugin, &$this) ); @@ -2252,7 +2251,7 @@ class Infusion extends Interpretation // for plugin event TODO change event api signatures $this->placeholders = CFactory::_('Placeholder')->active; // Trigger Event: jcb_ce_onAfterBuildFilesContent - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onAfterBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, @@ -2438,7 +2437,7 @@ class Infusion extends Interpretation // path to INI file $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles - CFactory::_J('Event')->trigger( + CFactory::_('Event')->trigger( 'jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages['components'], &$this->langTag) diff --git a/admin/helpers/extrusion/b_builder.php b/admin/helpers/extrusion/b_builder.php index 49500600f..7afad4ea8 100644 --- a/admin/helpers/extrusion/b_builder.php +++ b/admin/helpers/extrusion/b_builder.php @@ -191,7 +191,7 @@ class Builder extends Mapping */ protected function setField(&$view, &$field) { - if ($fieldType = $this->getFieldType($field['fieldType'])) + if ($fieldType = CFactory::_('Field.Type.Name')->get($field['fieldType'])) { // set the field object $object = new stdClass(); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index c9bfb09f2..5556dee6f 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -3528,11 +3528,6 @@ COM_COMPONENTBUILDER_CONFIG_MAIL_CONFIGURATION="Mail Configuration" COM_COMPONENTBUILDER_CONFIG_MANAGE_JCB_PACKAGE_DIRECTORIES_DESCRIPTION="Here you can choose to manually select what directories should show, or turn them off altogether." COM_COMPONENTBUILDER_CONFIG_MANAGE_JCB_PACKAGE_DIRECTORIES_LABEL="Manage JCB Package Directories" COM_COMPONENTBUILDER_CONFIG_MANUAL_SELECTION="Manual Selection" -COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_DESC="Set the full path to where the key file must be stored. Make sure it is behind the root folder of your website, so that it is not public accessible." -COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_LABEL="Medium Key (Path)" -COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_NOTE_DESC="When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
    Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!" -COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_NOTE_LABEL="Medium Encryption" -COM_COMPONENTBUILDER_CONFIG_MEDIUM_KEY_PATH_ERROR="Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component." COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_DESCRIPTION="Add the prefix you would like to use. Make sure that it is HTML Character Entities since it is being used in XML." COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_HINT="»" COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_LABEL="Prefix
    diff --git a/admin/layouts/power/code_left.php b/admin/layouts/power/code_left.php index 098dc960b..85ed07e9f 100644 --- a/admin/layouts/power/code_left.php +++ b/admin/layouts/power/code_left.php @@ -29,10 +29,10 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name', 'description', 'extends', - 'implements_custom', - 'implements', - 'namespace', 'extends_custom', + 'implements', + 'implements_custom', + 'namespace', 'add_head' ); diff --git a/admin/models/power.php b/admin/models/power.php index 6c2f82742..24693b742 100644 --- a/admin/models/power.php +++ b/admin/models/power.php @@ -33,10 +33,10 @@ class ComponentbuilderModelPower extends AdminModel 'name', 'description', 'extends', - 'implements_custom', - 'implements', - 'namespace', 'extends_custom', + 'implements', + 'implements_custom', + 'namespace', 'add_head' ), 'right' => array( diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 15782757b..7ab8a2050 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1987,8 +1987,8 @@ INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `exten (21, 1, 'Global Unique ID Helper\r\n\r\n@since 3.0.9', '', '', '9c513baf-b279-43fd-ae29-a585c8cbc4f0', 'dXNlIEpvb21sYVxDTVNcRmFjdG9yeTs=', '', '', '{\"load_selection0\":{\"load\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\"},\"load_selection1\":{\"load\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\"}}', 'CS8qKg0KCSAqIFJldHVybnMgYSBHVUlEdjQgc3RyaW5nDQoJICogDQoJICogVGhhbmtzIHRvIERhdmUgUGVhcnNvbiAoYW5kIG90aGVyKQ0KCSAqIGh0dHBzOi8vd3d3LnBocC5uZXQvbWFudWFsL2VuL2Z1bmN0aW9uLmNvbS1jcmVhdGUtZ3VpZC5waHAjMTE5MTY4IA0KCSAqDQoJICogVXNlcyB0aGUgYmVzdCBjcnlwdG9ncmFwaGljYWxseSBzZWN1cmUgbWV0aG9kDQoJICogZm9yIGFsbCBzdXBwb3J0ZWQgcGxhdGZvcm1zIHdpdGggZmFsbGJhY2sgdG8gYW4gb2xkZXIsDQoJICogbGVzcyBzZWN1cmUgdmVyc2lvbi4NCgkgKg0KCSAqIEBwYXJhbSBib29sICR0cmltDQoJ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hbGx5IFVuaXF1ZSBJZGVudGlmaWVyDQoJICoNCgkgKiBUaGFua3MgdG8gTGV3aWUNCgkgKiBodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL2EvMTUxNTQ1Ni8xNDI5Njc3DQoJICoNCgkgKiBAcGFyYW0gc3RyaW5nICRndWlkDQoJICoNCgkgKiBAcmV0dXJuIGJvb2wNCgkgKg0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwcm90ZWN0ZWQgc3RhdGljIGZ1bmN0aW9uIHZhbGlkYXRlKCRndWlkKQ0KCXsNCgkJLy8gY2hlY2sgaWYgd2UgaGF2ZSBhIHN0cmluZw0KCQlpZiAoU3RyaW5nSGVscGVyOjpjaGVjaygkZ3VpZCkpDQoJCXsNCgkJCXJldHVybiBwcmVnX21hdGNoKCIvXihceyk/W2EtZlxkXXs4fSgtW2EtZlxkXXs0fSl7NH1bYS1mXGRdezh9KD8oMSlcfSkkL2kiLCAkZ3VpZCk7DQoJCX0NCgkJcmV0dXJuIGZhbHNlOw0KCX0NCg==', '{}', 'GuidHelper', 'VDM\\Joomla\\Utilities.GuidHelper', '1.0.0', '{}', 'Utilities GuidHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\"}}', '', 1, '2022-03-12 01:27:10', '2022-05-21 13:27:39', 12, 9), (22, 1, 'File helper\r\n\r\n@since 3.0.9', '', '', 'a223b31e-ea1d-4cdf-92ae-5f9becffaff0', 'dXNlIEpvb21sYVxDTVNcVXJpXFVyaTsNCnVzZSBKb29tbGFcQ01TXEZhY3Rvcnk7DQp1c2UgSm9vbWxhXENNU1xMYW5ndWFnZVxUZXh0Ow0KdXNlIEpvb21sYVxDTVNcRmlsZXN5c3RlbVxQYXRoOw0KdXNlIEpvb21sYVxDTVNcRmlsZXN5c3RlbVxGaWxlOw0KdXNlIEpvb21sYVxDTVNcRmlsZXN5c3RlbVxGb2xkZXI7DQp1c2UgSm9vbWxhXEFyY2hpdmVcQXJjaGl2ZTs=', '', '', '{\"load_selection0\":{\"load\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\"},\"load_selection1\":{\"load\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\"},\"load_selection2\":{\"load\":\"91004529-94a9-4590-b842-e7c6b624ecf5\"}}', 'CS8qKg0KCSAqIFRyaWdnZXIgZXJyb3Igbm90aWNlIG9ubHkgb25jZQ0KCSAqDQoJICogQHZhciAgICBib29sDQoJICoNCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHJvdGVjdGVkIHN0YXRpYyAkY3VybEVycm9yID0gZmFsc2U7DQoNCgkvKioNCgkgKiBUaGUgemlwcGVyIG1ldGhvZA0KCSAqIA0KCSAqIEBwYXJhbSAgc3RyaW5nICAgJHdvcmtpbmdEaXJlY3RvcnkgICAgVGhlIGRpcmVjdG9yeSB3aGVyZSB0aGUgaXRlbXMgbXVzdCBiZSB6aXBwZWQNCgkgKiBAcGFyYW0gIHN0cmluZyAgICRmaWxlcGF0aCAgICAgICAgICBUaGUgcGF0aCB0byB3aGVyZSB0aGUgemlwIGZpbGUgbXVzdCBiZSBwbGFjZWQNCgkgKg0KCSAqIEByZXR1cm4gIGJvb2wgdHJ1ZSAgIE9uIHN1Y2Nlc3MNCgkgKg0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIHppcCgkd29ya2luZ0RpcmVjdG9yeSwgJiRmaWxlcGF0aCkNCgl7DQoJCS8vIHN0b3JlIHRoZSBjdXJyZW50IGpvb21sYSB3b3JraW5nIGRpcmVjdG9yeQ0KCQkkam9vbWxhID0gZ2V0Y3dkKCk7DQoNCgkJLy8gd2UgYXJlIGNoYW5naW5nIHRoZSB3b3JraW5nIGRpcmVjdG9yeSB0byB0aGUgY29tcG9uZW50IHRlbXAgZm9sZGVyDQoJCWNoZGlyKCR3b3JraW5nRGlyZWN0b3J5KTsNCg0KCQkvLyB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0KCQkJCWlmICgkc3RhdHVzQ29kZSAhPT0gNDA0KQ0KCQkJCXsNCgkJCQkJJGV4aXN0cyA9IHRydWU7DQoJCQkJfQ0KCQkJfQ0KCQkJLy8gY2xvc2UgdGhlIGNvbm5lY3Rpb24NCgkJCWN1cmxfY2xvc2UoJGNoKTsNCgkJfQ0KCQllbHNlaWYgKCRoZWFkZXJzID0gQGdldF9oZWFkZXJzKCRwYXRoKSkNCgkJew0KCQkJaWYoaXNzZXQoJGhlYWRlcnNbMF0pICYmIGlzX3N0cmluZygkaGVhZGVyc1swXSkgJiYgc3RycG9zKCRoZWFkZXJzWzBdLCc0MDQnKSA9PT0gZmFsc2UpDQoJCQl7DQoJCQkJJGV4aXN0cyA9IHRydWU7DQoJCQl9DQoJCX0NCgkJcmV0dXJuICRleGlzdHM7DQoJfQ0K', '{}', 'FileHelper', 'VDM\\Joomla\\Utilities.FileHelper', '1.0.0', '{}', 'Utilities FileHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-12 02:09:18', '2022-06-11 16:54:51', 24, 9), (23, 1, 'Some component helper\r\n\r\n@since 3.0.11', '', '', '640b5352-fb09-425f-a26e-cd44eda03f15', 'dXNlIEpvb21sYVxJbnB1dFxJbnB1dDsNCnVzZSBKb29tbGFcQ01TXENvbXBvbmVudFxDb21wb25lbnRIZWxwZXI7DQp1c2UgSm9vbWxhXFJlZ2lzdHJ5XFJlZ2lzdHJ5Ow==', '', '', '{}', 'CS8qKg0KCSAqIFRoZSBjdXJyZW50IG9wdGlvbg0KCSAqDQoJICogQHZhciAgICBTdHJpbmcNCgkgKiBAc2luY2UgICAzLjAuMTENCgkgKi8NCglwdWJsaWMgc3RhdGljICRvcHRpb247DQoNCgkvKioNCgkgKiBUaGUgY29tcG9uZW50IHBhcmFtcyBsaXN0IGNhY2hlDQoJICoNCgkgKiBAdmFyICAgIFJlZ2lzdHJ5W10NCgkgK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zdCgkY29kZV9uYW1lKSAuICdIZWxwZXInOw0KCQkJLy8gY2hlY2sgaWYgY2xhc3MgZXhpc3QNCgkJCWlmIChjbGFzc19leGlzdHMoJGhlbHBlcl9uYW1lKSkNCgkJCXsNCgkJCQlyZXR1cm4gJGhlbHBlcl9uYW1lOw0KCQkJfQ0KCQl9DQoNCgkJcmV0dXJuICRkZWZhdWx0Ow0KCX0NCg0KCS8qKg0KCSAqIENoZWNrIGlmIHRoZSBoZWxwZXIgY2xhc3Mgb2YgdGhpcyBjb21wb25lbnQgaGFzIGEgbWV0aG9kDQoJICoNCgkgKiBAcGFyYW0gICBTdHJpbmcgICAgICAgJG1ldGhvZCAgVGhlIG1ldGhvZCBuYW1lIHRvIHNlYXJjaCBmb3INCgkgKiBAcGFyYW0gICBTdHJpbmcgICAgICAgJG9wdGlvbiAgICBUaGUgb3B0aW9uIGZvciB0aGUgY29tcG9uZW50Lg0KCSAqDQoJICogQHJldHVybiAgYm9vbCAgICAgICAgICB0cnVlIGlmIG1ldGhvZCBleGlzdA0KCSAqDQoJICogQHNpbmNlICAgMy4wLjExDQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBtZXRob2RFeGlzdHMoJG1ldGhvZCwgJG9wdGlvbiA9IG51bGwpDQoJew0KCQkvLyBnZXQgdGhlIGhlbHBlciBjbGFzcw0KCQlpZiAoKCRoZWxwZXIgPSBzZWxmOjpnZXQoJG9wdGlvbiwgZmFsc2UpKSAhPT0gZmFsc2UpDQoJCXsNCgkJCWlmIChtZXRob2RfZXhpc3RzKCRoZWxwZXIsICRtZXRob2QpKQ0KCQkJew0KCQkJCXJldHVybiB0cnVlOw0KCQkJfQ0KCQl9DQoNCgkJcmV0dXJuIGZhbHNlOw0KCX0NCg==', '{}', 'Helper', 'VDM\\Joomla\\Utilities.Component.Helper', '1.0.0', '{}', 'Utilities Component Helper', 'abstract class', '{}', '', 1, '2022-05-13 05:36:32', '2022-05-21 13:27:39', 17, 7), -(24, 1, 'Image helper\r\n\r\n@since 3.0.11', '', '', '962b15d8-915f-4cd7-aea6-7cf82afdc20b', 'dXNlIEpvb21sYVxDTVNcRmlsZXN5c3RlbVxGaWxlOw0KdXNlIEpvb21sYVxDTVNcRmlsZXN5c3RlbVxGb2xkZXI7DQp1c2UgSm9vbWxhXENNU1xVcmlcVXJpOw0KdXNlIEpvb21sYVxDTVNcSW1hZ2VcSW1hZ2U7', '', '', '{\"load_selection0\":{\"load\":\"91004529-94a9-4590-b842-e7c6b624ecf5\"},\"load_selection1\":{\"load\":\"f11dc790-713e-4706-9a85-a318ed3ad56e\"}}', 'CS8qKg0KCSAqIFJlc2l6ZSBhbiBpbWFnZQ0KCSAqDQoJICogQHBhcmFtICAgc3RyaW5nICAgICRmdWxsUGF0aCAgIFRoZSBmdWxsIHBhdGggdG8gdGhlIGltYWdlDQoJICogQHBhcmFtICAgc3RyaW5nICAgICR0eXBlICAgICAgICBUaGUgdHlwZSBvZiBpbWFnZQ0KCSAqDQoJICogQHJldHVybiBib29sDQoJICogQHNpbmNlIDMuMC4xMQ0KCSAqLw0KCXB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gcmVzaXplKHN0cmluZyAkZnVsbFBhdGgsIHN0cmluZyAkdHlwZSkNCgl7DQoJCS8vIGZpcnN0IGNoZWNrIGlmIHdlIHNob3VsZCByZXNpemUgdGhpcyB0YXJnZXQNCgkJaWYgKDEgPT0gSGVscGVyOjpnZXRQYXJhbXMoKS0+Z2V0KCR0eXBlIC4gJ19yZXNpemUnLCAwKSkNCgkJew0KCQkJLy8gbG9hZCB0aGUgc2l6ZSB0byBiZSBzZXQNCgkJCSRoZWlnaHQgPSBIZWxwZXI6OmdldFBhcmFtcygpLT5nZXQoJHR5cGUgLiAnX2hlaWdodCcsICdub3Rfc2V0Jyk7DQoJCQkkd2lkdGggPSBIZWxwZXI6OmdldFBhcmFtcygpLT5nZXQoJHR5cGUgLiAnX3dpZHRoJywgJ25vdF9zZXQnKTsNCg0KCQkJLy8gR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nVsbFBhdGgsIFBBVEhJTkZPX0RJUk5BTUUpOw0KCQkJCS8vIHJlbW92ZSB0aGUgc2VydmVyIHBhdGgNCgkJCQkkaW1hZ2VfcHVibGljX3BhdGggPSB0cmltKHN0cl9yZXBsYWNlKEpQQVRIX1NJVEUsICcnLCAkZGlyX25hbWUpLCAnLycpIC4gJy8nIC4gJG5hbWU7DQoJCQkJLy8gbm93IGFkZCB0aGUgc3JjIHBhdGggdG8gc2hvdyB0aGUgaW1hZ2UNCgkJCQkkcHJvcGVydGllcy0+c3JjID0gVXJpOjpyb290KCkgLiAkaW1hZ2VfcHVibGljX3BhdGg7DQoJCQkJLy8gcmV0dXJuIHRoZSBpbWFnZSBwcm9wZXJ0aWVzDQoJCQkJcmV0dXJuICRwcm9wZXJ0aWVzOw0KCQkJfQ0KCQl9DQoJCXJldHVybiBmYWxzZTsNCgl9DQo=', '{}', 'ImageHelper', 'VDM\\Joomla\\Utilities.ImageHelper', '1.0.0', '{}', 'Utilities ImageHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-05-16 10:59:17', '2022-05-21 13:27:39', 17, 9), -(25, 1, 'Upload Helper\r\n\r\n@since 3.0.11', '', '', 'd7600b43-771a-4747-9f5d-952765721799', 'dXNlIEpvb21sYVxDTVNcRmFjdG9yeTsNCnVzZSBKb29tbGFcQ01TXExhbmd1YWdlXFRleHQ7DQp1c2UgSm9vbWxhXENNU1xGaWxlc3lzdGVtXEZpbGU7DQp1c2UgSm9vbWxhXENNU1xGaWxlc3lzdGVtXEZvbGRlcjsNCnVzZSBKb29tbGFcQ01TXEZpbGVzeXN0ZW1cUGF0aDs=', '', '', '{\"load_selection0\":{\"load\":\"f11dc790-713e-4706-9a85-a318ed3ad56e\"},\"load_selection1\":{\"load\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\"}}', 'CS8qKg0KCSAqIFRydWUgdG8gdXNlIHN0cmVh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l9DQoJfQ==', '{}', 'UploadHelper', 'VDM\\Joomla\\Utilities.UploadHelper', '1.0.0', '{}', 'Utilities UploadHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-05-16 13:20:50', '2022-05-21 13:27:39', 31, 9), +(24, 1, 'Image helper\r\n\r\n@since 3.0.11', '', '', '962b15d8-915f-4cd7-aea6-7cf82afdc20b', 'dXNlIEpvb21sYVxDTVNcRmlsZXN5c3RlbVxGaWxlOw0KdXNlIEpvb21sYVxDTVNcRmlsZXN5c3RlbVxGb2xkZXI7DQp1c2UgSm9vbWxhXENNU1xVcmlcVXJpOw0KdXNlIEpvb21sYVxDTVNcSW1hZ2VcSW1hZ2U7', '', '', '{\"load_selection0\":{\"load\":\"91004529-94a9-4590-b842-e7c6b624ecf5\"},\"load_selection1\":{\"load\":\"f11dc790-713e-4706-9a85-a318ed3ad56e\"}}', 'CS8qKg0KCSAqIFJlc2l6ZSBhbiBpbWFnZQ0KCSAqDQoJICogQHBhcmFtICAgc3RyaW5nICAgICRmdWxsUGF0aCAgIFRoZSBmdWxsIHBhdGggdG8gdGhlIGltYWdlDQoJICogQHBhcmFtICAgc3RyaW5nICAgICR0eXBlICAgICAgICBUaGUgdHlwZSBvZiBpbWFnZQ0KCSAqDQoJICogQHJldHVybiBib29sDQoJICogQHNpbmNlIDMuMC4xMQ0KCSAqLw0KCXB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gcmVzaXplKHN0cmluZyAkZnVsbFBhdGgsIHN0cmluZyAkdHlwZSkNCgl7DQoJCS8vIGZpcnN0IGNoZWNrIGlmIHdlIHNob3VsZCByZXNpemUgdGhpcyB0YXJnZXQNCgkJaWYgKDEgPT0gSGVscGVyOjpnZXRQYXJhbXMoKS0+Z2V0KCR0eXBlIC4gJ19yZXNpemUnLCAwKSkNCgkJew0KCQkJLy8gbG9hZCB0aGUgc2l6ZSB0byBiZSBzZXQNCgk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b3BlcnRpZXMpKQ0KCQkJew0KCQkJCS8vIGdldCBpbWFnZSBmaWxlIG5hbWUNCgkJCQkkbmFtZSA9IGJhc2VuYW1lKCRmdWxsUGF0aCk7DQoJCQkJLy8gcmVtb3ZlIGZpbGUgbmFtZSBmcm9tIHBhdGgNCgkJCQkkZGlyX25hbWUgPSBwYXRoaW5mbygkZnVsbFBhdGgsIFBBVEhJTkZPX0RJUk5BTUUpOw0KCQkJCS8vIHJlbW92ZSB0aGUgc2VydmVyIHBhdGgNCgkJCQkkaW1hZ2VfcHVibGljX3BhdGggPSB0cmltKHN0cl9yZXBsYWNlKEpQQVRIX1NJVEUsICcnLCAkZGlyX25hbWUpLCAnLycpIC4gJy8nIC4gJG5hbWU7DQoJCQkJLy8gbm93IGFkZCB0aGUgc3JjIHBhdGggdG8gc2hvdyB0aGUgaW1hZ2UNCgkJCQkkcHJvcGVydGllcy0+c3JjID0gVXJpOjpyb290KCkgLiAkaW1hZ2VfcHVibGljX3BhdGg7DQoJCQkJLy8gcmV0dXJuIHRoZSBpbWFnZSBwcm9wZXJ0aWVzDQoJCQkJcmV0dXJuICRwcm9wZXJ0aWVzOw0KCQkJfQ0KCQl9DQoJCXJldHVybiBmYWxzZTsNCgl9DQo=', '{}', 'ImageHelper', 'VDM\\Joomla\\Utilities.ImageHelper', '1.0.0', '{}', 'Utilities ImageHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-05-16 10:59:17', '2022-09-03 17:18:33', 18, 9), +(25, 1, 'Upload Helper\r\n\r\n@since 3.0.11', '', '', 'd7600b43-771a-4747-9f5d-952765721799', 'dXNlIEpvb21sYVxDTVNcRmFjdG9yeTsNCnVzZSBKb29tbGFcQ01TXExhbmd1YWdlXFRleHQ7DQp1c2UgSm9vbWxhXENNU1xGaWxlc3lzdGVtXEZpbGU7DQp1c2UgSm9vbWxhXENNU1xGaWxlc3lzdGVtXEZvbGRlcjsNCnVzZSBKb29tbGFcQ01TXEZpbGVzeXN0ZW1cUGF0aDs=', '', '', '{\"load_selection0\":{\"load\":\"f11dc790-713e-4706-9a85-a318ed3ad56e\"},\"load_selection1\":{\"load\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\"}}', 'CS8qKg0KCSAqIFRydWUgdG8gdXNlIHN0cmVhbXMNCgkgKg0KCSAqIEB2YXIgICAgYm9vbA0KCSAqDQoJICogQHNpbmNlICAzLjAuMTENCgkgKi8NCglwdWJsaWMgc3RhdGljICR1c2VTdHJlYW1zID0gZmFsc2U7DQoNCgkvKioNCgkgKiBBbGxvdyB0aGUgdXBsb2FkIG9mIHVuc2FmZSBmaWxlcw0KCSAqDQoJICogQHZhciAgICBib29sDQoJICoNCgkgKiBAc2luY2UgIDMuMC4xMQ0KCSAqLw0KCXB1YmxpYyBzdGF0aWMgJGFsbG93VW5zYWZlID0gZmFsc2U7DQoNCgkvKioNCgkgKiBPcHRpb25zIHRvIElucHV0RmlsdGVyOjppc1NhZmVGaWxlDQoJICoNCgkgKiBAdmFyICAgIGFycmF5DQoJICoNCgkgKiBAc2luY2UgIDMuMC4xMQ0KCSAqLw0KCXB1YmxpYyBzdGF0aWMgJHNhZmVGaWxlT3B0aW9ucyA9IGFycmF5KCk7DQoNCgkvKioNCgkgKiBTZXQgdGhlIGVycm9yIGJlaGF2aW9yDQoJICoNCgkgKiBAdmFyICAgIGJvb2wNCgkgKg0KCSAqIEBzaW5jZSAgMy4wLjExDQoJICovDQoJcHVibGljIHN0YXRpYyAkZW5xdWV1ZUVycm9yID0gdHJ1ZTsNCg0KCS8qKg0KCSAqIEVycm9ycw0KCSAqDQoJICogQHZhciAgICBhcnJheQ0KCSAqDQoJICogQHNpbmNlICAzLjAuMTENCgkgKi8NCglwcm90ZWN0ZWQgc3RhdGljICRlcnJvcnMgPSBhcnJheSgpOw0KDQoJLyoqDQoJICogR2V0IGZpbGUvZmlsZXMgZnJvbSBhIEhUVFAgdXBsb2Fk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bGY6OiRlbnF1ZXVlRXJyb3IpDQoJCXsNCgkJCUZhY3Rvcnk6OmdldEFwcGxpY2F0aW9uKCktPmVucXVldWVNZXNzYWdlKCRtZXNzYWdlLCAnZXJyb3InKTsNCgkJfQ0KCQllbHNlDQoJCXsNCgkJCXNlbGY6OiRlcnJvcnNbXSA9ICRtZXNzYWdlOw0KCQl9DQoJfQ0K', '{}', 'UploadHelper', 'VDM\\Joomla\\Utilities.UploadHelper', '1.0.0', '{}', 'Utilities UploadHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-05-16 13:20:50', '2022-09-03 17:20:06', 33, 9), (26, '', 'Mime Helper\r\n\r\n@since 3.0.11', '', '', 'f11dc790-713e-4706-9a85-a318ed3ad56e', '', '', '', '{}', 'W0VYVEVSTkFMQ09ERT1odHRwczovL2dpc3QuZ2l0aHVidXNlcmNvbnRlbnQuY29tL0xsZXdlbGx5bnZkbS83NGJlMzczMzU3ZTEzMWI4Nzc1YTc1ODJjM2RlNTA4Yi9yYXcvbWltZV90eXBlcy5waHBdDQoNCltFWFRFUk5BTENPREU9aHR0cHM6Ly9naXN0LmdpdGh1YnVzZXJjb250ZW50LmNvbS9MbGV3ZWxseW52ZG0vNzRiZTM3MzM1N2UxMzFiODc3NWE3NTgyYzNkZTUwOGIvcmF3L2dldC5waHBdDQoNCltFWFRFUk5BTENPREU9aHR0cHM6Ly9naXN0LmdpdGh1YnVzZXJjb250ZW50LmNvbS9MbGV3ZWxseW52ZG0vNzRiZTM3MzM1N2UxMzFiODc3NWE3NTgyYzNkZTUwOGIvcmF3L2V4dGVuc2lvbnMucGhwXQ==', '{}', 'MimeHelper', 'VDM\\Joomla\\Utilities.MimeHelper', '1.0.0', '{}', 'Utilities MimeHelper', 'abstract class', '{}', '', 1, '2022-05-16 14:27:38', '2022-05-21 13:27:39', 3, 9), (27, '', 'Just to link powers to the power updater component', '', '', '8025e71c-8e21-44cb-b23e-dce2fb5a1ab5', '', '', '', '{\"load_selection0\":{\"load\":\"db4a1e4d-be59-4e87-8b4d-c40512752232\"},\"load_selection1\":{\"load\":\"79d765b3-7319-4988-9730-446c7f347020\"},\"load_selection2\":{\"load\":\"d7600b43-771a-4747-9f5d-952765721799\"},\"load_selection3\":{\"load\":\"962b15d8-915f-4cd7-aea6-7cf82afdc20b\"},\"load_selection4\":{\"load\":\"f11dc790-713e-4706-9a85-a318ed3ad56e\"}}', '', '{}', 'Updater', 'VDM\\Powe\\Updater', '1.0.0', '{}', 'Power Updater', 'class', '{}', '', 1, '2022-05-21 13:15:55', '2022-06-11 16:54:51', 3, 13), (28, 1, 'Start looking here:\r\nhttps://git.vdm.dev/api/swagger#/repository/repoGetContents', 'c65aaf1f-817c-49a2-8202-282e3904f5b1', '', 'ef011ee1-64f0-4048-b013-777473b727dd', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwOw0KdXNlIEpvb21sYVxSZWdpc3RyeVxSZWdpc3RyeTs=', '', '', '{}', 'CS8qKg0KCSAqIEdldHMgdGhlIG1ldGFkYXRhIGFuZCBjb250ZW50cyAoaWYgYSBmaWxlKSBvZiBhbiBlbnRyeSBpbiBhIHJlcG9zaXRvcnksIG9yIGEgbGlzdCBvZiBlbnRyaWVzIGlmIGEgZGlyDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICRvd25lciAgICAgICBSZXBvc2l0b3J5IG93bmVyLg0KCSAqIEBwYXJhbSAgIHN0cmluZyAgJHJlcG8gICAgICAgICBSZXBvc2l0b3J5IG5hbWUuDQoJICogQHBhcmFtICAgc3RyaW5nICAkZmlsZXBhdGggICAgUmVwb3NpdG9yeSBmaWxlIHBhdGguDQoJICoNCgkgKiBAcmV0dXJuICBvYmplY3QNCgkgKg0KCSAqIEBzaW5jZSAgIDEuMA0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiBnZXQoJG93bmVyLCAkcmVwbywgJGZpbGVwYXRoKQ0KCXsNCgkJLy8gQnVpbGQgdGhlIHJlcXVlc3QgcGF0aC4NCgkJJHBhdGggPSAnL3JlcG9zLycgLiAkb3duZXIgLiAnLycgLiAkcmVwbyAuICcvY29udGVudHMvJyAuICRmaWxlcGF0aDsNCg0KCQkvLyBTZW5kIHRoZSByZXF1ZXN0Lg0KCQlyZXR1cm4gJHRoaXMtPnByb2Nlc3NSZXNwb25zZSgNCgkJCSR0aGlzLT5jbGllbnQtPmdldCgkdGhpcy0+ZmV0Y2hVcmwoJHBhdGgpKQ0KCQkpOw0KCX0NCg==', '{}', 'File', 'VDM\\Gitea\\Package.Repo.File', '1.0.0', '{}', 'Gitea Repo File', 'class', '{}', '', 1, '2022-05-21 13:40:09', '2022-07-09 10:28:20', 10, 4), diff --git a/componentbuilder.xml b/componentbuilder.xml index e86cbba2a..225f932f2 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 3rd September, 2022 + 10th September, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io -- 2.45.1 From d757e14fac5db3a078a9f85352c2b42bdabb9835 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 14 Sep 2022 17:40:02 +0200 Subject: [PATCH 11/49] Adds the initial classes needed for the new search feature. Adds the empty view for the search feature. #952 --- README.md | 8 +- admin/README.txt | 8 +- admin/access.xml | 3 + admin/assets/css/search.css | 13 + admin/controllers/ajax.json.php | 95 + admin/controllers/search.php | 42 + admin/helpers/compiler/a_Get.php | 22 +- admin/helpers/compiler/c_Fields.php | 40 +- admin/helpers/compiler/e_Interpretation.php | 16 +- admin/helpers/compiler/f_Infusion.php | 18 +- admin/helpers/componentbuilder.php | 8 + .../en-GB/en-GB.com_componentbuilder.ini | 14 + .../en-GB/en-GB.com_componentbuilder.sys.ini | 7 + admin/models/ajax.php | 80 +- admin/models/componentbuilder.php | 1 + admin/models/search.php | 165 + admin/views/search/index.html | 1 + admin/views/search/tmpl/default.php | 52 + admin/views/search/tmpl/index.html | 1 + admin/views/search/view.html.php | 150 + componentbuilder.xml | 3 +- .../src/Componentbuilder/BaseConfig.php | 131 + .../Compiler/Component/Placeholder.php | 4 +- .../src/Componentbuilder/Compiler/Config.php | 119 +- .../Component/PlaceholderInterface.php | 2 +- .../Componentbuilder/Compiler/Registry.php | 78 +- .../Compiler/Utilities/Path.php | 4 +- .../src/Componentbuilder/Search/Agent.php | 170 + .../Componentbuilder/Search/Agent/Find.php | 180 + .../Componentbuilder/Search/Agent/Replace.php | 181 + .../Componentbuilder/Search/Agent/Search.php | 74 + .../Componentbuilder/Search/Agent/Update.php | 74 + .../Componentbuilder/Search/Agent/index.html | 1 + .../src/Componentbuilder/Search/Config.php | 125 + .../Componentbuilder/Search/Database/Get.php | 295 ++ .../Componentbuilder/Search/Database/Set.php | 187 + .../Search/Database/index.html | 1 + .../src/Componentbuilder/Search/Factory.php | 80 + .../Search/Interfaces/FindInterface.php | 65 + .../Search/Interfaces/GetInterface.php | 60 + .../Search/Interfaces/ModelInterface.php | 71 + .../Search/Interfaces/ReplaceInterface.php | 66 + .../Search/Interfaces/SetInterface.php | 60 + .../Search/Interfaces/index.html | 1 + .../src/Componentbuilder/Search/Model.php | 160 + .../src/Componentbuilder/Search/Model/Get.php | 63 + .../src/Componentbuilder/Search/Model/Set.php | 63 + .../Componentbuilder/Search/Model/index.html | 1 + .../Componentbuilder/Search/Service/Agent.php | 142 + .../Search/Service/Database.php | 80 + .../Componentbuilder/Search/Service/Model.php | 78 + .../Search/Service/Search.php | 74 + .../Search/Service/index.html | 1 + .../src/Componentbuilder/Search/Table.php | 3026 +++++++++++++++++ .../src/Componentbuilder/Search/index.html | 1 + script.php | 2 +- site/helpers/componentbuilder.php | 3 + 57 files changed, 6293 insertions(+), 177 deletions(-) create mode 100644 admin/assets/css/search.css create mode 100644 admin/controllers/search.php create mode 100644 admin/models/search.php create mode 100644 admin/views/search/index.html create mode 100644 admin/views/search/tmpl/default.php create mode 100644 admin/views/search/tmpl/index.html create mode 100644 admin/views/search/view.html.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/BaseConfig.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Find.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Replace.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Search.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Update.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Set.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/FindInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ModelInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ReplaceInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SetInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Get.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Set.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Database.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Model.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/index.html diff --git a/README.md b/README.md index f6a473d39..20ac6437d 100644 --- a/README.md +++ b/README.md @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 10th September, 2022 ++ *Last Build*: 14th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **324186** ++ *Line count*: **330282** + *Field count*: **2002** -+ *File count*: **2125** -+ *Folder count*: **366** ++ *File count*: **2161** ++ *Folder count*: **374** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index f6a473d39..20ac6437d 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 10th September, 2022 ++ *Last Build*: 14th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **324186** ++ *Line count*: **330282** + *Field count*: **2002** -+ *File count*: **2125** -+ *Folder count*: **366** ++ *File count*: **2161** ++ *Folder count*: **374** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/access.xml b/admin/access.xml index 1e51d294b..7503798c3 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -498,6 +498,9 @@ + + + diff --git a/admin/assets/css/search.css b/admin/assets/css/search.css new file mode 100644 index 000000000..2731fc5aa --- /dev/null +++ b/admin/assets/css/search.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @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 + */ + +/* CSS Document */ + + diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 0d831e5ec..a626d5936 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -67,6 +67,8 @@ class ComponentbuilderControllerAjax extends BaseController $this->registerTask('fieldTypeProperties', 'ajax'); $this->registerTask('getFieldPropertyDesc', 'ajax'); $this->registerTask('getCodeGlueOptions', 'ajax'); + $this->registerTask('searchTable', 'ajax'); + $this->registerTask('updateTable', 'ajax'); $this->registerTask('snippetDetails', 'ajax'); $this->registerTask('setSnippetGithub', 'ajax'); $this->registerTask('getSnippets', 'ajax'); @@ -1631,6 +1633,99 @@ class ComponentbuilderControllerAjax extends BaseController } } break; + case 'searchTable': + try + { + $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); + $search_valueValue = $jinput->get('search_value', NULL, 'RAW'); + $match_caseValue = $jinput->get('match_case', 0, 'INT'); + $whole_wordValue = $jinput->get('whole_word', 0, 'INT'); + $regex_searchValue = $jinput->get('regex_search', 0, 'INT'); + $component_idValue = $jinput->get('component_id', 0, 'INT'); + if($table_nameValue && $user->id != 0 && $search_valueValue) + { + $result = $this->getModel('ajax')->searchTable($table_nameValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + } + else + { + $result = false; + } + if($callback) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback) + { + echo $callback."(".json_encode($e).");"; + } + elseif($returnRaw) + { + echo json_encode($e); + } + else + { + echo "(".json_encode($e).");"; + } + } + break; + case 'updateTable': + try + { + $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); + $search_valueValue = $jinput->get('search_value', NULL, 'RAW'); + $replace_valueValue = $jinput->get('replace_value', NULL, 'RAW'); + $match_caseValue = $jinput->get('match_case', 0, 'INT'); + $whole_wordValue = $jinput->get('whole_word', 0, 'INT'); + $regex_searchValue = $jinput->get('regex_search', 0, 'INT'); + $component_idValue = $jinput->get('component_id', 0, 'INT'); + if($table_nameValue && $user->id != 0 && $search_valueValue) + { + $result = $this->getModel('ajax')->updateTable($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + } + else + { + $result = false; + } + if($callback) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback) + { + echo $callback."(".json_encode($e).");"; + } + elseif($returnRaw) + { + echo json_encode($e); + } + else + { + echo "(".json_encode($e).");"; + } + } + break; case 'snippetDetails': try { diff --git a/admin/controllers/search.php b/admin/controllers/search.php new file mode 100644 index 000000000..041c25ecd --- /dev/null +++ b/admin/controllers/search.php @@ -0,0 +1,42 @@ + + * @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'); + +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Utilities\ArrayHelper; + +/** + * Componentbuilder Search Base Controller + */ +class ComponentbuilderControllerSearch extends BaseController +{ + public function __construct($config) + { + parent::__construct($config); + } + + public function dashboard() + { + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false)); + return; + } + + public function openCompiler() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // redirect to the libraries + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=compiler', false)); + return; + } +} diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 6e3f2769b..b8a540fed 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -1307,10 +1307,7 @@ class Get ); // load the global placeholders - if (ArrayHelper::check($this->globalPlaceholders)) - { - CFactory::_('Placeholder')->active = $this->globalPlaceholders; - } + CFactory::_('Placeholder')->active = CFactory::_('Component.Placeholder')->get(); // set component sales name $component->sales_name = StringHelper::safe( @@ -7567,7 +7564,7 @@ class Get CFactory::_('Config')->build_target = $_backup_target; CFactory::_('Config')->lang_target = $_backup_lang; $this->langPrefix = $_backup_langPrefix; - CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); + CFactory::_('Config')->lang_prefix = $_backup_langPrefix; unset( CFactory::_('Placeholder')->active[Placefix::_('Module_name')] @@ -7816,15 +7813,14 @@ class Get $plugin->official_name = ucwords( $plugin->group . ' - ' . $plugin->name ); - // set langPrefix - $this->langPrefix - = PluginHelper::safeLangPrefix( - $plugin->code_name, - $plugin->group - ); - CFactory::_('Config')->set('lang_prefix', $this->langPrefix); // set lang prefix - $plugin->lang_prefix = CFactory::_('Config')->lang_prefix; + $plugin->lang_prefix = PluginHelper::safeLangPrefix( + $plugin->code_name, + $plugin->group + ); + // set langPrefix + CFactory::_('Config')->lang_prefix = $plugin->lang_prefix; + $this->langPrefix = $plugin->lang_prefix; // set plugin class name $plugin->class_name = PluginHelper::safeClassName( diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index f158238f3..9390d8c85 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -3954,7 +3954,7 @@ class Fields extends Structure } // now build the layout if (StringHelper::check($tabName) - && $tabName != 'publishing') + && strtolower($tabName) != 'publishing') { $this->tabCounter[$nameSingleCode][(int) $field['tab']] = $tabName; @@ -5032,6 +5032,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'json', $typeName ); + // add open close method to field data + $field['store'] = 'json'; break; case 2: // BASE_SIXTY_FOUR @@ -5040,6 +5042,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'base64', $typeName ); + // add open close method to field data + $field['store'] = 'base64'; break; case 3: // BASIC_ENCRYPTION_LOCALKEY @@ -5048,6 +5052,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'basic_encryption', $typeName ); + // add open close method to field data + $field['store'] = 'basic_encryption'; break; case 4: // WHMCS_ENCRYPTION_VDMKEY (DUE REMOVAL) @@ -5056,6 +5062,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'whmcs_encryption', $typeName ); + // add open close method to field data + $field['store'] = 'whmcs_encryption'; break; case 5: // MEDIUM_ENCRYPTION_LOCALFILE @@ -5064,6 +5072,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'medium_encryption', $typeName ); + // add open close method to field data + $field['store'] = 'medium_encryption'; break; case 6: // EXPERT_MODE @@ -5096,6 +5106,8 @@ class Fields extends Structure ); // no londer add the json again (already added) $subformJsonSwitch = false; + // add open close method to field data + $field['store'] = 'json'; break; } // just a heads-up for usergroups set to multiple @@ -5286,6 +5298,22 @@ class Fields extends Structure $tabName = 'publishing'; } $this->setLayoutBuilder($nameSingleCode, $tabName, $name, $field); + + // only load fields we want to search + if ($dbSwitch && ComponentbuilderHelper::fieldCheck($typeName, 'search')) + { + // load a search array of view, field, and [encryption, type, tab] + CFactory::_('Registry')->set('all_search_fields.' . $nameSingleCode . '.' . $name, + [ + 'name' => $name, + 'type' => $typeName, + 'title' => (isset($this->titleBuilder[$nameSingleCode]) && $name === $this->titleBuilder[$nameSingleCode]) ? true : false, + 'list' => $nameListCode, + 'store' => (isset($field['store'])) ? $field['store'] : null, + 'tab_name' => $tabName + ] + ); + } } /** @@ -5384,15 +5412,9 @@ class Fields extends Structure $replace[$replacekey] = $replacevalue; } // load the global placeholders - if (ArrayHelper::check($this->globalPlaceholders)) + foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder => $gloabalValue) { - foreach ( - $this->globalPlaceholders as $globalPlaceholder => - $gloabalValue - ) - { - $replace[$globalPlaceholder] = $gloabalValue; - } + $replace[$globalPlaceholder] = $gloabalValue; } // start loading the field type $this->fileContentDynamic['customfield_' . $data['type']] = array(); diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 17c492f56..6dd1bbd61 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -24106,17 +24106,9 @@ class Interpretation extends Fields $placeholders[Placefix::_('views')] = $nameListCode; // load the global placeholders - if (ArrayHelper::check( - $this->globalPlaceholders - )) + foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder => $gloabalValue) { - foreach ( - $this->globalPlaceholders as $globalPlaceholder => - $gloabalValue - ) - { - $placeholders[$globalPlaceholder] = $gloabalValue; - } + $placeholders[$globalPlaceholder] = $gloabalValue; } $view = ''; $viewType = 0; @@ -29015,10 +29007,12 @@ function vdm_dkim() { public function getExtensionFieldsetXML(&$extension, &$fields, $dbkey = 'zz' ) { + // get global placeholders + $placeholder = CFactory::_('Component.Placeholder')->get(); // build the fieldset return $this->getFieldsetXML( $fields, $extension->lang_prefix, $extension->key, $extension->key, - $this->globalPlaceholders, $dbkey + $placeholder, $dbkey ); } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index fd9707e04..4093f1c70 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -324,17 +324,13 @@ class Infusion extends Interpretation = $this->addEmailHelper(); // load the global placeholders - if (ArrayHelper::check($this->globalPlaceholders)) + foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder => + $gloabalValue + ) { - foreach ( - $this->globalPlaceholders as $globalPlaceholder => - $gloabalValue - ) - { - $this->fileContentStatic[$globalPlaceholder] - = $gloabalValue; - } + $this->fileContentStatic[$globalPlaceholder] = $gloabalValue; } + // reset view array $viewarray = array(); $site_edit_view_array = array(); @@ -1169,6 +1165,10 @@ class Infusion extends Interpretation CFactory::_('Placeholder')->active = $this->placeholders; } + // all fields stored in database + $this->fileContentStatic[Placefix::_h('ARRAY_ALL_SEARCH_FIELDS')] = + CFactory::_('Registry')->varExport('all_search_fields', 1); + // setup the layouts $this->setCustomViewLayouts(); diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 28d69846d..780981212 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -3550,6 +3550,9 @@ abstract class ComponentbuilderHelper ), 'special' => array( 'contentlanguage', 'moduleposition', 'plugin', 'repeatable', 'subform' + ), + 'search' => array( + 'editor', 'email', 'tel', 'text', 'textarea', 'url', 'subform' ) ); @@ -6318,6 +6321,11 @@ abstract class ComponentbuilderHelper { JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_COMPILER'), 'index.php?option=com_componentbuilder&view=compiler', $submenu === 'compiler'); } + // Access control (search.submenu). + if ($user->authorise('search.submenu', 'com_componentbuilder')) + { + JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SEARCH'), 'index.php?option=com_componentbuilder&view=search', $submenu === 'search'); + } if ($user->authorise('joomla_component.access', 'com_componentbuilder') && $user->authorise('joomla_component.submenu', 'com_componentbuilder')) { JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS'), 'index.php?option=com_componentbuilder&view=joomla_components', $submenu === 'joomla_components'); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 5556dee6f..5d19974ee 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1292,6 +1292,7 @@ COM_COMPONENTBUILDER_AJAX="Ajax" COM_COMPONENTBUILDER_ALIAS="Alias" COM_COMPONENTBUILDER_ALIGNMENT="Alignment" COM_COMPONENTBUILDER_ALL="All" +COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED="All found instances in %s where replaced" COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter." COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME="All is good, there is no notice at this time." COM_COMPONENTBUILDER_ALL_OF_THESE_PACKAGES_ARE_A_FULLY_DEVELOPEDMAPPED_COMPONENTS_FOR_JCB_THEY_CAN_BE_SEEN_AS_DEMO_CONTENT_OR_BASE_IMAGES_FROM_WHICH_TO_START_YOUR_PROJECTBR_ALWAYS_MAKE_SURE_YOU_ARE_ON_THE_LATEST_VERSION_OF_JCB_BEFORE_IMPORTING_ANY_OF_THESE_PACKAGES_SHOULD_ANY_OF_THEM_FAIL_TO_IMPORT_A_S_PLEASE_LET_US_KNOWA="All of these packages are a fully developed/mapped components for JCB. They can be seen as demo content, or base images from which to start your project.
    Always make sure you are on the latest version of JCB before importing any of these packages, should any of them fail to import please let us know." @@ -7759,6 +7760,7 @@ COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)" COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)" COM_COMPONENTBUILDER_MODULE="Module" COM_COMPONENTBUILDER_MODULES="Modules" +COM_COMPONENTBUILDER_MORE_SOON="More soon" COM_COMPONENTBUILDER_MOVE="Move" COM_COMPONENTBUILDER_NAME="Name" COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)" @@ -7789,6 +7791,7 @@ COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cr COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND="No description found." COM_COMPONENTBUILDER_NO_FILES_LINKED="No Files Linked" COM_COMPONENTBUILDER_NO_FOUND="No Found" +COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S="No instances where found %s" COM_COMPONENTBUILDER_NO_ITEM_FOUND="No Item Found" COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="No keys were found. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key." COM_COMPONENTBUILDER_NO_LANGUAGES_FOUND="No Languages Found" @@ -8138,7 +8141,15 @@ COM_COMPONENTBUILDER_RUN_EXPANSION="Run Expansion" COM_COMPONENTBUILDER_SAVE_SUCCESS="Great! Item successfully saved." COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select another." COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S="%s
    You can add a gitHub Access Token to Componentbuilder global options to make authenticated requests to gitHub. An access token with only public access will do to retrieve %s." +COM_COMPONENTBUILDER_SEARCH="Search" COM_COMPONENTBUILDER_SEARCHABLE="Searchable" +COM_COMPONENTBUILDER_SEARCH_ACCESS="Search Access" +COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC="Allows the users in this group to access search." +COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS="Search Compiler Button Access" +COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC="Allows the users in this group to access the compiler button." +COM_COMPONENTBUILDER_SEARCH_DESC="JCB Search" +COM_COMPONENTBUILDER_SEARCH_SUBMENU="Search Submenu" +COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC="Allows the users in this group to submenu of Search" COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO="See All Import Info" COM_COMPONENTBUILDER_SELECTION="selection" COM_COMPONENTBUILDER_SELECT_ADMIN_VIEW="Select Admin View" @@ -8957,6 +8968,7 @@ COM_COMPONENTBUILDER_SUBMENU_LAYOUTS="Layouts" COM_COMPONENTBUILDER_SUBMENU_LIBRARIES="Libraries" COM_COMPONENTBUILDER_SUBMENU_PLACEHOLDERS="Placeholders" COM_COMPONENTBUILDER_SUBMENU_POWERS="Powers" +COM_COMPONENTBUILDER_SUBMENU_SEARCH="Search" COM_COMPONENTBUILDER_SUBMENU_SERVERS="Servers" COM_COMPONENTBUILDER_SUBMENU_SITE_VIEWS="Site Views" COM_COMPONENTBUILDER_SUBMENU_SNIPPETS="Snippets" @@ -9100,6 +9112,7 @@ COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME="There are no new sn COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME="There are no out of date snippets at this time" COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME="There are no snippets to update at this time" COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_IF_THIS_CONTINUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR_OF_A_TYPE_ERROR_IN_THE_FIELDS_DISPLAY_REQUEST="There has been an error, if this continues please inform your system administrator of a type error in the fields display request!" +COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN="There has been an error please try again" COM_COMPONENTBUILDER_THERE_WAS_AN_ERROR_GETTING_THE_PACKAGE_INFO="There was an error getting the package info." COM_COMPONENTBUILDER_THERE_WAS_A_PROBLEM_BNO_VIEW_OR_ID_FOUND_IN_SESSION_OR_VIEW_NOT_ALLOWED_TO_ACCESS_AREAB_WE_COULD_NOT_LOAD_ANY_LINKED_TO_VALUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR="There was a problem, no view or id found in session or view not allowed to access area, we could not load any linked to values. Please inform your system administrator!" COM_COMPONENTBUILDER_THESE_ARE_THE_SAME_PACKAGES_FOUND_ON_A_S_GITHUBA_AND_CAN_BE_IMPORTED_BY_SIMPLY_MAKING_A_SELECTION_AND_THEN_CLICKING_THE_BGET_PACKAGEB_BUTTONBR_SOME_OF_THESE_PACKAGES_WOULD_REQUIRE_A_KEY_SINCE_THEY_ARE_NOT_FREE="These are the same packages found on gitHub and can be imported by simply making a selection and then clicking the [Get Package] button.
    Some of these packages would require a key, since they are not free." @@ -9358,6 +9371,7 @@ COM_COMPONENTBUILDER_WEBSITE_S="Website: %s" COM_COMPONENTBUILDER_WE_DID_NOT_CHECK_THE_SNIPPET_IT_SELF_TO_SEE_IF_IT_CHANGED_WE_ONLY_WORK_ON_DATES="We did not check the snippet it self, to see if it changed. We only work on dates." COM_COMPONENTBUILDER_WE_FAILED_TO_MOVE_BSB="We failed to move %s!" COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS="We found dynamic code all in one line, and ignored it! Please review (%s) for more details!" +COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S="We found some instances in %s" COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved %s!" COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION="While we download all 26 compiler GIF animations randomly used in the compiler GUI during compilation" COM_COMPONENTBUILDER_WIKI="Wiki" diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index 4e7b3ff77..34b9d4815 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -963,6 +963,7 @@ COM_COMPONENTBUILDER_MENU_LAYOUTS="Layouts" COM_COMPONENTBUILDER_MENU_LIBRARIES="Libraries" COM_COMPONENTBUILDER_MENU_PLACEHOLDERS="Placeholders" COM_COMPONENTBUILDER_MENU_POWERS="Powers" +COM_COMPONENTBUILDER_MENU_SEARCH="Search" COM_COMPONENTBUILDER_MENU_SITE_VIEWS="Site Views" COM_COMPONENTBUILDER_MENU_SNIPPETS="Snippets" COM_COMPONENTBUILDER_MENU_TEMPLATES="Templates" @@ -1017,6 +1018,12 @@ COM_COMPONENTBUILDER_POWERS_SUBMENU="Powers Submenu" COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power" COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS="Power Run Expansion Button Access" COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." +COM_COMPONENTBUILDER_SEARCH_ACCESS="Search Access" +COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC="Allows the users in this group to access search." +COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS="Search Compiler Button Access" +COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC="Allows the users in this group to access the compiler button." +COM_COMPONENTBUILDER_SEARCH_SUBMENU="Search Submenu" +COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC="Allows the users in this group to submenu of Search" COM_COMPONENTBUILDER_SERVERS_ACCESS="Servers Access" COM_COMPONENTBUILDER_SERVERS_ACCESS_DESC="Allows the users in this group to access access servers" COM_COMPONENTBUILDER_SERVERS_BATCH_USE="Servers Batch Use" diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 86ab41226..9c3ce9a3e 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Model\ListModel; use Joomla\Utilities\ArrayHelper; -use Joomla\Registry\Registry; -use VDM\Gitea\Gitea; + +use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; /** * Componentbuilder Ajax List Model @@ -3604,6 +3604,82 @@ class ComponentbuilderModelAjax extends ListModel return false; } + // Used in search + /** + * Search for value in a table + * + * @param string $tableName The main table to search + * @param string $searchValue The value to search for + * @param int $matchCase The switch to control match case + * @param int $wholeWord The switch to control whole word + * @param int $regexSearch The switch to control regex search + * @param int $componentId The option to filter by component + * + * @return array|null + * @since 3.2.0 + **/ + public function searchTable(string $tableName, string $searchValue, + int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array + { + // check if this is a valid table + if (SearchFactory('Table')->exist($tableName)) + { + // load the configurations + SearchFactory('Config')->table_name = $tableName; + SearchFactory('Config')->search_value = $searchValue; + SearchFactory('Config')->match_case = $matchCase; + SearchFactory('Config')->whole_word = $wholeWord; + SearchFactory('Config')->regex_search = $regexSearch; + SearchFactory('Config')->component_id = $componentId; + + if (($items = SearchFactory('Agent')->find()) !== null) + { + return ['success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), 'items' => $items]; + } + + return ['success' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S', $tableName)]; + } + + return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')]; + } + + /** + * Search and replace value in a table + * + * @param string $tableName The main table to search + * @param string $searchValue The value to search for + * @param string|null $replaceValue The value to replace search value + * @param int $matchCase The switch to control match case + * @param int $wholeWord The switch to control whole word + * @param int $regexSearch The switch to control regex search + * @param int $componentId The option to filter by component + * + * @return array|null + * @since 3.2.0 + **/ + public function updateTable(string $tableName, string $searchValue, ?string $replaceValue = null, + int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array + { + // check if this is a valid table + if (SearchFactory('Table')->exist($tableName)) + { + // load the configurations + SearchFactory('Config')->table_name = $tableName; + SearchFactory('Config')->search_value = $searchValue; + SearchFactory('Config')->replace_value = $replaceValue; + SearchFactory('Config')->match_case = $matchCase; + SearchFactory('Config')->whole_word = $wholeWord; + SearchFactory('Config')->regex_search = $regexSearch; + SearchFactory('Config')->component_id = $componentId; + + SearchFactory('Agent')->replace(); + + return ['success' => JText::sprintf('COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED', $tableName)]; + } + return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')]; + } + + // Used in get_snippets public function getSnippets($libraries) diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index 32bfb2260..59cf8a907 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -36,6 +36,7 @@ class ComponentbuilderModelComponentbuilder extends ListModel $viewAccess = array( 'compiler.submenu' => 'compiler.submenu', 'compiler.dashboard_list' => 'compiler.dashboard_list', + 'search.submenu' => 'search.submenu', 'get_snippets.submenu' => 'get_snippets.submenu', 'get_snippets.dashboard_list' => 'get_snippets.dashboard_list', 'joomla_component.create' => 'joomla_component.create', diff --git a/admin/models/search.php b/admin/models/search.php new file mode 100644 index 000000000..560080af6 --- /dev/null +++ b/admin/models/search.php @@ -0,0 +1,165 @@ + + * @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'); + +use Joomla\CMS\MVC\Model\ItemModel; +use Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; + +/** + * Componentbuilder Search Item Model + */ +class ComponentbuilderModelSearch extends ItemModel +{ + /** + * Model context string. + * + * @var string + */ + protected $_context = 'com_componentbuilder.search'; + + /** + * Model user data. + * + * @var strings + */ + protected $user; + protected $userId; + protected $guest; + protected $groups; + protected $levels; + protected $app; + protected $input; + protected $uikitComp; + + /** + * @var object item + */ + protected $item; + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @since 1.6 + * + * @return void + */ + protected function populateState() + { + $this->app = JFactory::getApplication(); + $this->input = $this->app->input; + // Get the item main id + $id = $this->input->getInt('id', null); + $this->setState('search.id', $id); + + // Load the parameters. + parent::populateState(); + } + + /** + * Method to get article data. + * + * @param integer $pk The id of the article. + * + * @return mixed Menu item data object on success, false on failure. + */ + public function getItem($pk = null) + { + $this->user = JFactory::getUser(); + // check if this user has permission to access item + if (!$this->user->authorise('search.access', 'com_componentbuilder')) + { + $app = JFactory::getApplication(); + $app->enqueueMessage(JText::_('Not authorised!'), 'error'); + // redirect away if not a correct to cPanel/default view + $app->redirect('index.php?option=com_componentbuilder'); + return false; + } + $this->userId = $this->user->get('id'); + $this->guest = $this->user->get('guest'); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->levels = $this->user->getAuthorisedViewLevels(); + $this->initSet = true; + + $pk = (!empty($pk)) ? $pk : (int) $this->getState('search.id'); + + $pk = $this->userId; + + if ($this->_item === null) + { + $this->_item = array(); + } + + if (!isset($this->_item[$pk])) + { + try + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Get data + // load the tables and components (soon) + $data = ['tables' => SearchFactory::_('Table')->tables(), 'components' => null]; + + + if (empty($data)) + { + $app = JFactory::getApplication(); + // If no data is found redirect to default page and show warning. + $app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_NOT_FOUND_OR_ACCESS_DENIED'), 'warning'); + $app->redirect('index.php?option=com_componentbuilder'); + return false; + } + + // set data object to item. + $this->_item[$pk] = $data; + } + catch (Exception $e) + { + if ($e->getCode() == 404) + { + // Need to go thru the error handler to allow Redirect to work. + JError::raiseWarning(404, $e->getMessage()); + } + else + { + $this->setError($e); + $this->_item[$pk] = false; + } + } + } + + return $this->_item[$pk]; + } + + /** + * Get the uikit needed components + * + * @return mixed An array of objects on success. + * + */ + public function getUikitComp() + { + if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp)) + { + return $this->uikitComp; + } + return false; + } +} diff --git a/admin/views/search/index.html b/admin/views/search/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/search/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/search/tmpl/default.php b/admin/views/search/tmpl/default.php new file mode 100644 index 000000000..d28ecae59 --- /dev/null +++ b/admin/views/search/tmpl/default.php @@ -0,0 +1,52 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.formvalidator'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +?> +canDo->get('search.access')): ?> + +item->id)) ? '&id='. (int) $this->item->id : ''; ?> +
    + +sidebar)): ?> +
    + sidebar; ?> +
    +
    + +
    + + +
    + + + + +

    + + diff --git a/admin/views/search/tmpl/index.html b/admin/views/search/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/search/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/search/view.html.php b/admin/views/search/view.html.php new file mode 100644 index 000000000..551d3d701 --- /dev/null +++ b/admin/views/search/view.html.php @@ -0,0 +1,150 @@ + + * @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'); + +use Joomla\CMS\MVC\View\HtmlView; + +/** + * Componentbuilder Html View class for the Search + */ +class ComponentbuilderViewSearch extends HtmlView +{ + // Overwriting JView display method + function display($tpl = null) + { + // get component params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // get the application + $this->app = JFactory::getApplication(); + // get the user object + $this->user = JFactory::getUser(); + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('search'); + // Initialise variables. + $this->item = $this->get('Item'); + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('search'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=search'); + $this->sidebar = JHtmlSidebar::render(); + } + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + // add the tool bar + $this->addToolBar(); + } + + // set the document + $this->setDocument(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode(PHP_EOL, $errors), 500); + } + + parent::display($tpl); + } + + /** + * Prepares the document + */ + protected function setDocument() + { + + // always make sure jquery is loaded. + JHtml::_('jquery.framework'); + // Load the header checker class. + require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' ); + // Initialize the header checker. + $HeaderCheck = new componentbuilderHeaderCheck; + + // Load uikit options. + $uikit = $this->params->get('uikit_load'); + // Set script size. + $size = $this->params->get('uikit_min'); + // Set css style. + $style = $this->params->get('uikit_style'); + + // The uikit css. + if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) + { + JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); + } + // The uikit js. + if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) + { + JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); + } + // add the document default css file + $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/search.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + // hide the main menu + $this->app->input->set('hidemainmenu', true); + // set the title + if (isset($this->item->name) && $this->item->name) + { + $title = $this->item->name; + } + // Check for empty title and add view name if param is set + if (empty($title)) + { + $title = JText::_('COM_COMPONENTBUILDER_SEARCH'); + } + // add title to the page + JToolbarHelper::title($title,'search'); + // add cpanel button + JToolBarHelper::custom('search.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); + if ($this->canDo->get('search.compiler')) + { + // add Compiler button. + JToolBarHelper::custom('search.openCompiler', 'cogs custom-button-opencompiler', '', 'COM_COMPONENTBUILDER_COMPILER', false); + } + + // set help url for this view if found + $this->help_url = ComponentbuilderHelper::getHelpUrl('search'); + if (ComponentbuilderHelper::checkString($this->help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } +} +?> diff --git a/componentbuilder.xml b/componentbuilder.xml index 225f932f2..522cc8fa3 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 10th September, 2022 + 14th September, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io @@ -74,6 +74,7 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo COM_COMPONENTBUILDER_MENU_COMPILER + COM_COMPONENTBUILDER_MENU_SEARCH COM_COMPONENTBUILDER_MENU_JOOMLA_COMPONENTS COM_COMPONENTBUILDER_MENU_JOOMLA_MODULES COM_COMPONENTBUILDER_MENU_JOOMLA_PLUGINS diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/BaseConfig.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/BaseConfig.php new file mode 100644 index 000000000..596296a9f --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/BaseConfig.php @@ -0,0 +1,131 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder; + + +use Joomla\Registry\Registry; +use Joomla\CMS\Factory; +use Joomla\Input\Input; +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; + + +/** + * Configurations + * + * @since 3.2.0 + */ +abstract class BaseConfig extends Registry +{ + /** + * Hold a JInput object for easier access to the input variables. + * + * @var Input + * @since 3.2.0 + */ + protected $input; + + /** + * The Params + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $params; + + /** + * Constructor + * + * @param Input|null $input Input + * @param Registry|null $params The component parameters + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Input $input = null, ?Registry $params = null) + { + $this->input = $input ?: Factory::getApplication()->input; + $this->params = $params ?: Helper::getParams('com_componentbuilder'); + + // use underscore as the separator + $this->separator = '_'; + + // Instantiate the internal data object. + $this->data = new \stdClass(); + } + + /** + * setting any config value + * + * @param String $key The value's key/path name + * @param mixed $value Optional default value, returned if the internal value is null. + * + * @since 3.2.0 + */ + public function __set($key, $value) + { + $this->set($key, $value); + } + + /** + * getting any valid value + * + * @param String $key The value's key/path name + * + * @since 3.2.0 + * @throws \InvalidArgumentException If $key is not a valid function name. + */ + public function __get($key) + { + // check if it has been set + if (($value = $this->get($key, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') + { + return $value; + } + + throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function [%s], or path.', $key, $method)); + } + + /** + * Get a config value. + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * @param mixed $default Optional default value, returned if the internal value is null. + * + * @return mixed Value of entry or null + * + * @since 3.2.0 + */ + public function get($path, $default = null) + { + // function name with no underscores + $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $path))); + + // check if it has been set + if (($value = parent::get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') + { + return $value; + } + elseif (method_exists($this, $method)) + { + $value = $this->{$method}(); + + $this->set($path, $value); + + return $value; + } + + return $default; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php index 7cd6a1281..69552cc9a 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php @@ -71,11 +71,11 @@ class Placeholder implements PlaceholderInterface /** * get all System Placeholders * - * @return array The global placeholders + * @return array The global placeholders * * @since 3.2.0 */ - public function get() + public function get(): array { // set only once if (is_array($this->placeholders)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php index c1c5a3f05..340a58df5 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -12,13 +12,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler; -use Joomla\Registry\Registry; -use Joomla\CMS\Factory; -use Joomla\Input\Input; -use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Componentbuilder\BaseConfig; /** @@ -26,119 +22,8 @@ use VDM\Joomla\Utilities\String\ClassfunctionHelper; * * @since 3.2.0 */ -class Config extends Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable +class Config extends BaseConfig { - /** - * Hold a JInput object for easier access to the input variables. - * - * @var Input - * @since 3.2.0 - */ - protected $input; - - /** - * The Params - * - * @var Registry - * @since 3.2.0 - */ - protected Registry $params; - - /** - * Constructor - * - * @param Input|null $input Input - * @param Registry|null $params The component parameters - * - * @throws \Exception - * @since 3.2.0 - */ - public function __construct(?Input $input = null, ?Registry $params = null) - { - $this->input = $input ?: Factory::getApplication()->input; - $this->params = $params ?: Helper::getParams('com_componentbuilder'); - - // use underscore as the separator - $this->separator = '_'; - - // Instantiate the internal data object. - $this->data = new \stdClass(); - } - - /** - * setting any config value - * - * @param String $key The value's key/path name - * @param mixed $value Optional default value, returned if the internal value is null. - * - * @since 3.2.0 - */ - public function __set($key, $value) - { - $this->set($key, $value); - } - - /** - * getting any valid value - * - * @param String $key The value's key/path name - * - * @since 3.2.0 - * @throws \InvalidArgumentException If $key is not a valid function name. - */ - public function __get($key) - { - // function name with no underscores - $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $key))); - - if (($value = $this->get($key, '__N0T_S3T_')) !== '__N0T_S3T_') - { - return $value; - } - elseif (method_exists($this, $method)) - { - $value = $this->{$method}(); - - $this->set($key, $value); - - return $value; - } - - throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function [%s], or path.', $key, $method)); - } - - /** - * Get a registry value. - * - * @param string $path Registry path (e.g. joomla.content.showauthor) - * @param mixed $default Optional default value, returned if the internal value is null. - * - * @return mixed Value of entry or null - * - * @since 3.2.0 - */ - public function get($path, $default = null) - { - // function name with no underscores - $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $path))); - - // check if it has been set - if (($value = parent::get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') - { - return $value; - } - elseif (method_exists($this, $method)) - { - $value = $this->{$method}(); - - $this->set($path, $value); - - return $value; - } - - return $default; - } - /** * get posted component id * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php index c90737faa..062d30449 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php @@ -26,6 +26,6 @@ interface PlaceholderInterface * * @since 3.2.0 */ - public function get(); + public function get(): array; } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php index 5e188777d..484e49e70 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php @@ -13,6 +13,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler; use Joomla\Registry\Registry as JoomlaRegistry; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; /** @@ -24,6 +25,14 @@ use Joomla\Registry\Registry as JoomlaRegistry; */ class Registry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable { + /** + * Default indentation value + * + * @var int + * @since 1.0 + */ + protected $indent = 2; + /** * Method to iterate over any part of the registry * @@ -43,6 +52,73 @@ class Registry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess } return $data->getIterator(); - } + } + + /** + * Method to export a set of values to a PHP array + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * @param int $default The default indentation + * + * @return ?string The var set being exported as a PHP array + * + * @since 3.4.0 + */ + public function varExport(string $path, int $default = 2): ?string + { + // check if we have data + if (($data = $this->extract($path)) !== null) + { + // set the default indentation value + $this->indent = $default; + + // convert to array + $data = $data->toArray(); + + // convert to string + $data = var_export($data, true); + + // replace all space with system indentation + $data = preg_replace_callback("/^(\s{2})(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(.*)/m", [$this, 'convertIndent'], $data); + + // convert all array to [] + $array = preg_split("/\r\n|\n|\r/", $data); + $array = preg_replace(["/\s*array\s\($/", "/\)(,)?$/", "/\s=>\s$/"], [NULL, ']$1', ' => ['], $array); + $data = join(PHP_EOL, array_filter(["["] + $array)); + + // add needed indentation to the last ] + $data = preg_replace("/^(\])/m", Indent::_($default) . '$1', $data); + + return $data; + } + return null; + } + + /** + * Method to convert found of grouped spaces to system indentation + * + * @param array $matches The regex array of matching values + * + * @return string The resulting string. + * + * @since 3.4.0 + */ + protected function convertIndent(array $matches): string + { + // set number to indent by default + $indent = Indent::_($this->indent); + + // update each found space (group) with one indentation + foreach (range(1, 11) as $space) + { + if (strlen($matches[$space]) > 0) + { + $indent .= Indent::_(1); + } + } + + return $indent . $matches[12]; + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php index 3182fa113..32a6edc76 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php @@ -44,9 +44,9 @@ abstract class Path { foreach ($targets as $target) { - if (isset($values[$target]) && strpos($values[$target], '\\') !== false) + if (isset($values[$target])) { - $values[$target] = str_replace('\\', '/', $values[$target]); + self::fix($values[$target], $targets); } } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php new file mode 100644 index 000000000..34a5b8c5b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php @@ -0,0 +1,170 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Database\Get; +use VDM\Joomla\Componentbuilder\Search\Database\Set; +use VDM\Joomla\Componentbuilder\Search\Agent\Find; +use VDM\Joomla\Componentbuilder\Search\Agent\Replace; +use VDM\Joomla\Componentbuilder\Search\Agent\Search; + + +/** + * Search Agent + * + * @since 3.2.0 + */ +class Agent +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Get Database + * + * @var Get + * @since 3.2.0 + */ + protected Get $get; + + /** + * Search Set Database + * + * @var Set + * @since 3.2.0 + */ + protected Set $set; + + /** + * Search Find + * + * @var Find + * @since 3.2.0 + */ + protected Find $find; + + /** + * Search Replace + * + * @var Replace + * @since 3.2.0 + */ + protected Replace $replace; + + /** + * Search + * + * @var Search + * @since 3.2.0 + */ + protected Search $search; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Get|null $get The search get database object. + * @param Set|null $set The search get database object. + * @param Find|null $find The search find object. + * @param Replace|null $replace The search replace object. + * @param Search|null $search The search object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Get $get = null, + ?Set$set = null, ?Find $find = null, ?Replace $replace = null, + ?Search $search = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->get = $get ?: Factory::_('Get.Database'); + $this->set = $set ?: Factory::_('Set.Database'); + $this->find = $find ?: Factory::_('Agent.Find'); + $this->replace = $replace ?: Factory::_('Agent.Replace'); + $this->search = $search ?: Factory::_('Agent.Search'); + } + + /** + * Search the posted table for the search value and return all + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function find(?string $table = null): ?array + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + $set = 1; + + // continue loading items until all are searched + while(($items = $this->get->items($table, $set)) !== null) + { + $this->find->items($items, $table); + $set++; + } + + return $this->search->found($table); + } + + /** + * Search the posted table for the search value, and replace all + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function replace(?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + $set = 1; + + // continue loading items until all was loaded + while(($items = $this->get->items($table, $set)) !== null) + { + // search for items + $this->find->items($items, $table); + + // update those found + $this->replace->items($this->find->get($table), $table); + + // update the database + $this->set->items($this->replace->get($table), $table); + + // reset found items + $this->find->reset($table); + $this->replace->reset($table); + + $set++; + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Find.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Find.php new file mode 100644 index 000000000..9c3e4d5fd --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Find.php @@ -0,0 +1,180 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Agent\Search; +use VDM\Joomla\Componentbuilder\Search\Interfaces\FindInterface; + + +/** + * Search Agent Find + * + * @since 3.2.0 + */ +class Find implements FindInterface +{ + /** + * Found Values + * + * @var array + * @since 3.2.0 + */ + protected array $found = []; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search + * + * @var Search + * @since 3.2.0 + */ + protected Search $search; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Search|null $search The search object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Search $search = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->search = $search ?: Factory::_('Agent.Search'); + } + + /** + * Get found values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (isset($this->found[$table])) + { + return $this->found[$table]; + } + + return null; + } + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // set the item id + if (empty($id)) + { + $id = $item->id; + } + + if (ObjectHelper::check($item)) + { + foreach ($item as $field => $value) + { + if ($field !== 'id' && $this->search->value($value, $id, $field, $table)) + { + if (empty($this->found[$table][$id])) + { + $this->found[$table][$id] = new \stdClass(); + $this->found[$table][$id]->id = $id; + } + $this->found[$table][$id]->{$field} = $value; + } + } + } + } + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (ArrayHelper::check($items)) + { + foreach ($items as $id => $item) + { + $this->item($item, $id, $table); + } + } + } + + /** + * Reset all found values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // empty or unset the table active values + unset($this->found[$table]); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Replace.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Replace.php new file mode 100644 index 000000000..c0de189bf --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Replace.php @@ -0,0 +1,181 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Agent\Update; +use VDM\Joomla\Componentbuilder\Search\Interfaces\ReplaceInterface; + + +/** + * Search Agent Replace + * + * @since 3.2.0 + */ +class Replace implements ReplaceInterface +{ + /** + * Updated Values + * + * @var array + * @since 3.2.0 + */ + protected array $updated = []; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Update + * + * @var Update + * @since 3.2.0 + */ + protected Update $update; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Update|null $update The update object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Update $update = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->update = $update ?: Factory::_('Agent.Update'); + } + + /** + * Get updated values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (isset($this->updated[$table])) + { + return $this->updated[$table]; + } + + return null; + } + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // set the item id + if (empty($id)) + { + $id = $item->id; + } + + if (ObjectHelper::check($item)) + { + foreach ($item as $field => $value) + { + if ($field !== 'id' && ($_value = $this->update->value($value, $id, $field, $table)) !== null) + { + if (empty($this->updated[$table][$id])) + { + $this->updated[$table][$id] = new \stdClass(); + $this->updated[$table][$id]->id = $id; + } + // add updated value + $this->updated[$table][$id]->{$field} = $_value; + } + } + } + } + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (ArrayHelper::check($items)) + { + foreach ($items as $id => $item) + { + $this->item($item, $id, $table); + } + } + } + + /** + * Reset all updated values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // empty or unset the table active values + unset($this->updated[$table]); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Search.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Search.php new file mode 100644 index 000000000..3aac163b5 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Search.php @@ -0,0 +1,74 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; + + +/** + * Search Agent Search + * + * @since 3.2.0 + */ +class Search +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + } + + /** + * Search inside a value + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function value($value, int $id, string $field, ?string $table = null): bool + { + return true; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Update.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Update.php new file mode 100644 index 000000000..b253e4bbd --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Update.php @@ -0,0 +1,74 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; + + +/** + * Search Agent Update + * + * @since 3.2.0 + */ +class Update +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + } + + /** + * Update value + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, int $id, string $field, ?string $table = null) + { + return $value; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php new file mode 100644 index 000000000..83e423980 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php @@ -0,0 +1,125 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\BaseConfig; + + +/** + * Search Configurations + * + * @since 3.2.0 + */ +class Config extends BaseConfig +{ + /** + * get posted search value + * + * @return string Raw search value + * @since 3.2.0 + */ + protected function getSearchvalue(): string + { + return $this->input->post->get('search_value', null, 'RAW'); + } + + /** + * get posted replace value + * + * @return string Raw replace value + * @since 3.2.0 + */ + protected function getReplacevalue(): string + { + return $this->input->post->get('replace_value', null, 'RAW'); + } + + /** + * get posted search match case + * + * @return int Match case + * @since 3.2.0 + */ + protected function getMatchcase(): int + { + return $this->input->post->get('match_case', 0, 'INT'); + } + + /** + * get posted search whole word + * + * @return int Whole word + * @since 3.2.0 + */ + protected function getWholeword(): int + { + return $this->input->post->get('whole_word', 0, 'INT'); + } + + /** + * get posted search regex + * + * @return int Regex + * @since 3.2.0 + */ + protected function getRegex(): int + { + return $this->input->post->get('regex_search', 0, 'INT'); + } + + /** + * get posted component + * + * @return int Component ID + * @since 3.2.0 + */ + protected function getComponentid(): int + { + return $this->input->post->get('component_id', 0, 'INT'); + } + + /** + * get posted area/table + * + * @return string Table name + * @since 3.2.0 + */ + protected function getTablename(): string + { + return $this->input->post->get('table_name', null, 'word'); + } + + /** + * get posted field + * + * @return string Field name + * @since 3.2.0 + */ + protected function getFieldname(): string + { + return $this->input->post->get('field_name', null, 'word'); + } + + /** + * get posted item id + * + * @return int Item id + * @since 3.2.0 + */ + protected function getItemid(): int + { + return $this->input->post->get('item_id', 0, 'INT'); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php new file mode 100644 index 000000000..d84927f53 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php @@ -0,0 +1,295 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Database; + + +use Joomla\CMS\Factory as JoomlaFactory; +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; +use VDM\Joomla\Componentbuilder\Search\Model\Get as Model; +use VDM\Joomla\Componentbuilder\Search\Interfaces\GetInterface; + + +/** + * Search Database Get + * + * @since 3.2.0 + */ +class Get implements GetInterface +{ + /** + * Bundle Size + * + * @var int + * @since 3.2.0 + */ + protected int $bundle = 300; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Search Model + * + * @var Model + * @since 3.2.0 + */ + protected Model $model; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * @param Model|null $model The search get model object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null, + ?Model $model = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + $this->model = $model ?: Factory::_('Get.Model'); + $this->db = $db ?: JoomlaFactory::getDbo(); + } + + /** + * Get values from a given table + * Example: $this->value(23, 'value_key', 'table_name'); + * + * @param string $field The field key + * @param int $id The item ID + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value(string $field, int $id, string $table = null) + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid field and table + if ($id > 0 && ($name = $this->table->get($table, $field, 'name')) !== null) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Order it by the ordering field. + $query->select($name); + $query->from($this->db->quoteName('#__componentbuilder_' . $table)); + + // get by id + $query->where($this->db->quoteName('id') . " = " . $id); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + + // check if we have any values + if ($this->db->getNumRows()) + { + // return found values + return $this->model->value($this->db->loadResult(), $name, $table); + } + } + return null; + } + + /** + * Get values from a given table + * Example: $this->item(23, 'table_name'); + * + * @param int $id The item ID + * @param string| null $table The table + * + * @return object|null + * @since 3.2.0 + */ + public function item(int $id, string $table = null): ?object + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if ($id > 0 && ($fields = $this->table->fields($table)) !== null) + { + // add the ID + array_unshift($fields , 'id'); + + // Create a new query object. + $query = $this->db->getQuery(true); + + // Order it by the ordering field. + $query->select($this->db->quoteName($fields)); + $query->from($this->db->quoteName('#__componentbuilder_' . $table)); + + // get by id + $query->where($this->db->quoteName('id') . " = " . $id); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + + // check if we have any values + if ($this->db->getNumRows()) + { + // return found values + return $this->model->item($this->db->loadObject(), $table); + } + } + return null; + } + + /** + * Get values from a given table + * Example: $this->items('table_name'); + * + * @param string|null $table The table + * @param int $bundle The bundle to return (0 = all) + * + * @return array|null + * @since 3.2.0 + */ + public function items(string $table = null, int $bundle = 0): ?array + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($fields = $this->table->fields($table)) !== null) + { + // add the ID + array_unshift($fields , 'id'); + + // get the title value + $title = $this->table->titleName($table); + + // Create a new query object. + $query = $this->db->getQuery(true); + + // Order it by the ordering field. + $query->select($this->db->quoteName($fields)); + $query->from($this->db->quoteName('#__componentbuilder_' . $table)); + $query->order($title .' ASC'); + + // add limitation and pagination + if ($bundle > 0) + { + // get the incremental number + $query->where($this->db->quoteName('id') . " >= " . $this->next($table, $bundle)); + + // only return a limited number + $query->setLimit($this->bundle); + } + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + + // check if we have any values + if ($this->db->getNumRows()) + { + // return found values + return $this->model->items($this->db->loadObjectList('id'), $table); + } + } + return null; + } + + /** + * Get next id to call + * + * @param string $table The table + * @param int $bundle The bundle to return + * + * @return int + * @since 3.2.0 + */ + protected function next(string $table, int $bundle): int + { + if ($bundle == 1 || $bundle == 0) + { + return 1; + } + + if (($number = $this->model->last($table)) !== null) + { + return $number + 1; + } + + return $this->incremental($bundle); + } + + /** + * Get Incremental number where the set starts + * + * @param int $bundle The bundle to return + * + * @return int + * @since 3.2.0 + */ + protected function incremental(int $bundle): int + { + // just in case + if ($bundle == 1 || $bundle == 0) + { + return 1; + } + + /** Number two set starts at 301 + * 2 x 300 = 600 + * 600 - 300 = 300 + * 300 + 1 = 301 <-- + * Number five set starts at 1201 + * 5 x 300 = 1500 + * 1500 - 300 = 1200 + * 1200 + 1 = 1201 <-- + **/ + return (($bundle * $this->bundle) - $this->bundle) + 1; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Set.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Set.php new file mode 100644 index 000000000..8afa6201d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Set.php @@ -0,0 +1,187 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Database; + + +use Joomla\CMS\Factory as JoomlaFactory; +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; +use VDM\Joomla\Componentbuilder\Search\Model\Set as Model; +use VDM\Joomla\Componentbuilder\Search\Interfaces\SetInterface; + + +/** + * Search Database Set + * + * @since 3.2.0 + */ +class Set implements SetInterface +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Search Model + * + * @var Model + * @since 3.2.0 + */ + protected Model $model; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * @param Model|null $model The search get model object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null, + ?Model $model = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + $this->model = $model ?: Factory::_('Set.Model'); + $this->db = $db ?: JoomlaFactory::getDbo(); + } + + /** + * Set values to a given table + * Example: $this->value(Value, 23, 'value_key', 'table_name'); + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function value($value, int $id, string $field, ?string $table = null): bool + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid field and table + if ($id > 0 && ($name = $this->table->get($table, $field, 'name')) !== null) + { + // build the object + $item = new \stdClass(); + $item->id = $id; + $item->{$name} = $this->model->value($value, $name, $table); + + // Update the column of this table using id as the primary key. + return $this->db->updateObject('#__componentbuilder_' . $table, $item, 'id'); + } + return false; + } + + /** + * Set values to a given table + * Example: $this->item(Object, 23, 'table_name'); + * + * @param object $item The item to save + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): bool + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($fields = $this->table->fields($table)) !== null) + { + // model the item values + foreach ($fields as $field) + { + if (isset($item->{$field})) + { + $item->{$field} = $this->model->value($item->{$field}, $field, $table); + } + } + + // Update the column of this table using id as the primary key. + return $this->db->updateObject('#__componentbuilder_' . $table, $item, 'id'); + } + return false; + } + + /** + * Set values to a given table + * Example: $this->items(Array, 'table_name'); + * + * @param array $items The items being saved + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function items(array $items, string $table = null): bool + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (ArrayHelper::check($items)) + { + $success = true; + foreach ($items as $item) + { + if ($this->item($item, $table) !== true) + { + $success = false; + break; + } + } + return $success; + } + return false; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php new file mode 100644 index 000000000..8f712414b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php @@ -0,0 +1,80 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use Joomla\DI\Container; + + +/** + * Search Factory + * + * @since 3.2.0 + */ +abstract class Factory +{ + /** + * Global Compiler Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the compiler container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get a the global compiler container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + $container = (new Container()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Search()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Model()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Database()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Agent()); + + return $container; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/FindInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/FindInterface.php new file mode 100644 index 000000000..d8bca4d6b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/FindInterface.php @@ -0,0 +1,65 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Find Interface + * + * @since 3.2.0 + */ +interface FindInterface +{ + /** + * Get found values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array; + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null); + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null); + + /** + * Reset all found values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null); +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php new file mode 100644 index 000000000..d02daeef1 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php @@ -0,0 +1,60 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Database Get Interface + * + * @since 3.2.0 + */ +interface GetInterface +{ + /** + * Get values from a given table + * Example: $this->value(23, 'value_key', 'table_name'); + * + * @param string $field The field key + * @param int $id The item ID + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value(string $field, int $id, string $table = null); + + /** + * Get values from a given table + * Example: $this->item(23, 'table_name'); + * + * @param int $id The item ID + * @param string| null $table The table + * + * @return object|null + * @since 3.2.0 + */ + public function item(int $id, string $table = null): ?object; + + /** + * Get values from a given table + * Example: $this->items('table_name'); + * + * @param string|null $table The table + * @param int $bundle The bundle to return (0 = all) + * + * @return array|null + * @since 3.2.0 + */ + public function items(string $table = null, int $bundle = 0): ?array; + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ModelInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ModelInterface.php new file mode 100644 index 000000000..c0aa6a2a2 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ModelInterface.php @@ -0,0 +1,71 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Model Interface + * + * @since 3.2.0 + */ +interface ModelInterface +{ + /** + * Model the value + * Example: $this->value(value, 'value_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, string $field, ?string $table = null); + + /** + * Model the values of an item + * Example: $this->item('table_name', Object); + * + * @param string $table The table + * @param object $item The item object + * + * @return object + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): object; + + /** + * Model the values of multiple items + * Example: $this->items(Array, 'table_name'); + * + * @param array|null $items The array of item objects + * @param string|null $table The table + * + * @return array|null + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null): ?array; + + /** + * Get last modeled ID + * Example: $this->last('table_name'); + * + * @param string|null $table The table + * + * @return int|null + * @since 3.2.0 + */ + public function last(?string $table = null): ?int; + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ReplaceInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ReplaceInterface.php new file mode 100644 index 000000000..bb619f2cf --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ReplaceInterface.php @@ -0,0 +1,66 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Replace Interface + * + * @since 3.2.0 + */ +interface ReplaceInterface +{ + /** + * Get updated values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array; + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null); + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null); + + /** + * Reset all updated values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null); + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SetInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SetInterface.php new file mode 100644 index 000000000..f8a62ee82 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SetInterface.php @@ -0,0 +1,60 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Database Set Interface + * + * @since 3.2.0 + */ +interface SetInterface +{ + /** + * Set values to a given table + * Example: $this->value(Value, 23, 'value_key', 'table_name'); + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function value($value, int $id, string $field, ?string $table = null): bool; + + /** + * Set values to a given table + * Example: $this->item(Object, 23, 'table_name'); + * + * @param object $item The item to save + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): bool; + + /** + * Set values to a given table + * Example: $this->items(Array, 'table_name'); + * + * @param array $items The items being saved + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function items(array $items, string $table = null): bool; +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model.php new file mode 100644 index 000000000..7e5cc2984 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model.php @@ -0,0 +1,160 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Search Model + * + * @since 3.2.0 + */ +abstract class Model +{ + /** + * Last ID + * + * @var array + * @since 3.2.0 + */ + protected array $last; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + } + + /** + * Model the values of an item + * Example: $this->item(Object, 'table_name'); + * + * @param object $item The item object + * @param string|null $table The table + * + * @return object + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): object + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($fields = $this->table->fields($table)) !== null) + { + foreach ($fields as $field) + { + if(isset($item->{$field})) + { + $item->{$field} = $this->value($item->{$field}, $field, $table); + } + } + } + + return $item; + } + + /** + * Model the values of multiple items + * Example: $this->items(Array, 'table_name'); + * + * @param array|null $items The array of item objects + * @param string|null $table The table + * + * @return array|null + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null): ?array + { + // check if this is a valid table + if (ArrayHelper::check($items)) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + foreach ($items as $id => &$item) + { + // model the item + $item = $this->item($item, $table); + + // add the last ID + $this->last[$table] = $item->id; + } + } + + return $items; + } + + /** + * Get last modeled ID + * Example: $this->last('table_name'); + * + * @param string|null $table The table + * + * @return int|null + * @since 3.2.0 + */ + public function last(?string $table = null): ?int + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if ($table && isset($this->last[$table])) + { + return $this->last[$table]; + } + + return null; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Get.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Get.php new file mode 100644 index 000000000..4f5b3d756 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Get.php @@ -0,0 +1,63 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Model; + + +use VDM\Joomla\Componentbuilder\Search\Interfaces\ModelInterface; +use VDM\Joomla\Componentbuilder\Search\Model; + + +/** + * Search Get Model + * + * @since 3.2.0 + */ +class Get extends Model implements ModelInterface +{ + /** + * Model the value + * Example: $this->value(value, 'value_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, string $field, ?string $table = null) + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'base64': + $value = \base64_decode($value); + break; + case 'json': + $value = \json_decode($value, true); + break; + } + } + return $value; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Set.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Set.php new file mode 100644 index 000000000..274f0e897 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Set.php @@ -0,0 +1,63 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Model; + + +use VDM\Joomla\Componentbuilder\Search\Interfaces\ModelInterface; +use VDM\Joomla\Componentbuilder\Search\Model; + + +/** + * Search Set Model + * + * @since 3.2.0 + */ +class Set extends Model implements ModelInterface +{ + /** + * Model the value + * Example: $this->value(value, 'field_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, string $field, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'base64': + $value = \base64_encode($value); + break; + case 'json': + $value = \json_encode($value, JSON_FORCE_OBJECT); + break; + } + } + return $value; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php new file mode 100644 index 000000000..d487ab809 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php @@ -0,0 +1,142 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Agent as SearchAgent; +use VDM\Joomla\Componentbuilder\Search\Agent\Find; +use VDM\Joomla\Componentbuilder\Search\Agent\Replace; +use VDM\Joomla\Componentbuilder\Search\Agent\Search; +use VDM\Joomla\Componentbuilder\Search\Agent\Update; + + +/** + * Agent Service Provider + * + * @since 3.2.0 + */ +class Agent implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(SearchAgent::class, 'Agent') + ->share('Agent', [$this, 'getAgent'], true); + + $container->alias(Find::class, 'Agent.Find') + ->share('Agent.Find', [$this, 'getFind'], true); + + $container->alias(Replace::class, 'Agent.Replace') + ->share('Agent.Replace', [$this, 'getReplace'], true); + + $container->alias(Search::class, 'Agent.Search') + ->share('Agent.Search', [$this, 'getSearch'], true); + + $container->alias(Update::class, 'Agent.Update') + ->share('Agent.Update', [$this, 'getUpdate'], true); + } + + /** + * Get the Search Agent + * + * @param Container $container The DI container. + * + * @return SearchAgent + * @since 3.2.0 + */ + public function getAgent(Container $container): SearchAgent + { + return new SearchAgent( + $container->get('Config'), + $container->get('Get.Database'), + $container->get('Set.Database'), + $container->get('Agent.Find'), + $container->get('Agent.Replace'), + $container->get('Agent.Search') + ); + } + + /** + * Get the Search Agent Find + * + * @param Container $container The DI container. + * + * @return Find + * @since 3.2.0 + */ + public function getFind(Container $container): Find + { + return new Find( + $container->get('Config'), + $container->get('Agent.Search') + ); + } + + /** + * Get the Search Agent Replace + * + * @param Container $container The DI container. + * + * @return Replace + * @since 3.2.0 + */ + public function getReplace(Container $container): Replace + { + return new Replace( + $container->get('Config'), + $container->get('Agent.Update') + ); + } + + /** + * Get the Search Agent Search + * + * @param Container $container The DI container. + * + * @return Search + * @since 3.2.0 + */ + public function getSearch(Container $container): Search + { + return new Search( + $container->get('Config'), + $container->get('Table') + ); + } + + /** + * Get the Search Agent Update + * + * @param Container $container The DI container. + * + * @return Update + * @since 3.2.0 + */ + public function getUpdate(Container $container): Update + { + return new Update( + $container->get('Config'), + $container->get('Table') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Database.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Database.php new file mode 100644 index 000000000..d5586a786 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Database.php @@ -0,0 +1,80 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Database\Get as GetDatabase; +use VDM\Joomla\Componentbuilder\Search\Database\Set as SetDatabase; + + +/** + * Database Service Provider + * + * @since 3.2.0 + */ +class Database implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(GetDatabase::class, 'Get.Database') + ->share('Get.Database', [$this, 'getDatabaseGet'], true); + + $container->alias(SetDatabase::class, 'Set.Database') + ->share('Set.Database', [$this, 'getDatabaseSet'], true); + } + + /** + * Get the Get Database + * + * @param Container $container The DI container. + * + * @return GetDatabase + * @since 3.2.0 + */ + public function getDatabaseGet(Container $container): GetDatabase + { + return new GetDatabase( + $container->get('Config'), + $container->get('Table'), + $container->get('Get.Model') + ); + } + + /** + * Get the Set Database + * + * @param Container $container The DI container. + * + * @return SetDatabase + * @since 3.2.0 + */ + public function getDatabaseSet(Container $container): SetDatabase + { + return new SetDatabase( + $container->get('Config'), + $container->get('Table'), + $container->get('Set.Model') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Model.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Model.php new file mode 100644 index 000000000..9e3817f83 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Model.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Model\Get; +use VDM\Joomla\Componentbuilder\Search\Model\Set; + + +/** + * Model Service Provider + * + * @since 3.2.0 + */ +class Model implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Get::class, 'Get.Model') + ->share('Get.Model', [$this, 'getModelGet'], true); + + $container->alias(Set::class, 'Set.Model') + ->share('Set.Model', [$this, 'getModelSet'], true); + } + + /** + * Get the Get Model + * + * @param Container $container The DI container. + * + * @return Get + * @since 3.2.0 + */ + public function getModelGet(Container $container): Get + { + return new Get( + $container->get('Config'), + $container->get('Table') + ); + } + + /** + * Get the Set Model + * + * @param Container $container The DI container. + * + * @return Set + * @since 3.2.0 + */ + public function getModelSet(Container $container): Set + { + return new Set( + $container->get('Config'), + $container->get('Table') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php new file mode 100644 index 000000000..6b26bf9aa --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php @@ -0,0 +1,74 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; + + +/** + * Search Service Provider + * + * @since 3.2.0 + */ +class Search implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Config::class, 'Config') + ->share('Config', [$this, 'getConfig'], true); + + $container->alias(Table::class, 'Table') + ->share('Table', [$this, 'getTable'], true); + } + + /** + * Get the Config + * + * @param Container $container The DI container. + * + * @return Config + * @since 3.2.0 + */ + public function getConfig(Container $container): Config + { + return new Config(); + } + + /** + * Get the Table + * + * @param Container $container The DI container. + * + * @return Table + * @since 3.2.0 + */ + public function getTable(Container $container): Table + { + return new Table( + $container->get('Config') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php new file mode 100644 index 000000000..d40448f72 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php @@ -0,0 +1,3026 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; + + +/** + * Search Table + * + * @since 3.2.0 + */ +class Table +{ + /** + * All areas/views/tables with their field details to SEARCH + * + * @var array + * @since 3.2.0 + **/ + protected $tables = [ + 'joomla_component' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name_code' => [ + 'name' => 'name_code', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'companyname' => [ + 'name' => 'companyname', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_helper_both' => [ + 'name' => 'php_helper_both', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'crowdin_project_identifier' => [ + 'name' => 'crowdin_project_identifier', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'css_admin' => [ + 'name' => 'css_admin', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'php_admin_event' => [ + 'name' => 'php_admin_event', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'php_site_event' => [ + 'name' => 'php_site_event', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'author' => [ + 'name' => 'author', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_postflight_install' => [ + 'name' => 'php_postflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'email' => [ + 'name' => 'email', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'sql_uninstall' => [ + 'name' => 'sql_uninstall', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'website' => [ + 'name' => 'website', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_helper_admin' => [ + 'name' => 'php_helper_admin', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'whmcs_key' => [ + 'name' => 'whmcs_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'php_helper_site' => [ + 'name' => 'php_helper_site', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'whmcs_url' => [ + 'name' => 'whmcs_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'javascript' => [ + 'name' => 'javascript', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'whmcs_buy_link' => [ + 'name' => 'whmcs_buy_link', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'css_site' => [ + 'name' => 'css_site', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'license' => [ + 'name' => 'license', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_preflight_update' => [ + 'name' => 'php_preflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'php_postflight_update' => [ + 'name' => 'php_postflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'copyright' => [ + 'name' => 'copyright', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'update_server_url' => [ + 'name' => 'update_server_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'component_version' => [ + 'name' => 'component_version', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'crowdin_username' => [ + 'name' => 'crowdin_username', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'buildcompsql' => [ + 'name' => 'buildcompsql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dynamic Build (beta)', + ], + 'menu_prefix' => [ + 'name' => 'menu_prefix', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'toignore' => [ + 'name' => 'toignore', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'export_key' => [ + 'name' => 'export_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Settings', + ], + 'joomla_source_link' => [ + 'name' => 'joomla_source_link', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'export_buy_link' => [ + 'name' => 'export_buy_link', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'addcontributors' => [ + 'name' => 'addcontributors', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'readme' => [ + 'name' => 'readme', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Readme', + ], + 'crowdin_project_api_key' => [ + 'name' => 'crowdin_project_api_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'crowdin_account_api_key' => [ + 'name' => 'crowdin_account_api_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'joomla_module' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'HTML', + ], + 'module_version' => [ + 'name' => 'module_version', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + 'php_preflight_update' => [ + 'name' => 'php_preflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_preflight_uninstall' => [ + 'name' => 'php_preflight_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'mod_code' => [ + 'name' => 'mod_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'php_postflight_install' => [ + 'name' => 'php_postflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_postflight_update' => [ + 'name' => 'php_postflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'class_helper_header' => [ + 'name' => 'class_helper_header', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Helper', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'class_helper_code' => [ + 'name' => 'class_helper_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Helper', + ], + 'sql_uninstall' => [ + 'name' => 'sql_uninstall', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'fields' => [ + 'name' => 'fields', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'json', + 'tab_name' => 'Forms & Fields', + ], + 'readme' => [ + 'name' => 'readme', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Readme', + ], + 'update_server_url' => [ + 'name' => 'update_server_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_script_construct' => [ + 'name' => 'php_script_construct', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + ], + 'joomla_plugin' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'method_selection' => [ + 'name' => 'method_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'property_selection' => [ + 'name' => 'property_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'head' => [ + 'name' => 'head', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'main_class_code' => [ + 'name' => 'main_class_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'php_postflight_install' => [ + 'name' => 'php_postflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'plugin_version' => [ + 'name' => 'plugin_version', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'php_postflight_update' => [ + 'name' => 'php_postflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'fields' => [ + 'name' => 'fields', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'json', + 'tab_name' => 'Forms & Fields', + ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'php_script_construct' => [ + 'name' => 'php_script_construct', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'sql_uninstall' => [ + 'name' => 'sql_uninstall', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'readme' => [ + 'name' => 'readme', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Readme', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'update_server_url' => [ + 'name' => 'update_server_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_preflight_update' => [ + 'name' => 'php_preflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_preflight_uninstall' => [ + 'name' => 'php_preflight_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + ], + 'power' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'namespace' => [ + 'name' => 'namespace', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'power_version' => [ + 'name' => 'power_version', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'load_selection' => [ + 'name' => 'load_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'main_class_code' => [ + 'name' => 'main_class_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'powers', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'use_selection' => [ + 'name' => 'use_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'property_selection' => [ + 'name' => 'property_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'implements_custom' => [ + 'name' => 'implements_custom', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'extends_custom' => [ + 'name' => 'extends_custom', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'method_selection' => [ + 'name' => 'method_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'head' => [ + 'name' => 'head', + 'type' => 'editor', + 'title' => false, + 'list' => 'powers', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + ], + 'admin_view' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name_single' => [ + 'name' => 'name_single', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_allowedit' => [ + 'name' => 'php_allowedit', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_postsavehook' => [ + 'name' => 'php_postsavehook', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_save' => [ + 'name' => 'php_before_save', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_getlistquery' => [ + 'name' => 'php_getlistquery', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_import_ext' => [ + 'name' => 'php_import_ext', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_after_publish' => [ + 'name' => 'php_after_publish', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_after_cancel' => [ + 'name' => 'php_after_cancel', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_batchmove' => [ + 'name' => 'php_batchmove', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_after_delete' => [ + 'name' => 'php_after_delete', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_import' => [ + 'name' => 'php_import', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'addpermissions' => [ + 'name' => 'addpermissions', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'php_getitems_after_all' => [ + 'name' => 'php_getitems_after_all', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_getform' => [ + 'name' => 'php_getform', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'addtabs' => [ + 'name' => 'addtabs', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'php_save' => [ + 'name' => 'php_save', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_allowadd' => [ + 'name' => 'php_allowadd', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_cancel' => [ + 'name' => 'php_before_cancel', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'addlinked_views' => [ + 'name' => 'addlinked_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'php_batchcopy' => [ + 'name' => 'php_batchcopy', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_publish' => [ + 'name' => 'php_before_publish', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_delete' => [ + 'name' => 'php_before_delete', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_document' => [ + 'name' => 'php_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'php_import_display' => [ + 'name' => 'php_import_display', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_import_setdata' => [ + 'name' => 'php_import_setdata', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'name_list' => [ + 'name' => 'name_list', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'css_view' => [ + 'name' => 'css_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'CSS', + ], + 'css_views' => [ + 'name' => 'css_views', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'CSS', + ], + 'javascript_view_file' => [ + 'name' => 'javascript_view_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'javascript_view_footer' => [ + 'name' => 'javascript_view_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'javascript_views_file' => [ + 'name' => 'javascript_views_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'javascript_views_footer' => [ + 'name' => 'javascript_views_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'custom_button' => [ + 'name' => 'custom_button', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Custom Buttons', + ], + 'php_controller' => [ + 'name' => 'php_controller', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'php_model' => [ + 'name' => 'php_model', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'php_controller_list' => [ + 'name' => 'php_controller_list', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'php_model_list' => [ + 'name' => 'php_model_list', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'addtables' => [ + 'name' => 'addtables', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'MySQL', + ], + 'php_ajaxmethod' => [ + 'name' => 'php_ajaxmethod', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'ajax_input' => [ + 'name' => 'ajax_input', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'PHP', + ], + 'html_import_view' => [ + 'name' => 'html_import_view', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_getitem' => [ + 'name' => 'php_getitem', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_import_headers' => [ + 'name' => 'php_import_headers', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_import_save' => [ + 'name' => 'php_import_save', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_getitems' => [ + 'name' => 'php_getitems', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'custom_admin_view' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'css_document' => [ + 'name' => 'css_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'css' => [ + 'name' => 'css', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'js_document' => [ + 'name' => 'js_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'javascript_file' => [ + 'name' => 'javascript_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'codename' => [ + 'name' => 'codename', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'context' => [ + 'name' => 'context', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_ajaxmethod' => [ + 'name' => 'php_ajaxmethod', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'ajax_input' => [ + 'name' => 'ajax_input', + 'type' => 'subform', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'json', + 'tab_name' => 'PHP', + ], + 'php_document' => [ + 'name' => 'php_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_jview_display' => [ + 'name' => 'php_jview_display', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'custom_button' => [ + 'name' => 'custom_button', + 'type' => 'subform', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'json', + 'tab_name' => 'Custom Buttons', + ], + 'php_jview' => [ + 'name' => 'php_jview', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_controller' => [ + 'name' => 'php_controller', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'php_model' => [ + 'name' => 'php_model', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + ], + 'site_view' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'js_document' => [ + 'name' => 'js_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'codename' => [ + 'name' => 'codename', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'javascript_file' => [ + 'name' => 'javascript_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'context' => [ + 'name' => 'context', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'css_document' => [ + 'name' => 'css_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'css' => [ + 'name' => 'css', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'php_ajaxmethod' => [ + 'name' => 'php_ajaxmethod', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'ajax_input' => [ + 'name' => 'ajax_input', + 'type' => 'subform', + 'title' => false, + 'list' => 'site_views', + 'store' => 'json', + 'tab_name' => 'PHP', + ], + 'php_document' => [ + 'name' => 'php_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_jview_display' => [ + 'name' => 'php_jview_display', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'custom_button' => [ + 'name' => 'custom_button', + 'type' => 'subform', + 'title' => false, + 'list' => 'site_views', + 'store' => 'json', + 'tab_name' => 'Custom Buttons', + ], + 'php_jview' => [ + 'name' => 'php_jview', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_controller' => [ + 'name' => 'php_controller', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'php_model' => [ + 'name' => 'php_model', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + ], + 'template' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'templates', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'template' => [ + 'name' => 'template', + 'type' => 'editor', + 'title' => false, + 'list' => 'templates', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'type' => 'text', + 'title' => false, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'layout' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'layouts', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'layouts', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'layouts', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'layout' => [ + 'name' => 'layout', + 'type' => 'editor', + 'title' => false, + 'list' => 'layouts', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'type' => 'text', + 'title' => false, + 'list' => 'layouts', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'dynamic_get' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_router_parse' => [ + 'name' => 'php_router_parse', + 'type' => 'textarea', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_before_getitems' => [ + 'name' => 'php_before_getitems', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_after_getitems' => [ + 'name' => 'php_after_getitems', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_after_getitem' => [ + 'name' => 'php_after_getitem', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_getlistquery' => [ + 'name' => 'php_getlistquery', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'join_db_table' => [ + 'name' => 'join_db_table', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Joint', + ], + 'view_selection' => [ + 'name' => 'view_selection', + 'type' => 'textarea', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_custom_get' => [ + 'name' => 'php_custom_get', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Main', + ], + 'db_selection' => [ + 'name' => 'db_selection', + 'type' => 'textarea', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_calculation' => [ + 'name' => 'php_calculation', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Abacus', + ], + 'php_before_getitem' => [ + 'name' => 'php_before_getitem', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'getcustom' => [ + 'name' => 'getcustom', + 'type' => 'text', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'filter' => [ + 'name' => 'filter', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'where' => [ + 'name' => 'where', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'order' => [ + 'name' => 'order', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'group' => [ + 'name' => 'group', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'global' => [ + 'name' => 'global', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'join_view_table' => [ + 'name' => 'join_view_table', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Joint', + ], + ], + 'custom_code' => [ + 'path' => [ + 'name' => 'path', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'function_name' => [ + 'name' => 'function_name', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'code' => [ + 'name' => 'code', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_codes', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'hashendtarget' => [ + 'name' => 'hashendtarget', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'to_line' => [ + 'name' => 'to_line', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'from_line' => [ + 'name' => 'from_line', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'hashtarget' => [ + 'name' => 'hashtarget', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'class_property' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'class_properties', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'class_properties', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'comment' => [ + 'name' => 'comment', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_properties', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_properties', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'class_method' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'class_methods', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'class_methods', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'code' => [ + 'name' => 'code', + 'type' => 'editor', + 'title' => false, + 'list' => 'class_methods', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'comment' => [ + 'name' => 'comment', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_methods', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'arguments' => [ + 'name' => 'arguments', + 'type' => 'text', + 'title' => false, + 'list' => 'class_methods', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'placeholder' => [ + 'target' => [ + 'name' => 'target', + 'type' => 'text', + 'title' => true, + 'list' => 'placeholders', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'value' => [ + 'name' => 'value', + 'type' => 'text', + 'title' => false, + 'list' => 'placeholders', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'library' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'libraries', + 'store' => NULL, + 'tab_name' => 'Behaviour', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'libraries', + 'store' => NULL, + 'tab_name' => 'Behaviour', + ], + 'php_setdocument' => [ + 'name' => 'php_setdocument', + 'type' => 'textarea', + 'title' => false, + 'list' => 'libraries', + 'store' => 'base64', + 'tab_name' => 'Behaviour', + ], + 'addconditions' => [ + 'name' => 'addconditions', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries', + 'store' => 'json', + 'tab_name' => 'Behaviour', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'libraries', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'snippet' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'url' => [ + 'name' => 'url', + 'type' => 'url', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'heading' => [ + 'name' => 'heading', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'contributor_email' => [ + 'name' => 'contributor_email', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'contributor_name' => [ + 'name' => 'contributor_name', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'contributor_website' => [ + 'name' => 'contributor_website', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'contributor_company' => [ + 'name' => 'contributor_company', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'snippet' => [ + 'name' => 'snippet', + 'type' => 'textarea', + 'title' => false, + 'list' => 'snippets', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'usage' => [ + 'name' => 'usage', + 'type' => 'textarea', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'validation_rule' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'validation_rules', + 'store' => NULL, + 'tab_name' => 'Extends FormRule', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'validation_rules', + 'store' => NULL, + 'tab_name' => 'Extends FormRule', + ], + 'php' => [ + 'name' => 'php', + 'type' => 'textarea', + 'title' => false, + 'list' => 'validation_rules', + 'store' => 'base64', + 'tab_name' => 'Extends FormRule', + ], + ], + 'field' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'Set Properties', + ], + 'on_get_model_field' => [ + 'name' => 'on_get_model_field', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'on_save_model_field' => [ + 'name' => 'on_save_model_field', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'initiator_on_get_model' => [ + 'name' => 'initiator_on_get_model', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'css_view' => [ + 'name' => 'css_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'javascript_view_footer' => [ + 'name' => 'javascript_view_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'css_views' => [ + 'name' => 'css_views', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'datadefault_other' => [ + 'name' => 'datadefault_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'Database', + ], + 'datalenght_other' => [ + 'name' => 'datalenght_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'Database', + ], + 'javascript_views_footer' => [ + 'name' => 'javascript_views_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'initiator_on_save_model' => [ + 'name' => 'initiator_on_save_model', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'fieldtype' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'datadefault_other' => [ + 'name' => 'datadefault_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Database (defaults)', + ], + 'datalenght_other' => [ + 'name' => 'datalenght_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Database (defaults)', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'properties' => [ + 'name' => 'properties', + 'type' => 'subform', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => 'json', + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'language_translation' => [ + 'source' => [ + 'name' => 'source', + 'type' => 'textarea', + 'title' => true, + 'list' => 'language_translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'translation' => [ + 'name' => 'translation', + 'type' => 'subform', + 'title' => false, + 'list' => 'language_translations', + 'store' => 'json', + 'tab_name' => 'Details', + ], + ], + 'language' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'languages', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'langtag' => [ + 'name' => 'langtag', + 'type' => 'text', + 'title' => false, + 'list' => 'languages', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'server' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'servers', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'signature' => [ + 'name' => 'signature', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'private_key' => [ + 'name' => 'private_key', + 'type' => 'textarea', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'private' => [ + 'name' => 'private', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'path' => [ + 'name' => 'path', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'port' => [ + 'name' => 'port', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'host' => [ + 'name' => 'host', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'username' => [ + 'name' => 'username', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + ], + 'help_document' => [ + 'title' => [ + 'name' => 'title', + 'type' => 'text', + 'title' => true, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'content' => [ + 'name' => 'content', + 'type' => 'editor', + 'title' => false, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'url' => [ + 'name' => 'url', + 'type' => 'url', + 'title' => false, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'type' => 'text', + 'title' => false, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'admin_fields' => [ + 'addfields' => [ + 'name' => 'addfields', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_fields', + 'store' => 'json', + 'tab_name' => 'Fields', + ], + ], + 'admin_fields_conditions' => [ + 'addconditions' => [ + 'name' => 'addconditions', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_fields_conditions', + 'store' => 'json', + 'tab_name' => 'Conditions', + ], + ], + 'admin_fields_relations' => [ + 'addrelations' => [ + 'name' => 'addrelations', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_fields_relations', + 'store' => 'json', + 'tab_name' => 'Relations', + ], + ], + 'admin_custom_tabs' => [ + 'tabs' => [ + 'name' => 'tabs', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_custom_tabs', + 'store' => 'json', + 'tab_name' => 'Tabs', + ], + ], + 'component_admin_views' => [ + 'addadmin_views' => [ + 'name' => 'addadmin_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_admin_views', + 'store' => 'json', + 'tab_name' => 'Views', + ], + ], + 'component_site_views' => [ + 'addsite_views' => [ + 'name' => 'addsite_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_site_views', + 'store' => 'json', + 'tab_name' => 'Views', + ], + ], + 'component_custom_admin_views' => [ + 'addcustom_admin_views' => [ + 'name' => 'addcustom_admin_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_custom_admin_views', + 'store' => 'json', + 'tab_name' => 'Views', + ], + ], + 'component_updates' => [ + 'version_update' => [ + 'name' => 'version_update', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_updates', + 'store' => 'json', + 'tab_name' => 'Updates', + ], + ], + 'component_mysql_tweaks' => [ + 'sql_tweak' => [ + 'name' => 'sql_tweak', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_mysql_tweaks', + 'store' => 'json', + 'tab_name' => 'Mysql Tweaks', + ], + ], + 'component_custom_admin_menus' => [ + 'addcustommenus' => [ + 'name' => 'addcustommenus', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_custom_admin_menus', + 'store' => 'json', + 'tab_name' => 'Menus', + ], + ], + 'component_config' => [ + 'addconfig' => [ + 'name' => 'addconfig', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_config', + 'store' => 'json', + 'tab_name' => 'Options', + ], + ], + 'component_dashboard' => [ + 'dashboard_tab' => [ + 'name' => 'dashboard_tab', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_dashboard', + 'store' => 'json', + 'tab_name' => 'Dashboard', + ], + 'php_dashboard_methods' => [ + 'name' => 'php_dashboard_methods', + 'type' => 'textarea', + 'title' => false, + 'list' => 'components_dashboard', + 'store' => 'base64', + 'tab_name' => 'Dashboard', + ], + ], + 'component_files_folders' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + 'component_placeholders' => [ + 'addplaceholders' => [ + 'name' => 'addplaceholders', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_placeholders', + 'store' => 'json', + 'tab_name' => 'Details', + ], + ], + 'component_plugins' => [ + 'addjoomla_plugins' => [ + 'name' => 'addjoomla_plugins', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_plugins', + 'store' => 'json', + 'tab_name' => 'Plugins', + ], + ], + 'component_modules' => [ + 'addjoomla_modules' => [ + 'name' => 'addjoomla_modules', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_modules', + 'store' => 'json', + 'tab_name' => 'Modules', + ], + ], + 'snippet_type' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'snippet_types', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'snippet_types', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'library_config' => [ + 'addconfig' => [ + 'name' => 'addconfig', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_config', + 'store' => 'json', + 'tab_name' => 'Tweaks', + ], + ], + 'library_files_folders_urls' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addurls' => [ + 'name' => 'addurls', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + 'class_extends' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'class_extendings', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'head' => [ + 'name' => 'head', + 'type' => 'editor', + 'title' => false, + 'list' => 'class_extendings', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'comment' => [ + 'name' => 'comment', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_extendings', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'joomla_module_updates' => [ + 'version_update' => [ + 'name' => 'version_update', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_updates', + 'store' => 'json', + 'tab_name' => 'Updates', + ], + ], + 'joomla_module_files_folders_urls' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addurls' => [ + 'name' => 'addurls', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + 'joomla_plugin_group' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_plugin_groups', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'joomla_plugin_updates' => [ + 'version_update' => [ + 'name' => 'version_update', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_updates', + 'store' => 'json', + 'tab_name' => 'Updates', + ], + ], + 'joomla_plugin_files_folders_urls' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addurls' => [ + 'name' => 'addurls', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + ]; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Factory::_('Config'); + } + + /** + * Get any value from a item/field/column of an area/view/table + * Example: $this->get('table_name', 'field_name', 'value_key'); + * Get an item/field/column of an area/view/table + * Example: $this->get('table_name', 'field_name'); + * Get all items/fields/columns of an area/view/table + * Example: $this->get('table_name'); + * Get all areas/views/tables with all their item/field/column details + * Example: $this->get(); + * + * @param string|null $table The table + * @param string|null $field The field + * @param string|null $key The value key + * + * @return mixed + * @since 3.2.0 + */ + public function get(?string $table = null, ?string $field = null, ?string $key = null) + { + // load the table + if (empty($table) && is_string($field)) + { + $table = $this->config->table_name; + } + + // return the item/field/column of an area/view/table + if (is_string($field) && is_string($key)) + { + // return the value of a item/field/column of an area/view/table + if (isset($this->tables[$table][$field][$key])) + { + return $this->tables[$table][$field][$key]; + } + return null; + } + // return the item/field/column of an area/view/table + elseif (is_string($field)) + { + if (isset($this->tables[$table][$field])) + { + return $this->tables[$table][$field]; + } + return null; + } + // return an area/view/table + elseif (is_string($table)) + { + if (isset($this->tables[$table])) + { + return $this->tables[$table]; + } + return null; + } + + // return all + return $this->tables; + } + + /** + * Get title field from an area/view/table + * + * @param string|null $table The area + * + * @return ?array + * @since 3.2.0 + */ + public function title(?string $table = null): ?array + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // return the title item/field/column of an area/view/table + if (($table = $this->get($table)) !== null) + { + foreach ($table as $item) + { + if ($item['title']) + { + return $item; + } + } + } + + // none found + return null; + } + + /** + * Get title field name + * + * @param string|null $table The area + * + * @return string + * @since 3.2.0 + */ + public function titleName(?string $table = null): string + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // return the title name of an area/view/table + if (($field = $this->title($table)) !== null) + { + return $field['name']; + } + + // none found default to ID + return 'id'; + } + + /** + * Get all tables + * + * @return array + * @since 3.2.0 + */ + public function tables(): array + { + // return all areas/views/tables + return array_keys($this->tables); + } + + /** + * Check if a table exist + * + * @param string|null $table The area + * + * @return bool + * @since 3.2.0 + */ + public function exist(?string $table = null): bool + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (isset($table) && isset($this->tables[$table])) + { + return true; + } + + return false; + } + + /** + * Get all fields of an area/view/table + * + * @param string|null $table The area + * + * @return ?array + * @since 3.2.0 + */ + public function fields(?string $table = null): ?array + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // return all fields of an area/view/table + if (($table = $this->get($table)) !== null) + { + return array_keys($table); + } + + // none found + return null; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/script.php b/script.php index a6b8b4cb2..273dbc77b 100644 --- a/script.php +++ b/script.php @@ -6755,7 +6755,7 @@ class com_componentbuilderInstallerScript { $rule_length = $db->loadResult(); // Check the size of the rules column - if ($rule_length <= 96960) + if ($rule_length <= 97440) { // Fix the assets table rules column size $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index c77a1c867..7033e9fc1 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -3547,6 +3547,9 @@ abstract class ComponentbuilderHelper ), 'special' => array( 'contentlanguage', 'moduleposition', 'plugin', 'repeatable', 'subform' + ), + 'search' => array( + 'editor', 'email', 'tel', 'text', 'textarea', 'url', 'subform' ) ); -- 2.45.1 From c53ece2a2d221ae6ee7b58ab9568ace2c4cb0f99 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 16 Sep 2022 23:41:41 +0200 Subject: [PATCH 12/49] Adds more classes, and refactoring to the search feature. Adds test search to search page. #952 --- README.md | 8 +- admin/README.txt | 8 +- .../en-GB/en-GB.com_componentbuilder.ini | 1 - admin/models/ajax.php | 16 +- admin/views/search/tmpl/default.php | 25 +- componentbuilder.xml | 2 +- .../src/Componentbuilder/Search/Agent.php | 2 +- .../Componentbuilder/Search/Agent/Replace.php | 2 +- .../Componentbuilder/Search/Agent/Search.php | 253 ++++++++++++++++-- .../Componentbuilder/Search/Agent/Update.php | 115 ++++++-- .../src/Componentbuilder/Search/Config.php | 8 +- .../Search/Interfaces/FindInterface.php | 3 +- .../Search/Interfaces/ModelInterface.php | 10 +- .../Search/Interfaces/SearchInterface.php | 56 ++++ .../Search/Interfaces/SearchTypeInterface.php | 43 +++ .../src/Componentbuilder/Search/Model.php | 51 +++- .../src/Componentbuilder/Search/Model/Get.php | 10 +- .../Componentbuilder/Search/Service/Agent.php | 6 +- .../Search/Service/Search.php | 77 ++++++ .../Componentbuilder/Search/Type/Basic.php | 127 +++++++++ .../Componentbuilder/Search/Type/Regex.php | 112 ++++++++ .../Componentbuilder/Search/Type/index.html | 1 + 22 files changed, 845 insertions(+), 91 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SearchInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SearchTypeInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Basic.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Regex.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/index.html diff --git a/README.md b/README.md index 20ac6437d..342c18d3f 100644 --- a/README.md +++ b/README.md @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th September, 2022 ++ *Last Build*: 16th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **330282** ++ *Line count*: **331035** + *Field count*: **2002** -+ *File count*: **2161** -+ *Folder count*: **374** ++ *File count*: **2166** ++ *Folder count*: **375** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 20ac6437d..342c18d3f 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th September, 2022 ++ *Last Build*: 16th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **330282** ++ *Line count*: **331035** + *Field count*: **2002** -+ *File count*: **2161** -+ *Folder count*: **374** ++ *File count*: **2166** ++ *Folder count*: **375** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 5d19974ee..8fb1a0828 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -7760,7 +7760,6 @@ COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)" COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)" COM_COMPONENTBUILDER_MODULE="Module" COM_COMPONENTBUILDER_MODULES="Modules" -COM_COMPONENTBUILDER_MORE_SOON="More soon" COM_COMPONENTBUILDER_MOVE="Move" COM_COMPONENTBUILDER_NAME="Name" COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)" diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 9c3ce9a3e..b347bafa8 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -3622,17 +3622,17 @@ class ComponentbuilderModelAjax extends ListModel int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array { // check if this is a valid table - if (SearchFactory('Table')->exist($tableName)) + if (SearchFactory::_('Table')->exist($tableName)) { // load the configurations - SearchFactory('Config')->table_name = $tableName; - SearchFactory('Config')->search_value = $searchValue; - SearchFactory('Config')->match_case = $matchCase; - SearchFactory('Config')->whole_word = $wholeWord; - SearchFactory('Config')->regex_search = $regexSearch; - SearchFactory('Config')->component_id = $componentId; + SearchFactory::_('Config')->table_name = $tableName; + SearchFactory::_('Config')->search_value = $searchValue; + SearchFactory::_('Config')->match_case = $matchCase; + SearchFactory::_('Config')->whole_word = $wholeWord; + SearchFactory::_('Config')->regex_search = $regexSearch; + SearchFactory::_('Config')->component_id = $componentId; - if (($items = SearchFactory('Agent')->find()) !== null) + if (($items = SearchFactory::_('Agent')->find()) !== null) { return ['success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), 'items' => $items]; } diff --git a/admin/views/search/tmpl/default.php b/admin/views/search/tmpl/default.php index d28ecae59..5413d57c0 100644 --- a/admin/views/search/tmpl/default.php +++ b/admin/views/search/tmpl/default.php @@ -16,6 +16,7 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.formvalidator'); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); +use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; ?> canDo->get('search.access')): ?> - - -

    diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 970ebbf4c..1a6cc9be3 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -40,11 +40,18 @@ class ComponentbuilderViewCompiler extends HtmlView JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=compiler'); $this->sidebar = JHtmlSidebar::render(); } + // get the success message if set $this->SuccessMessage = $this->app->getUserState('com_componentbuilder.success_message', false); + + // get active components $this->Components = $this->get('Components'); - $this->form = $this->setForm(); + + // get the needed form fields + $this->Form = $this->getDynamicForm(); + // set the compiler artwork from global settings $this->builder_gif_size = $this->params->get('builder_gif_size', '480-272'); + // only run these checks if he has access if ($this->canDo->get('compiler.compiler_animations')) { @@ -96,7 +103,14 @@ class ComponentbuilderViewCompiler extends HtmlView // JLayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded // JLayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded - public function setForm() + /** + * Get the dynamic build form fields needed on the page + * + * @return array|null The array of form fields + * + * @since 3.2.0 + */ + public function getDynamicForm(): ?array { if(ComponentbuilderHelper::checkArray($this->Components)) { @@ -209,8 +223,10 @@ class ComponentbuilderViewCompiler extends HtmlView // return the form array return $form; } - return false; - } + + return null; + } + /** * Prepares the document @@ -396,7 +412,7 @@ class ComponentbuilderViewCompiler extends HtmlView if ($this->canDo->get('compiler.compiler_animations')) { // add Compiler Animations button. - JToolBarHelper::custom('compiler.getCompilerAnimations', 'download custom-button-getcompileranimations', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false); + JToolBarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false); } if ($this->canDo->get('compiler.clear_tmp')) { diff --git a/admin/views/search/tmpl/default.php b/admin/views/search/tmpl/default.php index 3b6806e03..a19313068 100644 --- a/admin/views/search/tmpl/default.php +++ b/admin/views/search/tmpl/default.php @@ -17,6 +17,10 @@ JHtml::_('behavior.formvalidator'); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; + +$this->app->input->set('hidemainmenu', false); +$selectNotice = '

    ' . JText::_('COM_COMPONENTBUILDER_HI') . ' ' . $this->user->name . '

    '; +$selectNotice .= '

    ' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT') . '

    '; ?> canDo->get('search.access')): ?> item->id)) ? '&id='. (int) $this->item->id : ''; ?> -
    sidebar)): ?>
    @@ -42,33 +45,55 @@ use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
    - table_name = $tableName; - SearchFactory::_('Config')->search_value = $searchValue; - SearchFactory::_('Config')->match_case = 1; - SearchFactory::_('Config')->whole_word = 0; - SearchFactory::_('Config')->regex_search = 1; - SearchFactory::_('Config')->component_id = 0; + form): ?> + +
    +
    +
    + form->renderField('type_search'); ?> + form->renderField('search_value'); ?> + form->renderField('replace_value'); ?> +
    +
    + form->renderFieldset('settings'); ?> +
    +
    +
    +
    + + + + + + + + + + + +
    +
    +
    + +
    + + +
    +item['tables']) && ComponentbuilderHelper::checkArray($this->item['tables'])) : ?> + +

    diff --git a/admin/views/search/view.html.php b/admin/views/search/view.html.php index 551d3d701..423db2bde 100644 --- a/admin/views/search/view.html.php +++ b/admin/views/search/view.html.php @@ -13,6 +13,9 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Filesystem\File; +use Joomla\CMS\Form\Form; +use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; /** * Componentbuilder Html View class for the Search @@ -38,7 +41,11 @@ class ComponentbuilderViewSearch extends HtmlView ComponentbuilderHelper::addSubmenu('search'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=search'); $this->sidebar = JHtmlSidebar::render(); - } + } + + // get the needed form fields + $this->form = $this->getDynamicForm(); + // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') @@ -59,6 +66,184 @@ class ComponentbuilderViewSearch extends HtmlView parent::display($tpl); } + /** + * Get the dynamic build form fields needed on the page + * + * @return Form|null The array of form fields + * + * @since 3.2.0 + */ + public function getDynamicForm(): ?Form + { + if(ComponentbuilderHelper::checkArray($this->item) && + ComponentbuilderHelper::checkArray($this->item['tables']) && + ComponentbuilderHelper::checkArray($this->item['components'])) + { + // start the form + $form = new Form('Search'); + + $form->load('
    +
    +
    +
    +
    '); + + // Search Mode + $attributes = [ + 'type' => 'radio', + 'name' => 'type_search', + 'label' => 'COM_COMPONENTBUILDER_MODE', + 'class' => 'btn-group', + 'description' => 'COM_COMPONENTBUILDER_SEARCH_OR_SEARCH_AND_REPLACE', + 'default' => '1']; + // set the mode options + $options = [ + 1 => 'COM_COMPONENTBUILDER_SEARCH', + 2 => 'COM_COMPONENTBUILDER_REPLACE']; + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'search'); + } + + // search text attributes + $attributes = [ + 'type' => 'text', + 'name' => 'search_value', + 'label' => 'COM_COMPONENTBUILDER_SEARCH', + 'size' => 150, + 'maxlength' => 200, + 'description' => 'COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_YOUR_SEARCH_TEXT', + 'filter' => 'RAW', + 'class' => 'search-value span12', + 'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT', + 'autocomplete' => true]; + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'search'); + } + + // replace text attributes + $attributes = [ + 'type' => 'text', + 'name' => 'replace_value', + 'label' => 'COM_COMPONENTBUILDER_REPLACE', + 'size' => 150, + 'maxlength' => 200, + 'description' => 'COM_COMPONENTBUILDER_HERE_YOU_CAN_ENTER_THE_REPLACE_TEXT_THAT_YOU_WOULD_LIKE_TO_USE_AS_REPLACEMENT_FOR_THE_SEARCH_TEXT_FOUND', + 'filter' => 'RAW', + 'class' => 'replace-value span12', + 'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_REPLACE_TEXT', + 'autocomplete' => true, + 'showon' => 'type_search:2']; + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'search'); + } + + // Search Behaviour + $attributes = [ + 'type' => 'checkboxes', + 'name' => 'search_behaviour', + 'label' => 'COM_COMPONENTBUILDER_BEHAVIOUR', + 'class' => 'btn-group', + 'description' => 'COM_COMPONENTBUILDER_SET_THE_SEARCH_BEHAVIOUR_HERE']; + // set the mode options + $options = [ + 'match_case' => 'COM_COMPONENTBUILDER_MATCH_CASE', + 'whole_word' => 'COM_COMPONENTBUILDER_WHOLE_WORD', + 'regex_search' => 'COM_COMPONENTBUILDER_REGEX_SEARCH']; + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'settings'); + } + + // component attributes + $attributes = [ + 'type' => 'list', + 'name' => 'component_id', + 'label' => 'COM_COMPONENTBUILDER_COMPONENTS_BR_SMALLDISABLED_SOONSMALL', + 'class' => 'list_class', + 'description' => 'COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_SEARCH', + 'required' => 'true', + 'disable' => 'true', + 'readonly' => 'true', + 'default' => -1]; + // start the component options + $options = []; + $options['-1'] = 'COM_COMPONENTBUILDER__SEARCH_ALL_'; + // load component options from array + foreach($this->item['components'] as $component) + { + $options[(int) $component->id] = $this->escape($component->name); + } + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'settings'); + } + + // table attributes + $attributes = [ + 'type' => 'list', + 'name' => 'table_name', + 'label' => 'COM_COMPONENTBUILDER_TABLES', + 'class' => 'list_class', + 'description' => 'COM_COMPONENTBUILDER_SELECT_THE_TABLE_TO_SEARCH', + 'required' => 'true', + 'default' => -1]; + // start the component options + $options = []; + $options['-1'] = 'COM_COMPONENTBUILDER__SEARCH_ALL_'; + // load table options from array + foreach($this->item['tables'] as $table) + { + $options[$table] = $this->escape($table); + } + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'settings'); + } + + // editor attributes + $attributes = [ + 'type' => 'editor', + 'name' => 'full_text', + 'label' => 'COM_COMPONENTBUILDER_FULL_TEXT', + 'width' => '100%', + 'height' => '450px', + 'class' => 'full_text_editor', + 'syntax' => 'php', + 'buttons' => 'false', + 'filter' => 'raw', + 'editor' => 'codemirror|none']; + // add to form + $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'view'); + } + + // return the form array + return $form; + } + + return null; + } + + /** * Prepares the document */ @@ -72,6 +257,9 @@ class ComponentbuilderViewSearch extends HtmlView // Initialize the header checker. $HeaderCheck = new componentbuilderHeaderCheck; + // Add View JavaScript File + $this->document->addScript(JURI::root(true) . "/administrator/components/com_componentbuilder/assets/js/search.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript"); + // Load uikit options. $uikit = $this->params->get('uikit_load'); // Set script size. @@ -89,6 +277,40 @@ class ComponentbuilderViewSearch extends HtmlView { JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); } + + // Load the script to find all uikit components needed. + if ($uikit != 2) + { + // Set the default uikit components in this view. + $uikitComp = array(); + $uikitComp[] = 'uk-progress'; + } + + // Load the needed uikit components in this view. + if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) + { + // load just in case. + jimport('joomla.filesystem.file'); + // loading... + foreach ($uikitComp as $class) + { + foreach (ComponentbuilderHelper::$uk_components[$class] as $name) + { + // check if the CSS file exists. + if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css')) + { + // load the css. + JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']); + } + // check if the JavaScript file exists. + if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js')) + { + // load the js. + JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); + } + } + } + } // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/search.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); } diff --git a/componentbuilder.xml b/componentbuilder.xml index a5bd7a14d..840ddb7db 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 6th October, 2022 + 20th October, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php index dfa6ba645..eba3a4a89 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php @@ -175,7 +175,7 @@ class Power implements PowerInterface * * @param string $guid The global unique id of the power * - * @return bool + * @return bool true on successful setting of a power * @since 3.2.0 */ protected function set(string $guid): bool @@ -190,39 +190,52 @@ class Power implements PowerInterface // Create a new query object. $query = $this->db->getQuery(true); + // select all values $query->select('a.*'); - // from these tables + + // from this table $query->from('#__componentbuilder_power AS a'); $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid)); + $this->db->setQuery($query); $this->db->execute(); + if ($this->db->getNumRows()) { // make sure that in recursion we // don't try to load this power again + // since during the load of a power we also load + // all powers linked to it $this->state[$guid] = true; + // get the power data $this->active[$guid] = $this->db->loadObject(); + // make sure to add any language strings found to all language files // since we can't know where this is used at this point $tmp_lang_target = $this->config->lang_target; $this->config->lang_target = 'both'; + // we set the fix usr if needed $this->fixUrl = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id=' . $this->active[$guid]->id . '" target="_blank"'; + // set some keys $this->active[$guid]->target_type = 'P0m3R!'; $this->active[$guid]->key = $this->active[$guid]->id . '_' . $this->active[$guid]->target_type; + // now set the name $this->active[$guid]->name = $this->placeholder->update( $this->customcode->update($this->active[$guid]->name), $this->placeholder->active ); + // now set the code_name and class name $this->active[$guid]->code_name = $this->active[$guid]->class_name = ClassfunctionHelper::safe( $this->active[$guid]->name ); + // set official name $this->active[$guid]->official_name = StringHelper::safe( $this->active[$guid]->name, 'W' @@ -287,6 +300,7 @@ class Power implements PowerInterface { // set GUI mapper field $guiMapper['field'] = 'head'; + // base64 Decode code $this->active[$guid]->head = $this->gui->set( $this->placeholder->update( @@ -333,6 +347,7 @@ class Power implements PowerInterface return true; } } + // we failed to get the power, // so we raise an error message // only if guid is valid @@ -343,6 +358,7 @@ class Power implements PowerInterface 'Error' ); } + // let's not try again $this->state[$guid] = false; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Abstraction/Type.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Abstraction/Engine.php similarity index 93% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Abstraction/Type.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Abstraction/Engine.php index fcb902a80..0199a81ae 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Abstraction/Type.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Abstraction/Engine.php @@ -17,11 +17,11 @@ use VDM\Joomla\Componentbuilder\Search\Config; /** - * Search Type Regex + * Search Engine * * @since 3.2.0 */ -abstract class Type +abstract class Engine { /** * Search Config diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php index 79e0b057e..08cdaee10 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php @@ -19,6 +19,7 @@ use VDM\Joomla\Componentbuilder\Search\Database\Set; use VDM\Joomla\Componentbuilder\Search\Agent\Find; use VDM\Joomla\Componentbuilder\Search\Agent\Replace; use VDM\Joomla\Componentbuilder\Search\Agent\Search; +use VDM\Joomla\Componentbuilder\Search\Agent\Update; /** @@ -76,6 +77,14 @@ class Agent */ protected Search $search; + /** + * Update + * + * @var Update + * @since 3.2.0 + */ + protected Update $update; + /** * Constructor * @@ -90,7 +99,7 @@ class Agent */ public function __construct(?Config $config = null, ?Get $get = null, ?Set$set = null, ?Find $find = null, ?Replace $replace = null, - ?Search $search = null) + ?Search $search = null, ?Update $update = null) { $this->config = $config ?: Factory::_('Config'); $this->get = $get ?: Factory::_('Get.Database'); @@ -98,6 +107,65 @@ class Agent $this->find = $find ?: Factory::_('Agent.Find'); $this->replace = $replace ?: Factory::_('Agent.Replace'); $this->search = $search ?: Factory::_('Agent.Search'); + $this->update = $update ?: Factory::_('Agent.Update'); + } + + /** + * Get the value of a field in a row and table + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param mixed $line The field line + * @param string|null $table The table + * @param bool $update The switch to triger an update (default is false) + * + * @return mixed + * @since 3.2.0 + */ + public function getValue(int $id, string $field, $line = null, + ?string $table = null, bool $update = false) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (($value = $this->get->value($id, $field, $table)) !== null) + { + // try to update the value if required + if ($update && ($updated_value = $this->update->value($value, $line)) !== null) + { + return $updated_value; + } + + return $value; + } + + return null; + } + + /** + * Set the value of a field in a row and table + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function setValue($value, int $id, string $field, ?string $table = null): bool + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + return $this->set->value($value, $id, $field, $table); } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php index 70bdc5f7e..e1e52e892 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php @@ -87,17 +87,17 @@ class Get implements GetInterface } /** - * Get values from a given table + * Get a value from a given table * Example: $this->value(23, 'value_key', 'table_name'); * - * @param string $field The field key * @param int $id The item ID + * @param string $field The field key * @param string|null $table The table * * @return mixed * @since 3.2.0 */ - public function value(string $field, int $id, string $table = null) + public function value(int $id, string $field, string $table = null) { // load the table if (empty($table)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Basic.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Basic.php similarity index 92% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Basic.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Basic.php index a2959ad30..c7d19a988 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Basic.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Basic.php @@ -9,14 +9,14 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -namespace VDM\Joomla\Componentbuilder\Search\Type; +namespace VDM\Joomla\Componentbuilder\Search\Engine; use VDM\Joomla\Componentbuilder\Search\Config; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Componentbuilder\Search\Interfaces\SearchTypeInterface; -use VDM\Joomla\Componentbuilder\Search\Abstraction\Type; +use VDM\Joomla\Componentbuilder\Search\Abstraction\Engine; /** @@ -24,7 +24,7 @@ use VDM\Joomla\Componentbuilder\Search\Abstraction\Type; * * @since 3.2.0 */ -class Basic extends Type implements SearchTypeInterface +class Basic extends Engine implements SearchTypeInterface { /** * Regex Search Value diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Regex.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Regex.php similarity index 89% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Regex.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Regex.php index 19bd68a69..c2a89b872 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/Regex.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Regex.php @@ -9,14 +9,14 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ -namespace VDM\Joomla\Componentbuilder\Search\Type; +namespace VDM\Joomla\Componentbuilder\Search\Engine; use VDM\Joomla\Componentbuilder\Search\Config; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Componentbuilder\Search\Interfaces\SearchTypeInterface; -use VDM\Joomla\Componentbuilder\Search\Abstraction\Type; +use VDM\Joomla\Componentbuilder\Search\Abstraction\Engine; /** @@ -24,7 +24,7 @@ use VDM\Joomla\Componentbuilder\Search\Abstraction\Type; * * @since 3.2.0 */ -class Regex extends Type implements SearchTypeInterface +class Regex extends Engine implements SearchTypeInterface { /** * Regex Search Value diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/index.html similarity index 100% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Type/index.html rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/index.html diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php index 9085109e8..0ad634810 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php @@ -17,8 +17,8 @@ use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Search\Config; use VDM\Joomla\Componentbuilder\Search\Table; use VDM\Joomla\Componentbuilder\Search\Interfaces\SearchTypeInterface as SearchEngine; -use VDM\Joomla\Componentbuilder\Search\Type\Regex; -use VDM\Joomla\Componentbuilder\Search\Type\Basic; +use VDM\Joomla\Componentbuilder\Search\Engine\Regex; +use VDM\Joomla\Componentbuilder\Search\Engine\Basic; /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php index d9c3fa440..f30bb7c26 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php @@ -2981,14 +2981,15 @@ class Table } /** - * Check if a table exist + * Check if a table (and field) exist * * @param string|null $table The area + * @param string|null $field The area * * @return bool * @since 3.2.0 */ - public function exist(?string $table = null): bool + public function exist(?string $table = null, ?string $field = null): bool { // load the table if (empty($table)) @@ -2996,9 +2997,20 @@ class Table $table = $this->config->table_name; } - if (isset($table) && isset($this->tables[$table])) + if (is_string($table) && isset($this->tables[$table])) { - return true; + // if we have a field + if (is_string($field)) + { + if (isset($this->tables[$table][$field])) + { + return true; + } + } + else + { + return true; + } } return false; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php index baa6c42b1..91a3a61a5 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php @@ -33,11 +33,12 @@ abstract class GetHelper * @param string $operator The operator between $whereString/field and $where/value * @param string $main The component in which the table is found * - * @return mix string/int/float - * + * @return mixed string/int/float * @since 3.0.9 */ - public static function var($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = null) + public static function var(string $table, ?string $where = null, + string $whereString = 'user', string $what = 'id', + string $operator = '=', ?string $main = null) { if(empty($where)) { @@ -85,6 +86,7 @@ abstract class GetHelper { return $db->loadResult(); } + return false; } @@ -99,11 +101,12 @@ abstract class GetHelper * @param string $main The component in which the table is found * @param bool $unique The switch to return a unique array * - * @return array - * + * @return array|null * @since 3.0.9 */ - public static function vars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = null, $unique = true) + public static function vars(string $table, ?string $where = null, + string $whereString = 'user', string $what = 'id', string $operator = 'IN', + ?string $main = null, bool $unique = true): ?array { if(empty($where)) { @@ -147,11 +150,11 @@ abstract class GetHelper // add strings to array search if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator) { - $query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")'); + $query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","', $where) . '")'); } else { - $query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')'); + $query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',', $where) . ')'); } $db->setQuery($query); @@ -166,71 +169,83 @@ abstract class GetHelper return $db->loadColumn(); } } - return false; + + return null; } /** * get all strings between two other strings * - * @param string $content The content to search - * @param string $start The starting value - * @param string $end The ending value + * @param string $content The content to search + * @param string $start The starting value + * @param string $end The ending value * - * @return array On success - * + * @return array|null On success * @since 3.0.9 */ - public static function allBetween($content, $start, $end) + public static function allBetween(string $content, string $start, string $end): ?array { // reset bucket - $bucket = array(); + $bucket = []; for ($i = 0; ; $i++) { // search for string - $found = self::between($content,$start,$end); + $found = self::between($content, $start, $end); + if (StringHelper::check($found)) { // add to bucket $bucket[] = $found; + // build removal string - $remove = $start.$found.$end; + $remove = $start . $found . $end; + // remove from content - $content = str_replace($remove,'',$content); + $content = str_replace($remove, '', $content); } else { break; } + // safety catch if ($i == 500) { break; } } + // only return unique array of values - return array_unique($bucket); + if (ArrayHelper::check($bucket)) + { + return array_unique($bucket); + } + + return null; } /** * get a string between two other strings * - * @param string $content The content to search - * @param string $start The starting value - * @param string $end The ending value - * @param string $default The default value if none found + * @param string $content The content to search + * @param string $start The starting value + * @param string $end The ending value + * @param string $default The default value if none found * * @return string On success / empty string on failure - * * @since 3.0.9 */ - public static function between($content, $start, $end, $default = '') + public static function between(string $content, string $start, string $end, string $default = ''): string { - $r = explode($start, $content); - if (isset($r[1])) + $array = explode($start, $content); + if (isset($array[1]) && strpos($array[1], $end) !== false) { - $r = explode($end, $r[1]); - return $r[0]; + $array = explode($end, $array[1]); + + // return string found between + return $array[0]; } + return $default; } -- 2.45.1 From 869a1879cb63bb961457dc322068c6afea50f019 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 23 Oct 2022 23:18:02 +0200 Subject: [PATCH 20/49] Moved some class around for better structure in the jcb_powers of JCB. Fixed small issue with JCB package export. --- README.md | 10 ++-- admin/README.txt | 10 ++-- .../en-GB/en-GB.com_componentbuilder.ini | 1 + admin/models/joomla_components.php | 11 +++++ admin/models/powers.php | 2 +- admin/sql/install.mysql.utf8.sql | 2 +- admin/views/search/tmpl/default.php | 4 ++ componentbuilder.xml | 6 +-- componentbuilder_update_server.xml | 4 +- .../{Registry.php => BaseConfig.php} | 4 +- .../Abstraction/BaseRegistry.php | 49 +++++++++++++++++++ .../src/Componentbuilder/Compiler/Config.php | 4 +- .../src/Componentbuilder/Compiler/Factory.php | 35 ++++++++----- .../Componentbuilder/Compiler/Registry.php | 27 +--------- .../src/Componentbuilder/Search/Config.php | 4 +- .../src/Componentbuilder/Search/Factory.php | 12 +++-- .../VDM.Joomla/src/Utilities/GetHelper.php | 30 ++++++------ script.php | 2 +- 18 files changed, 136 insertions(+), 81 deletions(-) rename libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/{Registry.php => BaseConfig.php} (94%) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/BaseRegistry.php diff --git a/README.md b/README.md index 3910a0eee..fce66bb47 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.8) 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.9) 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,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th October, 2022 -+ *Version*: 3.1.8 ++ *Last Build*: 23rd October, 2022 ++ *Version*: 3.1.9 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **332785** ++ *Line count*: **332840** + *Field count*: **2004** -+ *File count*: **2173** ++ *File count*: **2174** + *Folder count*: **378** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 3910a0eee..fce66bb47 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.8) 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.9) 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,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th October, 2022 -+ *Version*: 3.1.8 ++ *Last Build*: 23rd October, 2022 ++ *Version*: 3.1.9 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **332785** ++ *Line count*: **332840** + *Field count*: **2004** -+ *File count*: **2173** ++ *File count*: **2174** + *Folder count*: **378** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 19e0214b1..cfb5142f5 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -9215,6 +9215,7 @@ COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST="The COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA="The url (%s) set to retrieve the packages does not return any data!" COM_COMPONENTBUILDER_THE_WIKI_CAN_ONLY_BE_LOADED_WHEN_YOUR_JCB_SYSTEM_HAS_INTERNET_CONNECTION="The wiki can only be loaded when your JCB system has internet connection." COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading" +COM_COMPONENTBUILDER_THIS_AREA_IS_STILL_UNDER_DEVELOPMENT_AND_DOES_NOT_WORK="This area is still under development and does not work." COM_COMPONENTBUILDER_THIS_BSB_IS_NOT_LINKED_TO_ANY_OTHER_AREAS_OF_JCB_AT_THIS_TIME="This %s is not linked to any other areas of JCB at this time!" COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT="This may take a while depending on the size of your project." COM_COMPONENTBUILDER_THIS_PACKAGE_BPASSEDB_THE_CHECKSUM_VALIDATIONBR_BR_SMALLMANUALLY_ALSO_VALIDATE_THAT_THE_CORRECT_CHECKSUM_WAS_USEDSMALLBR_THIS_CHECKSUM_BSB_MUST_BE_THE_SAME_AS_THE_ONE_FOUND_A_S_SA="This package PASSED the checksum validation!

    Manually also validate that the correct checksum was used.
    This checksum: %s must be the same as the one found @ " diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 64d70fde8..145aa306d 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -693,17 +693,26 @@ class ComponentbuilderModelJoomla_components extends ListModel { $values = json_decode($values, true); } + // let's check for just a string or int + elseif (is_string($values) || (is_numeric($values) && $values > 0)) + { + $values = [$values]; + } + // make sure we have an array of values if (!ComponentbuilderHelper::checkArray($values, true) || !ComponentbuilderHelper::checkString($table) || !ComponentbuilderHelper::checkString($key)) { return false; } + // start the query $query = $this->_db->getQuery(true); // Select some fields $query->select(array('a.*')); + // From the componentbuilder_ANY table $query->from($this->_db->quoteName('#__componentbuilder_'. $table, 'a')); + // check if this is an array of integers if ($this->is_numeric($values)) { @@ -722,12 +731,14 @@ class ComponentbuilderModelJoomla_components extends ListModel return $this->_db->quote($var); }, $values)) . ')'); } + // Implement View Level Access if (!$this->user->authorise('core.options', 'com_componentbuilder')) { $groups = implode(',', $this->user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ')'); } + // Order the results by ordering $query->order('a.ordering ASC'); // Load the items diff --git a/admin/models/powers.php b/admin/models/powers.php index 9a3f0a281..ddeb3149d 100644 --- a/admin/models/powers.php +++ b/admin/models/powers.php @@ -271,7 +271,7 @@ class ComponentbuilderModelPowers extends ListModel else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.name LIKE '.$search.')'); + $query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.name LIKE '.$search.')'); } } diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index aa399d72b..a01155039 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1983,7 +1983,7 @@ INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `exten (14, '', 'Control the naming of a namespace helper\r\n\r\n@since 3.0.9', '', '', 'ce8cf834-6bac-44fb-941c-861f7e046cc0', '', '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1cm4gdHJpbSggcHJlZ19yZXBsYWNlKCIvMSsvIiwgJ1xcJywgJHN0cmluZykpOw0KCQl9DQoJCS8vIG5vdCBhIHN0cmluZw0KCQlyZXR1cm4gJyc7DQoJfQ0K', '{}', 'NamespaceHelper', 'VDM\\Joomla\\Utilities.String.NamespaceHelper', '1.0.0', '{}', 'String Namespace Helper', 'abstract class', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"}}', '', 1, '2022-03-08 23:27:57', '2022-09-20 10:09:58', 16, 5), (15, 1, 'Control the naming of a field type\r\n\r\n@since 3.0.9', '', '', 'a8935cbe-7701-40dc-bfd5-675f2d600954', 'dXNlIEpvb21sYVxDTVNcQ29tcG9uZW50XENvbXBvbmVudEhlbHBlcjs=', '', '', '{}', 'CS8qKg0KCSAqIFRoZSBmaWVsZCBidWlsZGVyIHN3aXRjaA0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwcm90ZWN0ZWQgc3RhdGljICRidWlsZGVyID0gZmFsc2U7DQoNCgkvKioNCgkgKiBNYWtpbmcgZmllbGQgdHlwZSBuYW1lIHNhZmUNCgkgKg0KCSAqIEBwYXJhbSAgIFN0cmluZyAgICAgICRzdHJpbmcgICAgIFRoZSB5b3Ugd291bGQgbGlrZSB0byBtYWtlIHNhZmUNCgkgKiBAcGFyYW0gICBTdHJpbmcgICAgICAkb3B0aW9uICAgIFRoZSBvcHRpb24gZm9yIHRoZSBjb21wb25lbnQuDQoJICoNCgkgKiBAcmV0dXJucyBzdHJpbmcgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIHNhZmUoJHN0cmluZywgJG9wdGlvbiA9IG51bGwpDQoJew0KCQkvLyBnZXQgZ2xvYmFsIHZhbHVlDQoJCWlmIChzZWxmOjokYnVpbGRlciA9PT0gZmFsc2UpDQoJC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yB1c2UgdGhlIGRlZmF1bHQgKG9yaWdpbmFsIGJlaGF2aW91ci9jb252ZW50aW9uKQ0KCQlyZXR1cm4gU3RyaW5nSGVscGVyOjpzYWZlKCRzdHJpbmcpOw0KCX0NCg==', '{}', 'TypeHelper', 'VDM\\Joomla\\Utilities.String.TypeHelper', '1.0.0', '{}', 'String Type Helper', 'abstract class', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-08 23:33:09', '2022-09-20 10:10:03', 15, 5), (16, '', 'Control the naming of a class and function\r\n\r\n@since 3.0.9', '', '', '30c5b4c2-f75f-4d15-869a-f8bfedd87358', '', '', '', '{}', 'CS8qKg0KCSAqIE1ha2luZyBjbGFzcyBvciBmdW5jdGlvbiBuYW1lIHNhZmUNCgkgKg0KCSAqIEBpbnB1dAlzdHJpbmcgICAgICAgVGhlIG5hbWUgeW91IHdvdWxkIGxpa2UgdG8gbWFrZSBzYWZlDQoJICoNCgkgKiBAcmV0dXJucyBzdHJpbmcgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIHNhZmUoJG5hbWUpDQoJew0KCQkvLyByZW1vdmUgbnVtYmVycyBpZiB0aGUgZmlyc3QgY2hhcmFjdGVyIGlzIGEgbnVtYmVyDQoJCWlmIChpc19udW1lcmljKHN1YnN0cigkbmFtZSwgMCwgMSkpKQ0KCQl7DQoJCQkkbmFtZSA9IFN0cmluZ0hlbHBlcjo6bnVtYmVycygkbmFtZSk7DQoJCX0NCg0KCQkvLyByZW1vdmUgYWxsIHNwYWNlcyBhbmQgc3RyYW5nZSBjaGFyYWN0ZXJzDQoJCXJldHVybiB0cmltKHByZWdfcmVwbGFjZSgiL1teQS1aYS16MC05Xy1dLyIsICcnLCAkbmFtZSkpOw0KCX0NCg==', '{}', 'ClassfunctionHelper', 'VDM\\Joomla\\Utilities.String.ClassfunctionHelper', '1.0.0', '{}', 'String Classfunction Helper', 'abstract class', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"}}', '', 1, '2022-03-08 23:43:10', '2022-09-20 10:10:07', 15, 5), -(17, 1, 'Some easy get...\r\n\r\n@since 3.0.9', '', '', 'db87c339-5bb6-4291-a7ef-2c48ea1b06bc', 'dXNlIEpvb21sYVxDTVNcRmFjdG9yeTs=', '', '', '{\"load_selection0\":{\"load\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\"},\"load_selection1\":{\"load\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\"}}', 'CS8qKg0KCSAqIEdldCBhIFZhcmlhYmxlIA0KCSAqDQoJICogQHBhcmFtICAgc3RyaW5nICAgJHRhYmxlICAgICAgICBUaGUgdGFibGUgZnJvbSB3aGljaCB0byBnZXQgdGhlIHZhcmlhYmxlDQoJICogQHBhcmFtICAgc3RyaW5nICAgJHdoZXJlICAgICAgICBUaGUgdmFsdWUgd2hlcmUNCgkgKiBAcGFyYW0gICBzdHJpbmcgICAkd2hlcmVTdHJpbmcgIFRoZSB0YXJnZXQvZmllbGQgc3RyaW5nIHdoZXJlL25hbWUNCgkgKiBAcGFyYW0gICBzdHJpbmcgICAkd2hhdCAgICAgICAgIFRoZSByZXR1cm4gZmllbGQNCgkgKiBAcGFyYW0gICBzdHJpbmcgICAkb3BlcmF0b3IgICAgIFRoZSBvcGVyYXRvciBiZXR3ZWVuICR3aGVyZVN0cmluZy9maWVsZCBhbmQgJHdoZXJlL3ZhbHVlDQoJICogQHBhcmFtICAgc3RyaW5nICAgJG1haW4gICAgICAgICBUaGUgY29tcG9uZW50IGluIHdoaWNoIHRoZSB0YWJsZSBpcyBmb3VuZA0KCSAqDQoJICogQHJldHVybiAgbWl4ZWQgc3RyaW5nL2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ICRjb250ZW50LCBzdHJpbmcgJHN0YXJ0LCBzdHJpbmcgJGVuZCwgc3RyaW5nICRkZWZhdWx0ID0gJycpOiBzdHJpbmcNCgl7DQoJCSRhcnJheSA9IGV4cGxvZGUoJHN0YXJ0LCAkY29udGVudCk7DQoJCWlmIChpc3NldCgkYXJyYXlbMV0pICYmIHN0cnBvcygkYXJyYXlbMV0sICRlbmQpICE9PSBmYWxzZSkNCgkJew0KCQkJJGFycmF5ID0gZXhwbG9kZSgkZW5kLCAkYXJyYXlbMV0pOw0KDQoJCQkvLyByZXR1cm4gc3RyaW5nIGZvdW5kIGJldHdlZW4NCgkJCXJldHVybiAkYXJyYXlbMF07DQoJCX0NCg0KCQlyZXR1cm4gJGRlZmF1bHQ7DQoJfQ0K', '{}', 'GetHelper', 'VDM\\Joomla\\Utilities.GetHelper', '1.0.0', '{}', 'Utilities GetHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-09 00:21:06', '2022-10-20 14:18:47', 24, 9), +(17, 1, 'Some easy get...\r\n\r\n@since 3.0.9', '', '', 'db87c339-5bb6-4291-a7ef-2c48ea1b06bc', 'dXNlIEpvb21sYVxDTVNcRmFjdG9yeTs=', '', '', '{\"load_selection0\":{\"load\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\"},\"load_selection1\":{\"load\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\"}}', 'CS8qKg0KCSAqIEdldCBhIFZhcmlhYmxlIA0KCSAqDQoJICogQHBhcmFtICAgc3RyaW5nfG51bGwgICR0YWJsZSAgICAgICAgVGhlIHRhYmxlIGZyb20gd2hpY2ggdG8gZ2V0IHRoZSB2YXJpYWJsZQ0KCSAqIEBwYXJhbSAgIG1peGVkICAgICAgICAkd2hlcmUgICAgICAgIFRoZSB2YWx1ZSB3aGVyZQ0KCSAqIEBwYXJhbSAgIHN0cmluZyAgICAgICAkd2hlcmV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RlbnQgdG8gc2VhcmNoDQoJICogQHBhcmFtICBzdHJpbmcgICAgICAgJHN0YXJ0ICAgICAgVGhlIHN0YXJ0aW5nIHZhbHVlDQoJICogQHBhcmFtICBzdHJpbmcgICAgICAgJGVuZCAgICAgICAgVGhlIGVuZGluZyB2YWx1ZQ0KCSAqIEBwYXJhbSAgc3RyaW5nICAgICAgICRkZWZhdWx0ICAgIFRoZSBkZWZhdWx0IHZhbHVlIGlmIG5vbmUgZm91bmQNCgkgKg0KCSAqIEByZXR1cm4gIHN0cmluZyAgICAgICAgICBPbiBzdWNjZXNzIC8gZW1wdHkgc3RyaW5nIG9uIGZhaWx1cmUNCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBiZXR3ZWVuKHN0cmluZyAkY29udGVudCwgc3RyaW5nICRzdGFydCwgc3RyaW5nICRlbmQsIHN0cmluZyAkZGVmYXVsdCA9ICcnKTogc3RyaW5nDQoJew0KCQkkYXJyYXkgPSBleHBsb2RlKCRzdGFydCwgJGNvbnRlbnQpOw0KCQlpZiAoaXNzZXQoJGFycmF5WzFdKSAmJiBzdHJwb3MoJGFycmF5WzFdLCAkZW5kKSAhPT0gZmFsc2UpDQoJCXsNCgkJCSRhcnJheSA9IGV4cGxvZGUoJGVuZCwgJGFycmF5WzFdKTsNCg0KCQkJLy8gcmV0dXJuIHN0cmluZyBmb3VuZCBiZXR3ZWVuDQoJCQlyZXR1cm4gJGFycmF5WzBdOw0KCQl9DQoNCgkJcmV0dXJuICRkZWZhdWx0Ow0KCX0NCg==', '{}', 'GetHelper', 'VDM\\Joomla\\Utilities.GetHelper', '1.0.0', '{}', 'Utilities GetHelper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-09 00:21:06', '2022-10-21 15:26:39', 27, 9), (18, '', 'Some object tricks\r\n\r\n@since 3.0.9', '', '', '91004529-94a9-4590-b842-e7c6b624ecf5', '', '', '', '{}', 'CS8qKg0KCSAqIENoZWNrIGlmIGhhdmUgYW4gb2JqZWN0IHdpdGggYSBsZW5ndGgNCgkgKg0KCSAqIEBpbnB1dAlvYmplY3QgICBUaGUgb2JqZWN0IHRvIGNoZWNrDQoJICoNCgkgKiBAcmV0dXJucyBib29sIHRydWUgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGNoZWNrKCRvYmplY3QpDQoJew0KCQlpZiAoaXNfb2JqZWN0KCRvYmplY3QpKQ0KCQl7DQoJCQlyZXR1cm4gY291bnQoKGFycmF5KSAkb2JqZWN0KSA+IDA7DQoJCX0NCg0KCQlyZXR1cm4gZmFsc2U7DQoJfQ0K', '{}', 'ObjectHelper', 'VDM\\Joomla\\Utilities.ObjectHelper', '1.0.0', '{}', 'Utilities Object Helper', 'abstract class', '{}', '', 1, '2022-03-09 00:35:23', '2022-09-20 09:51:31', 15, 8), (19, '', 'Basic Math Helper\r\n\r\n@since 3.0.9', '', '', '152c8793-8b75-4715-996a-257b9f65451c', '', '', '', '{}', 'CS8qKg0KCSAqIGJjIG1hdGggd3JhcHBlciAodmVyeSBiYXNpYyBub3QgZm9yIGFjY291bnRpbmcpDQoJICoNCgkgKiBAcGFyYW0gICBzdHJpbmcgICAkdHlwZSAgICBUaGUgdHlwZSBiYyBtYXRoDQoJICogQHBhcmFtICAgaW50ICAgICAgJHZhbDEgICAgVGhlIGZpcnN0IHZhbHVlDQoJICogQHBhcmFtICAgaW50ICAgICAgJHZhbDIgICAgVGhlIHNlY29uZCB2YWx1ZQ0KCSAqIEBwYXJhbSAgIGludCAgICAgICRzY2FsZSAgIFRoZSBzY2FsZSB2YWx1ZQ0KCSAqDQoJICogQHJldHVybiBpbnQNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbi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0NCgkJLy8gZmFsbCBiYWNrIG9uIGFycmF5IHN1bQ0KCQlyZXR1cm4gYXJyYXlfc3VtKCRhcnJheSk7DQoJfQ0K', '{}', 'MathHelper', 'VDM\\Joomla\\Utilities.MathHelper', '1.0.0', '{}', 'Utilities Math Helper', 'abstract class', '{}', '', 1, '2022-03-09 13:05:39', '2022-09-20 09:51:26', 11, 9), (20, '', 'Control the naming of a plugin\r\n\r\n@since 3.0.9', '', '', '3cf76fbf-fd95-4a33-878e-7aff6d36b7f6', '', '', '', '{}', 'CS8qKg0KCSAqIE1ha2luZyBwbHVnaW4gZm9sZGVyIG5hbWUgc2FmZQ0KCSAqDQoJICogQGlucHV0CXN0cmluZyAgICAkY29kZU5hbWUgICBUaGUgbmFtZQ0KCSAqIEBpbnB1dAlzdHJpbmcgICAgJGdyb3VwICAgVGhlIGdyb3VwIG5hbWUNCgkgKg0KCSAqIEByZXR1cm5zIHN0cmluZyBvbiBzdWNjZXNzDQoJICogDQoJICogQHNpbmNlICAzLjAuOQ0KCSAqLw0KCXB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gc2FmZUZvbGRlck5hbWUoJGNvZGVOYW1lLCAkZ3JvdXApDQoJew0KCQkvLyBlZGl0b3JzLXh0ZCBncm91cCBwbHVnaW5zIG11c3QgaGF2ZSBhIGNsYXNzIHdpdGggcGxnQnV0dG9uPFBsdWdpbk5hbWU+IHN0cnVjdHVyZQ0KCQlpZiAoJGdyb3VwID09PSAnZWRpdG9ycy14dGQnKQ0KCQl7DQoJCQkkZ3JvdXAgPSAnQnV0dG9uJzsNCgkJfQ0KDQoJCXJldHVybiAncGxnXycgLiBzdHJ0b2xvd2VyKCRncm91cCkgLiAnXycgLiBzdHJ0b2xvd2VyKA0KCQkJJGNvZGVOYW1lDQoJCSk7DQoJfQ0KDQoJLyoqDQoJICogTWFraW5nIHBsdWdpbiBjbGFzcyBuYW1lIHNhZmUNCgkgKg0KCSAqIEBpbnB1dAlzdHJpbmcgICAgJGNvZGVO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T09ICdlZGl0b3JzLXh0ZCcpDQoJCXsNCgkJCSRncm91cCA9ICdCdXR0b24nOw0KCQl9DQoNCgkJcmV0dXJuICdwbGcnIC4gdWNmaXJzdCgkZ3JvdXApIC4gdWNmaXJzdCgNCgkJCSRjb2RlTmFtZQ0KCQkpIC4gJ0luc3RhbGxlclNjcmlwdCc7DQoJfQ0KDQoJLyoqDQoJICogTWFraW5nIGxhbmd1YWdlIHByZWZpeCBzYWZlDQoJICoNCgkgKiBAaW5wdXQJc3RyaW5nICAgICRjb2RlTmFtZSAgIFRoZSBuYW1lDQoJICogQGlucHV0CXN0cmluZyAgICAkZ3JvdXAgICBUaGUgZ3JvdXAgbmFtZQ0KCSAqDQoJICogQHJldHVybnMgc3RyaW5nIG9uIHN1Y2Nlc3MNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBzYWZlTGFuZ1ByZWZpeCgkY29kZU5hbWUsICRncm91cCkNCgl7DQoJCS8vIGVkaXRvcnMteHRkIGdyb3VwIHBsdWdpbnMgbXVzdCBoYXZlIGEgY2xhc3Mgd2l0aCBwbGdCdXR0b248UGx1Z2luTmFtZT4gc3RydWN0dXJlDQoJCWlmICgkZ3JvdXAgPT09ICdlZGl0b3JzLXh0ZCcpDQoJCXsNCgkJCSRncm91cCA9ICdCdXR0b24nOw0KCQl9DQoNCgkJcmV0dXJuICdQTEdfJyAuIHN0cnRvdXBwZXIoJGdyb3VwKSAuICdfJyAuIHN0cnRvdXBwZXIoDQoJCQkkY29kZU5hbWUNCgkJKTsNCgl9DQo=', '{}', 'PluginHelper', 'VDM\\Joomla\\Utilities.String.PluginHelper', '1.0.0', '{}', 'String Plugin Helper', 'abstract class', '{}', '', 1, '2022-03-09 14:44:58', '2022-09-20 10:10:12', 14, 5), diff --git a/admin/views/search/tmpl/default.php b/admin/views/search/tmpl/default.php index a19313068..90394fe94 100644 --- a/admin/views/search/tmpl/default.php +++ b/admin/views/search/tmpl/default.php @@ -37,6 +37,10 @@ $selectNotice .= '

    ' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT') item->id)) ? '&id='. (int) $this->item->id : ''; ?> +

    +
    sidebar)): ?>
    sidebar; ?> diff --git a/componentbuilder.xml b/componentbuilder.xml index 840ddb7db..4382d26e3 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 20th October, 2022 + 23rd October, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 3.1.8 + 3.1.9 Component Builder (v.3.1.8)

    +

    Component Builder (v.3.1.9)

    The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index cce9c4b17..8e3c099fc 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -1097,10 +1097,10 @@ pkg_component_builder package site - 3.1.8 + 3.1.9 https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.8.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.9.zip stable diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/Registry.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/BaseConfig.php similarity index 94% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/Registry.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/BaseConfig.php index b3a36519f..4cfe4a71b 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/Registry.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/BaseConfig.php @@ -20,11 +20,11 @@ use VDM\Joomla\Utilities\String\ClassfunctionHelper; /** - * Registry + * Config * * @since 3.2.0 */ -abstract class Registry extends JoomlaRegistry +abstract class BaseConfig extends JoomlaRegistry { /** * Hold a JInput object for easier access to the input variables. diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/BaseRegistry.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/BaseRegistry.php new file mode 100644 index 000000000..105b818a0 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/BaseRegistry.php @@ -0,0 +1,49 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Abstraction; + + +use Joomla\Registry\Registry as JoomlaRegistry; + + +/** + * Registry + * + * So we have full control over this class + * + * @since 3.2.0 + */ +abstract class BaseRegistry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable +{ + /** + * Method to iterate over any part of the registry + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * + * @return \ArrayIterator This object represented as an ArrayIterator. + * + * @since 3.4.0 + */ + public function _($path) + { + $data = $this->extract($path); + + if ($data === null) + { + return null; + } + + return $data->getIterator(); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php index aeff2fe86..59a3e5e2c 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -14,7 +14,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Componentbuilder\Abstraction\Registry; +use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig; /** @@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Abstraction\Registry; * * @since 3.2.0 */ -class Config extends Registry +class Config extends BaseConfig { /** * get posted component id diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php index 6fa761580..135c4b9d4 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Factory.php @@ -13,6 +13,16 @@ namespace VDM\Joomla\Componentbuilder\Compiler; use Joomla\DI\Container; +use VDM\Joomla\Componentbuilder\Compiler\Service\Compiler; +use VDM\Joomla\Componentbuilder\Compiler\Service\Event; +use VDM\Joomla\Componentbuilder\Compiler\Service\History; +use VDM\Joomla\Componentbuilder\Compiler\Service\Language; +use VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Service\Customcode; +use VDM\Joomla\Componentbuilder\Compiler\Service\Power; +use VDM\Joomla\Componentbuilder\Compiler\Service\Component; +use VDM\Joomla\Componentbuilder\Compiler\Service\Extension; +use VDM\Joomla\Componentbuilder\Compiler\Service\Field; /** @@ -43,7 +53,7 @@ abstract class Factory * * @param string $key The container class key * - * @return Mixed + * @return mixed * @since 3.2.0 */ public static function _($key) @@ -56,7 +66,7 @@ abstract class Factory * * @param string $key The container class key * - * @return Mixed + * @return mixed * @since 3.2.0 */ public static function _J($key) @@ -94,20 +104,19 @@ abstract class Factory protected static function createContainer(): Container { $container = (new Container()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Compiler()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Event()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\History()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Language()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Placeholder()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Customcode()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Power()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Component()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Extension()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Compiler\Service\Field()); + ->registerServiceProvider(new Compiler()) + ->registerServiceProvider(new Event()) + ->registerServiceProvider(new History()) + ->registerServiceProvider(new Language()) + ->registerServiceProvider(new Placeholder()) + ->registerServiceProvider(new Customcode()) + ->registerServiceProvider(new Power()) + ->registerServiceProvider(new Component()) + ->registerServiceProvider(new Extension()) + ->registerServiceProvider(new Field()); return $container; } - } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php index 0400c1782..a0cfeb17a 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php @@ -12,18 +12,16 @@ namespace VDM\Joomla\Componentbuilder\Compiler; -use Joomla\Registry\Registry as JoomlaRegistry; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; +use VDM\Joomla\Componentbuilder\Abstraction\BaseRegistry; /** * Compiler Registry * - * So we have full control over this class - * * @since 3.2.0 */ -class Registry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable +class Registry extends BaseRegistry { /** * Default indentation value @@ -33,27 +31,6 @@ class Registry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess */ protected $indent = 2; - /** - * Method to iterate over any part of the registry - * - * @param string $path Registry path (e.g. joomla.content.showauthor) - * - * @return \ArrayIterator This object represented as an ArrayIterator. - * - * @since 3.4.0 - */ - public function _($path) - { - $data = $this->extract($path); - - if ($data === null) - { - return null; - } - - return $data->getIterator(); - } - /** * Method to export a set of values to a PHP array * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php index 7a9690c0a..aef0bc5b7 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php @@ -12,7 +12,7 @@ namespace VDM\Joomla\Componentbuilder\Search; -use VDM\Joomla\Componentbuilder\Abstraction\Registry; +use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig; /** @@ -20,7 +20,7 @@ use VDM\Joomla\Componentbuilder\Abstraction\Registry; * * @since 3.2.0 */ -class Config extends Registry +class Config extends BaseConfig { /** * get posted search value diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php index e07a0fd91..54c2e9e18 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php @@ -13,6 +13,10 @@ namespace VDM\Joomla\Componentbuilder\Search; use Joomla\DI\Container; +use VDM\Joomla\Componentbuilder\Search\Service\Search; +use VDM\Joomla\Componentbuilder\Search\Service\Model; +use VDM\Joomla\Componentbuilder\Search\Service\Database; +use VDM\Joomla\Componentbuilder\Search\Service\Agent; /** @@ -68,10 +72,10 @@ abstract class Factory protected static function createContainer(): Container { $container = (new Container()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Search()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Model()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Database()) - ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Agent()); + ->registerServiceProvider(new Search()) + ->registerServiceProvider(new Model()) + ->registerServiceProvider(new Database()) + ->registerServiceProvider(new Agent()); return $container; } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php index 91a3a61a5..f58409767 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php @@ -26,17 +26,17 @@ abstract class GetHelper /** * Get a Variable * - * @param string $table The table from which to get the variable - * @param string $where The value where - * @param string $whereString The target/field string where/name - * @param string $what The return field - * @param string $operator The operator between $whereString/field and $where/value - * @param string $main The component in which the table is found + * @param string|null $table The table from which to get the variable + * @param mixed $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found * * @return mixed string/int/float * @since 3.0.9 */ - public static function var(string $table, ?string $where = null, + public static function var(?string $table = null, $where = null, string $whereString = 'user', string $what = 'id', string $operator = '=', ?string $main = null) { @@ -93,18 +93,18 @@ abstract class GetHelper /** * Get array of variables * - * @param string $table The table from which to get the variables - * @param string $where The value where - * @param string $whereString The target/field string where/name - * @param string $what The return field - * @param string $operator The operator between $whereString/field and $where/value - * @param string $main The component in which the table is found - * @param bool $unique The switch to return a unique array + * @param string|null $table The table from which to get the variables + * @param mixed $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * @param bool $unique The switch to return a unique array * * @return array|null * @since 3.0.9 */ - public static function vars(string $table, ?string $where = null, + public static function vars(?string $table = null, $where = null, string $whereString = 'user', string $what = 'id', string $operator = 'IN', ?string $main = null, bool $unique = true): ?array { diff --git a/script.php b/script.php index 259113b68..080711acf 100644 --- a/script.php +++ b/script.php @@ -9422,7 +9422,7 @@ class com_componentbuilderInstallerScript echo ' -

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

    '; +

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

    '; // Set db if not set already. if (!isset($db)) -- 2.45.1 From f2ea22d0ad4dac154ffca9ece9dd4502b848c4ee Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Mon, 31 Oct 2022 00:34:54 +0200 Subject: [PATCH 21/49] Continued development on the search feature --- README.md | 8 +- admin/README.txt | 8 +- admin/assets/js/search.js | 366 ++--- admin/controllers/ajax.json.php | 12 +- .../en-GB/en-GB.com_componentbuilder.ini | 2 + admin/layouts/rows.php | 43 + admin/layouts/table.php | 72 + admin/models/ajax.php | 35 +- admin/sql/install.mysql.utf8.sql | 4 +- admin/views/search/tmpl/default.php | 142 +- admin/views/search/view.html.php | 62 +- componentbuilder.xml | 3 +- .../src/Componentbuilder/Search/Agent.php | 174 ++- .../Componentbuilder/Search/Engine/Basic.php | 2 +- .../Search/Interfaces/GetInterface.php | 6 +- .../Componentbuilder/Search/Service/Agent.php | 4 +- .../VDM.Joomla/src/Utilities/StringHelper.php | 4 +- media/datatable/css/datatables.min.css | 57 + media/datatable/css/index.html | 1 + media/datatable/index.html | 1 + media/datatable/js/datatables.min.js | 1238 +++++++++++++++++ media/datatable/js/index.html | 1 + media/datatable/js/pdfmake.min.js | 3 + media/datatable/js/vfs_fonts.js | 6 + 24 files changed, 1907 insertions(+), 347 deletions(-) create mode 100644 admin/layouts/rows.php create mode 100644 admin/layouts/table.php create mode 100644 media/datatable/css/datatables.min.css create mode 100644 media/datatable/css/index.html create mode 100644 media/datatable/index.html create mode 100644 media/datatable/js/datatables.min.js create mode 100644 media/datatable/js/index.html create mode 100644 media/datatable/js/pdfmake.min.js create mode 100644 media/datatable/js/vfs_fonts.js diff --git a/README.md b/README.md index fce66bb47..a3130edd2 100644 --- a/README.md +++ b/README.md @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 23rd October, 2022 ++ *Last Build*: 30th October, 2022 + *Version*: 3.1.9 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **332840** ++ *Line count*: **333093** + *Field count*: **2004** -+ *File count*: **2174** -+ *Folder count*: **378** ++ *File count*: **2183** ++ *Folder count*: **381** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index fce66bb47..a3130edd2 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,14 +140,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 23rd October, 2022 ++ *Last Build*: 30th October, 2022 + *Version*: 3.1.9 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **332840** ++ *Line count*: **333093** + *Field count*: **2004** -+ *File count*: **2174** -+ *Folder count*: **378** ++ *File count*: **2183** ++ *Folder count*: **381** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/assets/js/search.js b/admin/assets/js/search.js index 0b439743f..d82a07a7d 100644 --- a/admin/assets/js/search.js +++ b/admin/assets/js/search.js @@ -14,38 +14,36 @@ */ const doSearch = async (signal, tables) => { try { - let searchValue = document.querySelector('input[name="search_value"]').value; - let replaceValue = document.querySelector('input[name="replace_value"]').value; + // build form + const formData = new FormData(); + + // load the result table + const resultsTable = new DataTable('#search_results_table'); + + // set some search values + let searchValue = searchObject.value; + let replaceValue = replaceObject.value; + + // add the form data + formData.append('table_name', ''); + formData.append('search_value', searchValue); + formData.append('replace_value', replaceValue); + formData.append('match_case', matchObject.checked ? 1 : 0); + formData.append('whole_word', wholeObject.checked ? 1 : 0); + formData.append('regex_search', regexObject.checked ? 1 : 0); - // Display 'loading' message in search results message div - document.getElementById('search-mssg-box').innerHTML = - '' + - '
    ' + - ' 0% ' + - 'Loading for search text: ' + searchValue + '' - ; - // Clear results table - let search_loading_percent = document.getElementById('search-loading-percent'); - let tbl_obj_body = document.getElementById('search-results-tbl-tbody'); - tbl_obj_body.innerHTML = ''; let abort_this_search_value = false; let total = 0; let index; - for (index = 0; index < searchTables.length; index++) { - const formData = new FormData(); - let tableName = searchTables[index]; + for (index = 0; index < tables.length; index++) { - formData.append('table_name', ''); - formData.append('search_value', searchValue); - formData.append('replace_value', replaceValue); - formData.append('match_case', document.querySelector('input[name="match_case"]').checked ? 1 : 0); - formData.append('whole_word', document.querySelector('input[name="whole_word"]').checked ? 1 : 0); - formData.append('regex_search', document.querySelector('input[name="regex_search"]').checked ? 1 : 0); - formData.append('table_name', tableName); + let tableName = tables[index]; + + // add the table name + formData.set('table_name', tableName); - let url = document.getElementById('adminForm').getAttribute('action') + '&layout=dosearch'; let options = { signal: signal, method: 'POST', // *GET, POST, PUT, DELETE, etc. @@ -56,71 +54,19 @@ const doSearch = async (signal, tables) => { console.log('Aborting this searchValue:' + searchValue); break; } - console.log(total + ' -- SEARCHING: ' + searchValue + ' @[' + tableName + ']'); - const response = await fetch(url, options) - // Note: response.text() is a promise ... - .then(response => { - total++; - //console.log(total + ' ' + sTables.length); - if (sTables.length == total) setTimeout(function () { - document.getElementById('search-mssg-box').innerHTML = ''; - }, 200); - - response.text().then(data => { - console.log('++ Fetched for ' + searchValue + ' [' + tableName + ']'); - let percent = 100.0 * (total / sTables.length); - search_loading_percent.innerHTML = '' + percent.toFixed(2) + '%'; - document.getElementById('search-loading-progressbar').value = percent; - - let use_json = false, json_data = false, items = false; - if (use_json) { - try { - json_data = data ? JSON.parse(data) : false; - items = json_data ? json_data.items : false; - } catch (error) { - console.log(error); - } - } - - // Very fast and low memory display HTML table row prepared server-side via PHP instead of JS !! - if (!json_data) { - tbl_obj_body.innerHTML = tbl_obj_body.innerHTML + data; - } - - // Very slow fast and very high memory: Display HTML table rows by creating them now in browser (client-side) via JS instead of using PHP - if (json_data && items) { - let table_rows = ''; - for (const [row_num, row_field_vals] of Object.entries(items)) { - for (const [fname, fvals] of Object.entries(row_field_vals)) { - for (const [line, fval] of Object.entries(fvals)) { - let lnk = 'getFSText(this, \'' + tableName + '\', ' + row_num + ', \'' + fname + '\', line)'; - let val = fval; - val = val.replaceAll(marker_start, ''); - val = val.replaceAll(marker_end, ''); - table_rows = table_rows + '' + - '' + val + '' + - '' + tableName + '' + - '' + fname + '' + - '' + row_num + '' + - '' + line + '' + - ''; - } - } - } - tbl_obj_body.innerHTML = tbl_obj_body.innerHTML + table_rows; - } // END IF json_data && items - - }); - }) - .catch(error => { - total++; - if (sTables.length == total) document.getElementById('search-mssg-box').innerHTML = ''; - // Stop further searches for this search value - if (error.name === "AbortError") abort_this_search_value = true; - error.name === "AbortError" - ? console.log(" ... ABORTED fetch() for: " + searchValue) - : console.log(error.toString()); - }); + const response = await fetch(Url + 'doSearch', options).then(response => { + total++; + if (response.ok) { + return response.json(); + } + }).then((data) => { + if (typeof data.items !== 'undefined') { + console.log('++ Fetched for ' + searchValue + ' [' + tableName + ']'); + addTableItems(resultsTable, data.items); + } + }).catch(error => { + console.log(error); + }); } } catch (error) { console.log(error); @@ -130,183 +76,133 @@ const doSearch = async (signal, tables) => { }; /** - * JS Function to execute the search + * JS Function to fetch selected item */ -const getFSText = async (el, table_name, row_id, field_name, line) => { - let sibling = el.parentNode.firstElementChild; - do { - sibling != el - ? sibling.classList.remove('active') - : sibling.classList.add('active'); - } while (sibling = sibling.nextElementSibling); - +const getSelectedItem = async (table, row, field, line) => { try { + // get the search mode + let mode = modeObject.querySelector('input[type=\'radio\']:checked').value; + + // build form const formData = new FormData(); - formData.append('table_name', table_name); - formData.append('get_full_search_text', 1); - formData.append('row_id', row_id); - formData.append('field_name', field_name); + // get search value + if (mode == 1) { + formData.append('field_name', field); + formData.append('row_id', row); + formData.append('table_name', table); + + // calling URL + getURL = Url + 'getSearchValue'; + } else { + formData.append('field_name', field); + formData.append('row_id', row); + formData.append('line_nr', line); + formData.append('table_name', table); + formData.append('search_value', searchObject.value); + formData.append('replace_value', replaceObject.value); + formData.append('match_case', matchObject.checked ? 1 : 0); + formData.append('whole_word', wholeObject.checked ? 1 : 0); + formData.append('regex_search', regexObject.checked ? 1 : 0); + + // calling URL + getURL = Url + 'getReplaceValue'; + } - //let url = `https://jsonplaceholder.typicode.com/posts/${searchValue}`, - let url = document.getElementById('adminForm').getAttribute('action') + '&layout=dosearch'; let options = { method: 'POST', // *GET, POST, PUT, DELETE, etc. - mode: 'cors', // no-cors, *cors, same-origin - cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached - credentials: 'same-origin', // include, *same-origin, omit - /* - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', //'application/x-www-form-urlencoded', - },*/ - redirect: 'follow', // manual, *follow, error - referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url - // body: JSON.stringify(formData) // body data type must match "Content-Type" header body: formData } - // Clear full text box - document.getElementById('match-full-text-box').innerHTML = 'Loading ...'; - const response = await fetch(url, options) - // Note: response.text() is a promise ... - .then(response => { - response.text().then(data => { - console.log("Fetched full text for row: " + row_id + ' field name: ' + field_name + ' for Table: ' + table_name); - document.getElementById('match-full-text-box').innerHTML = '
    ' - + table_name + ' @ ' + field_name + ': ' + row_id + '
    '; - document.getElementById('match-full-text-box').style.display = ''; - attachCodeMirror(jQuery('#match-full-text'), null); - cm_toggle_fully_searchable('match-full-text', 1); - cm_jumpToLine('match-full-text', line); - //cm_toggle_plain_textarea('match-full-text-box', 1); - }); - }) - .catch(error => { - // Stop further searches for this search value - if (error.name === "AbortError") abort_this_search_value = true; - error.name === "AbortError" - ? console.log(" ... ABORTED fetch() for: " + searchValue) - : console.log(error.toString()); - }); + const response = await fetch(getURL, options).then(response => { + if (response.ok) { + return response.json(); + } + }).then((data) => { + if (typeof data.value !== 'undefined') { + addSelectedItem(data.value, table, row, field, line); + } + }).catch(error => { + console.log(error); + }); } catch (error) { console.log(error); } finally { // Executed regardless if we caught the error } -}; - - -const cm_jumpToLine = function (tag_id, row) -{ - console.log('#' + tag_id); - let codeMirrorEl = jQuery('#' + tag_id).next('.CodeMirror'); - if (!codeMirrorEl.length) return; - let codeMirrorRef = jQuery('#' + tag_id).next('.CodeMirror').get(0).CodeMirror; - let t = codeMirrorRef.charCoords({line: row, ch: 0}, "local").top; - let middleHeight = codeMirrorRef.getScrollerElement().offsetHeight / 2; - codeMirrorRef.scrollTo(null, t - middleHeight - 5); } -/* Attach CodeMirror with optional settings */ -const cm_toggle_fully_searchable = function (el, toggle) -{ - if (typeof CodeMirror === 'undefined') {alert('CodeMirror not loaded'); return;} - - jQuery([el]).each(function(i, tag_id) { - let codeMirrorEl = jQuery('#' + tag_id).next('.CodeMirror'); - if (!codeMirrorEl.length) return; - let codeMirrorRef = jQuery('#' + tag_id).next('.CodeMirror').get(0).CodeMirror; - codeMirrorRef.setOption('viewportMargin', toggle ? '9999' : ''); - }); - -} - -const cm_toggle_plain_textarea = function (el, toggle) -{ - if (typeof CodeMirror === 'undefined') {alert('CodeMirror not loaded'); return;} - - jQuery([el]).each(function(i, tag_id) { - let codeMirrorEl = jQuery('#' + tag_id).next('.CodeMirror'); - if (toggle) { - let options = jQuery('#' + tag_id).data('options'); - options.viewportMargin = jQuery('#cm_toggle_fully_searchable_btn input').prop('checked') ? '9999' : ''; - jQuery('#' + tag_id).prev('p').show(); - attachCodeMirror(jQuery('#' + tag_id), options); - } - else if (codeMirrorEl.length) - { - let codeMirrorRef = codeMirrorEl.get(0).CodeMirror; - jQuery('#' + tag_id).prev('p').hide(); - jQuery('#' + tag_id).css({width: '100%', height: '400px'}); - codeMirrorRef.toTextArea(); - // Remove codemirror container in case that removing it failed - if (jQuery('#' + tag_id).next('.CodeMirror').length) { - jQuery('#' + tag_id).next('.CodeMirror').remove(); - } - } - }); - -} - -const attachCodeMirror = function (txtareas, CMoptions, mode) -{ - CMoptions = typeof CMoptions!=='undefined' && CMoptions ? CMoptions : { - mode: mode || 'application/x-httpd-php', - indentUnit: 2, - lineNumbers: true, - matchBrackets: true, - lineWrapping: true, - onCursorActivity: function(CM) - { - CM.setLineClass(hlLine, null); - hlLine = CM.setLineClass(CM.getCursor().line, 'activeline'); - } - }; - - var editor, theArea; - txtareas.each(function(i, txtarea) +/** + * JS Function to add item to the editor + */ +const addSelectedItem = async (value, table, row, field, line) => { + // display area + if (value.length > 1) { - theArea = jQuery(txtarea); - theArea.removeClass(); // Remove all classes from the textarea - editor = CodeMirror.fromTextArea(theArea.get(0), CMoptions); - editor.refresh(); - }); + editorObject.setValue(value); + editorNoticeObject.innerHTML = 'Table: ' + table + '(id:' + row + ') | Field: ' + field + '(line:' + line + ')'; + } +} - return txtareas.length==1 ? editor : true; +/** + * JS Function to clear item from the editor and hide it + */ +const clearSelectedItem = async () => { + // display area + editorObject.setValue(''); + editorNoticeObject.innerHTML = ''; +} + +/** + * JS Function to clear table items + */ +const clearTableItems = async () => { + let table = new DataTable('#search_results_table'); + table.clear().draw( true ); +} + +/** + * JS Function to clear all details of the search + */ +const clearAll = async () => { + // clear all details + clearTableItems(); + clearSelectedItem(); +} + +/** + * JS Function to add items to the table + */ +const addTableItems = async (table, items) => { + table.rows.add(items).draw( false ); } /** * JS Function to execute (A) on search text change , (B) on search options changes */ const onChange = () => { - const searchValue = searchValueInp.value; + const searchValue = searchObject.value; if (searchValue.length > 2) { // Cancel any ongoing requests if (controller) controller.abort(); + // we clear the table again + clearAll(); + // Create new controller and issue new request controller = new AbortController(); - doSearch(controller.signal, sTables); + + // check if any specific table was set + let tables = []; + let table = tableObject.value; + if (table != -1) { + tables.push(table); + doSearch(controller.signal, tables); + } else { + doSearch(controller.signal, searchTables); + } } else { - // Clear any message in search results message div - //document.getElementById('search-mssg-box').innerHTML = ''; + // Clear the table + clearAll(); } }; - -const previewReplace = () => { - const replaceValue = replaceValueInp.value; - console.log(replaceValueInp); - if (replaceValue.length) { - document.getElementById('search-mssg-box').innerHTML = replaceValue; - } -} - -// Do the search on key up of search or replace input element -searchValueInp.onkeyup = onChange; -replaceValueInp.onkeyup = previewReplace; - -// Do the search on key up of search input element -caseSensitiveLbl.onchange = onChange; -completeWordLbl.onchange = onChange; -regexpSearchLbl.onchange = onChange; diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 3e31a059d..f6271d5a8 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -67,8 +67,8 @@ class ComponentbuilderControllerAjax extends BaseController $this->registerTask('fieldTypeProperties', 'ajax'); $this->registerTask('getFieldPropertyDesc', 'ajax'); $this->registerTask('getCodeGlueOptions', 'ajax'); - $this->registerTask('searchTable', 'ajax'); - $this->registerTask('updateTable', 'ajax'); + $this->registerTask('doSearch', 'ajax'); + $this->registerTask('replaceAll', 'ajax'); $this->registerTask('getSearchValue', 'ajax'); $this->registerTask('getReplaceValue', 'ajax'); $this->registerTask('setValue', 'ajax'); @@ -1636,7 +1636,7 @@ class ComponentbuilderControllerAjax extends BaseController } } break; - case 'searchTable': + case 'doSearch': try { $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); @@ -1647,7 +1647,7 @@ class ComponentbuilderControllerAjax extends BaseController $component_idValue = $jinput->get('component_id', 0, 'INT'); if($table_nameValue && $user->id != 0 && $search_valueValue) { - $result = $this->getModel('ajax')->searchTable($table_nameValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + $result = $this->getModel('ajax')->doSearch($table_nameValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); } else { @@ -1682,7 +1682,7 @@ class ComponentbuilderControllerAjax extends BaseController } } break; - case 'updateTable': + case 'replaceAll': try { $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); @@ -1694,7 +1694,7 @@ class ComponentbuilderControllerAjax extends BaseController $component_idValue = $jinput->get('component_id', 0, 'INT'); if($table_nameValue && $user->id != 0 && $search_valueValue) { - $result = $this->getModel('ajax')->updateTable($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + $result = $this->getModel('ajax')->replaceAll($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); } else { diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index cfb5142f5..2f32d3cd7 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -5448,6 +5448,7 @@ COM_COMPONENTBUILDER_FOLDER_BSB_WAS_MOVED_TO_BSB="Folder %s was moved to COM_COMPONENTBUILDER_FOLDER_BSB_WAS_NOT_MOVED_TO_BSB="Folder %s was not moved to %s" COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE="Force Local Update" COM_COMPONENTBUILDER_FORCE_THAT_THIS_JCB_PACKAGE_IMPORT_SEARCH_FOR_LOCAL_ITEMS_TO_BE_DONE_WITH_GUID_VALUE_ONLY_IF_BMERGEB_IS_SET_TO_YES_ABOVE="Force that this JCB package import (search for local items) to be done with GUID value only, if Merge is set to yes above." +COM_COMPONENTBUILDER_FOUND="Found" COM_COMPONENTBUILDER_FOUND_TEXT="Found Text" COM_COMPONENTBUILDER_FREEOPEN="Free/Open" COM_COMPONENTBUILDER_FULL_TEXT="Full Text" @@ -5493,6 +5494,7 @@ COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder w COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!" COM_COMPONENTBUILDER_GROUP="group" COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata" +COM_COMPONENTBUILDER_HEADERS="Headers" COM_COMPONENTBUILDER_HELP_DOCUMENT="Help Document" COM_COMPONENTBUILDER_HELP_DOCUMENTS="Help Documents" COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS="Help Documents Access" diff --git a/admin/layouts/rows.php b/admin/layouts/rows.php new file mode 100644 index 000000000..5379aea33 --- /dev/null +++ b/admin/layouts/rows.php @@ -0,0 +1,43 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('JPATH_BASE') or die('Restricted access'); + +$headers = $displayData['headers']; +$items = $displayData['items']; + +?> + + $values): ?> + + + + + + + + + + +    + + + + + + + +    + + + + diff --git a/admin/layouts/table.php b/admin/layouts/table.php new file mode 100644 index 000000000..a42bef2cb --- /dev/null +++ b/admin/layouts/table.php @@ -0,0 +1,72 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('JPATH_BASE') or die('Restricted access'); + +$table_id = (isset($displayData['id'])) ? $displayData['id'] : ComponentbuilderHelper::randomkey(7); +$name = (isset($displayData['name'])) ? $displayData['name'] : false; +$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [JText::_('COM_COMPONENTBUILDER_NO'), JText::_('COM_COMPONENTBUILDER_HEADERS'), JText::_('COM_COMPONENTBUILDER_FOUND')]; +$items = (isset($displayData['items'])) ? $displayData['items'] : 6; + +?> +
    + + + + + + + + + + $header): ?> + + + + + + + + + + + + + + + + + + + $headers, 'items' => $items]); ?> + +
    +
    + + + diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 39951a1ec..3f3320249 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -3619,7 +3619,7 @@ class ComponentbuilderModelAjax extends ListModel * @return array|null * @since 3.2.0 **/ - public function searchTable(string $tableName, string $searchValue, + public function doSearch(string $tableName, string $searchValue, int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array { // check if this is a valid table @@ -3633,7 +3633,7 @@ class ComponentbuilderModelAjax extends ListModel SearchFactory::_('Config')->regex_search = $regexSearch; SearchFactory::_('Config')->component_id = $componentId; - if (($items = SearchFactory::_('Agent')->find()) !== null) + if (($items = SearchFactory::_('Agent')->table($tableName)) !== null) { return ['success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), 'items' => $items]; } @@ -3658,7 +3658,7 @@ class ComponentbuilderModelAjax extends ListModel * @return array|null * @since 3.2.0 **/ - public function updateTable(string $tableName, string $searchValue, ?string $replaceValue = null, + public function replaceAll(string $tableName, string $searchValue, ?string $replaceValue = null, int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array { // check if this is a valid table @@ -3673,7 +3673,7 @@ class ComponentbuilderModelAjax extends ListModel SearchFactory::_('Config')->regex_search = $regexSearch; SearchFactory::_('Config')->component_id = $componentId; - SearchFactory::_('Agent')->replace(); + // SearchFactory::_('Agent')->replace(); // TODO show danger message before allowing this!!!!! return ['success' => JText::sprintf('COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED', $tableName)]; } @@ -3693,11 +3693,22 @@ class ComponentbuilderModelAjax extends ListModel public function getSearchValue(string $fieldName, int $rowId, string $tableName): array { // check if this is a valid table and field - if ($rowId > 0 && SearchFactory('Table')->exist($tableName, $fieldName) && - ($value = SearchFactory('Agent')->getValue($fieldName, $rowId, 0, $tableName)) !== null) + if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName)) { - // load the value - return ['value' => $value]; + // load the configurations + SearchFactory::_('Config')->table_name = $tableName; + // load dummy data... TODO this should not be needed! + SearchFactory::_('Config')->search_value = ''; + SearchFactory::_('Config')->replace_value = ''; + SearchFactory::_('Config')->match_case = 0; + SearchFactory::_('Config')->whole_word = 0; + SearchFactory::_('Config')->regex_search = 0; + + if (($value = SearchFactory::_('Agent')->getValue($rowId, $fieldName, 0, $tableName)) !== null) + { + // load the value + return ['value' => $value]; + } } return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')]; } @@ -3722,7 +3733,7 @@ class ComponentbuilderModelAjax extends ListModel string $searchValue, ?string $replaceValue = null, int $matchCase, int $wholeWord, int $regexSearch): array { // check if this is a valid table and field - if ($rowId > 0 && SearchFactory('Table')->exist($tableName, $fieldName)) + if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName)) { // load the configurations SearchFactory::_('Config')->table_name = $tableName; @@ -3733,7 +3744,7 @@ class ComponentbuilderModelAjax extends ListModel SearchFactory::_('Config')->regex_search = $regexSearch; // load the value - if (($value = SearchFactory('Agent')->getValue($fieldName, $rowId, $line, $tableName, true)) !== null) + if (($value = SearchFactory::_('Agent')->getValue($rowId, $fieldName, $line, $tableName, true)) !== null) { return ['value' => $value]; } @@ -3755,8 +3766,8 @@ class ComponentbuilderModelAjax extends ListModel public function setValue($value, int $rowId, string $fieldName, string $tableName): array { // check if this is a valid table and field - if ($rowId > 0 && SearchFactory('Table')->exist($tableName, $fieldName) && - SearchFactory('Agent')->setValue($value, $rowId, $fieldName, $tableName)) + if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName) && + SearchFactory::_('Agent')->setValue($value, $rowId, $fieldName, $tableName)) { return ['success' => JText::sprintf( '%s (%s:%s) was successfully updated!', diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index a01155039..1e9dc692b 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1978,7 +1978,7 @@ INSERT INTO `#__componentbuilder_power` (`id`, `add_head`, `description`, `exten (9, 1, '', '', '', '011813ba-8dd2-4beb-98f9-50ab3f3665d1', 'dXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwIGFzIEJhc2VIdHRwOw0KdXNlIEpvb21sYVxDTVNcSHR0cFxIdHRwRmFjdG9yeTsNCnVzZSBKb29tbGFcUmVnaXN0cnlcUmVnaXN0cnk7', '', '', '{\"load_selection0\":{\"load\":\"aa253bac-f4b4-41b4-8ace-071a73fc4d96\"},\"load_selection1\":{\"load\":\"c65aaf1f-817c-49a2-8202-282e3904f5b1\"},\"load_selection2\":{\"load\":\"51195163-1e87-4251-b755-a03c376798a6\"}}', 'CS8qKg0KCSAqIE9wdGlvbnMgZm9yIHRoZSBbW1tBcGldXV0gb2JqZWN0Lg0KCSAqDQoJICogQHZhciAgICBhcnJheQ0KCSAqIEBzaW5jZSAgMS4wDQoJICovDQoJcHJvdGVjdGVkICRvcHRpb25zOw0KDQoJLyoqDQoJICogVGhlIEhUVFAgY2xpZW50IG9iamVjdCB0byB1c2UgaW4gc2VuZGluZyBIVFRQIHJlcXVlc3RzLg0KCSAqDQoJICogQHZhciAgICBCYXNlSHR0cA0KCSAqIEBzaW5jZSAgMS4wDQoJICovDQoJcHJvdGVjdGVkICRjbGllbnQ7DQoNCgkvKioNCgkgKiBDb25zdHJ1Y3Rvci4NCgkgKg0KCSAqIEBwYXJhbSAgIFJlZ2lzdHJ5ICAkb3B0aW9ucyAgW1tbQXBpXV1dIG9wdGlvbnMgb2JqZWN0Lg0KCSAqIEBwYXJhbSAgIEh0dHAgICAgICAkY2xpZW50ICAgVGhlIEhUVFAgY2xpZW50IG9iamVjdC4NCgkgKg0KCSAqIEBzaW5jZSAgIDEuMA0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiBfX2NvbnN0cnVjdChSZWdpc3RyeSAkb3B0aW9ucyA9IG51bGwsIEJhc2VIdHRwICRjbGllbnQgPSBudWxsKQ0KCXsNCgkJJHRoaXMtPm9wdGlvbnMgPSAkb3B0aW9uc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ZSB0byBzZXQuDQoJICoNCgkgKiBAcmV0dXJuICBbW1tBcGldXV0gIFRoaXMgb2JqZWN0IGZvciBtZXRob2QgY2hhaW5pbmcuDQoJICoNCgkgKiBAc2luY2UgICAxLjANCgkgKi8NCglwdWJsaWMgZnVuY3Rpb24gc2V0T3B0aW9uKCRrZXksICR2YWx1ZSkNCgl7DQoJCSR0aGlzLT5vcHRpb25zWyRrZXldID0gJHZhbHVlOw0KDQoJCXJldHVybiAkdGhpczsNCgl9DQo=', '{}', '[[[Api]]]', '[[[COMPANY]]]\\[[[Api]]]\\[[[Api]]]', '1.0.0', '{}', 'API', 'class', '{}', '', 1, '2022-01-05 00:44:15', '2022-09-20 10:09:49', 6, 4), (10, 1, 'Control the naming of a field\r\n\r\n@since 3.0.9', '', '', '9ef0eb24-aae4-4f5a-99af-d724db44808f', 'dXNlIEpvb21sYVxDTVNcQ29tcG9uZW50XENvbXBvbmVudEhlbHBlcjs=', '', '', '{}', 'CS8qKg0KCSAqIFRoZSBmaWVsZCBidWlsZGVyIHN3aXRjaA0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwcm90ZWN0ZWQgc3RhdGljICRidWlsZGVyID0gZmFsc2U7DQoNCgkvKioNCgkgKiBNYWtpbmcgZmllbGQgbmFtZXMgc2FmZQ0KCSAqDQoJICogQGlucHV0CXN0cmluZyAgICAgICBUaGUgc3RyaW5nIHlvdSB3b3VsZCBsaWtlIHRvIG1ha2Ugc2FmZQ0KCSAqIEBpbnB1dAlib29sZWFuICAgICAgVGhlIHN3aXRjaCB0byByZXR1cm4gYW4gQUxMIFVQUEVSIENBU0Ugc3RyaW5nDQoJICogQGlucHV0CXN0cmluZyAgICAgICBUaGUgc3RyaW5nIHRvIHVzZSBpbiB3aGl0ZSBzcGFjZQ0KCSAqDQoJICogQHJldHVybnMgc3RyaW5nIG9uIHN1Y2Nlc3MNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIH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y8gcmVtb3ZlIGFsbCBhbmQga2VlcCBvbmx5IGNoYXJhY3RlcnMgYW5kIG51bWJlcnMNCgkJCQkkc3RyaW5nID0gcHJlZ19yZXBsYWNlKCIvW15BLVphLXowLTkgXS8iLCAnJywgJHN0cmluZyk7DQoNCgkJCQkvLyByZXBsYWNlIHdoaXRlIHNwYWNlIHdpdGggdW5kZXJzY29yZSAoU0FGRVNUIE9QVElPTikNCgkJCQkkc3RyaW5nID0gcHJlZ19yZXBsYWNlKCcvXHMrLycsICRzcGFjZXIsICRzdHJpbmcpOw0KDQoJCQkJLy8gcmV0dXJuIGFsbCBjYXBzDQoJCQkJaWYgKCRhbGxjYXApDQoJCQkJew0KCQkJCQlyZXR1cm4gc3RydG91cHBlcigkc3RyaW5nKTsNCgkJCQl9DQoNCgkJCQkvLyBkZWZhdWx0IGlzIHRvIHJldHVybiBsb3dlcg0KCQkJCXJldHVybiBzdHJ0b2xvd2VyKCRzdHJpbmcpOw0KCQkJfQ0KCQkJLy8gbm90IGEgc3RyaW5nDQoJCQlyZXR1cm4gJyc7DQoJCX0NCg0KCQkvLyByZXR1cm4gYWxsIGNhcHMNCgkJaWYgKCRhbGxjYXApDQoJCXsNCgkJCXJldHVybiBTdHJpbmdIZWxwZXI6OnNhZmUoJHN0cmluZywgJ1UnKTsNCgkJfQ0KDQoJCS8vIHVzZSB0aGUgZGVmYXVsdCAob3JpZ2luYWwgYmVoYXZpb3IvY29udmVudGlvbikNCgkJcmV0dXJuIFN0cmluZ0hlbHBlcjo6c2FmZSgkc3RyaW5nKTsNCgl9DQo=', '{}', 'FieldHelper', 'VDM\\Joomla\\Utilities.String.FieldHelper', '1.0.0', '{}', 'String Field Helper', 'abstract class', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-08 20:46:56', '2022-09-20 10:09:54', 21, 5), (11, '', 'The json checker\r\n\r\n@since 3.0.9', '', '', '4b225c51-d293-48e4-b3f6-5136cf5c3f18', '', '', '', '{\"load_selection0\":{\"load\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\"},\"load_selection1\":{\"load\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\"},\"load_selection2\":{\"load\":\"db87c339-5bb6-4291-a7ef-2c48ea1b06bc\"}}', 'CS8qKg0KCSAqIENoZWNrIGlmIHlvdSBoYXZlIGEganNvbiBzdHJpbmcNCgkgKg0KCSAqIEBpbnB1dCAgICBzdHJpbmcgICRzdHJpbmcgIFRoZSBqc29uIHN0cmluZyB0byBjaGVjaw0KCSAqDQoJICogQHJldHVybnMgYm9vbCB0cnVlIG9uIHN1Y2Nlc3MNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBjaGVjaygkc3RyaW5nKTogYm9vbA0KCXsNCgkJaWYgKFN0cmluZ0hlbHBlcjo6Y2hlY2soJHN0cmluZykpDQoJCXsNCgkJCWpzb25fZGVjb2RlKCRzdHJpbmcpOw0KCQkJcmV0dXJuIChqc29uX2xhc3RfZXJyb3IoKSA9PT0gSlNPTl9FUlJPUl9OT05FKTsNCgkJfQ0KDQoJCXJldHVybiBmYWxzZTsNCgl9DQoNCgkvKioNCgkgKiBDb252ZXJ0IGEganNvbiBvYmplY3QgdG8gYSBzdHJpbmcNCgkgKg0KCSAqIEBpbnB1dCAgICBzdHJpbmcgICR2YWx1ZSAgVGhlIGpzb24gc3RyaW5nIHRvIGNvbnZlcnQNCgkgKg0KCSAqIEByZXR1cm5zIGEgc3RyaW5nDQoJICogDQoJICogQHNpbmNlICAzLjAuOQ0KCSAqLw0KCXB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gc3RyaW5nKCR2YWx1ZSwgJHNlcGFyYXRvciA9ICIsICIsICR0YWJsZSA9IG51bGwsICRpZCA9ICdpZCcsIC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0KCQkJCQlpZiAoQXJyYXlIZWxwZXI6OmNoZWNrKCRuYW1lcykpDQoJCQkJCXsNCgkJCQkJCXJldHVybiAoc3RyaW5nKSBpbXBsb2RlKCRzZXBhcmF0b3IsICRuYW1lcyk7DQoJCQkJCX0JDQoJCQkJfQ0KCQkJCXJldHVybiAoc3RyaW5nKSBpbXBsb2RlKCRzZXBhcmF0b3IsICRyZXN1bHQpOw0KCQkJfQ0KCQkJcmV0dXJuIChzdHJpbmcpIGpzb25fZGVjb2RlKCR2YWx1ZSk7DQoJCX0NCgkJcmV0dXJuICR2YWx1ZTsNCgl9DQo=', '{}', 'JsonHelper', 'VDM\\Joomla\\Utilities.JsonHelper', '1.0.0', '{}', 'Utilities Json Helper', 'abstract class', '{}', '', 1, '2022-03-08 21:03:54', '2022-09-20 09:51:51', 21, 6), -(12, 1, 'Some string tricks\r\n\r\n@since 3.0.9', '', '', '1f28cb53-60d9-4db1-b517-3c7dc6b429ef', 'dXNlIEpvb21sYVxDTVNcRmlsdGVyXElucHV0RmlsdGVyOw0KdXNlIEpvb21sYVxDTVNcTGFuZ3VhZ2VcTGFuZ3VhZ2U7', '', '', '{\"load_selection0\":{\"load\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\"}}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIHdlIGhhdmUgYSBzdHJpbmcgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0ICAgIHN0cmluZyAgJHN0cmluZyBUaGUgc3RyaW5nIHRvIGNoZWNrDQoJICoNCgkgKiBAcmV0dXJucyBib29sIHRydWUgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNC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aGlqa25vcHFyc3R1d3h5ekFCQ0RERUZHSElKS0xMTU1OT1BRUlNUVVZWV1hZWmFiY2RkZWZnaGlqa2xsbW1ub3BxcnN0dXZ2d3h5ekFCQ0VGR0hJSktOT1BRUlNUVVdYWVoiOw0KCQkka2V5ID0gYXJyYXkoKTsNCgkJJGJhZ3NpemUgPSBzdHJsZW4oJGJhZykgLSAxOw0KDQoJCWZvciAoJGkgPSAwOyAkaSA8ICRzaXplOyAkaSsrKQ0KCQl7DQoJCQkkZ2V0ID0gcmFuZCgwLCAkYmFnc2l6ZSk7DQoJCQkka2V5W10gPSAkYmFnWyRnZXRdOw0KCQl9DQoNCgkJcmV0dXJuIGltcGxvZGUoJGtleSk7DQoJfQ0K', '{}', 'StringHelper', 'VDM\\Joomla\\Utilities.StringHelper', '1.0.0', '{}', 'Utilities String Helper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-08 21:35:37', '2022-09-20 09:51:46', 28, 7), +(12, 1, 'Some string tricks\r\n\r\n@since 3.0.9', '', '', '1f28cb53-60d9-4db1-b517-3c7dc6b429ef', 'dXNlIEpvb21sYVxDTVNcRmlsdGVyXElucHV0RmlsdGVyOw0KdXNlIEpvb21sYVxDTVNcTGFuZ3VhZ2VcTGFuZ3VhZ2U7', '', '', '{\"load_selection0\":{\"load\":\"0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a\"}}', 'CS8qKg0KCSAqIFRoZSBNYWluIEFjdGl2ZSBMYW5ndWFnZQ0KCSAqIA0KCSAqIEB2YXIgICAgICBzdHJpbmcNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyAkbGFuZ1RhZzsNCg0KCS8qKg0KCSAqIENoZWNrIGlmIHdlIGhhdmUgYSBzdHJpbmcgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0ICAgIHN0cmluZyAgJHN0cmluZy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CgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiByYW5kb20oJHNpemUpDQoJew0KCQkkYmFnID0gImFiY2VmZ2hpamtub3BxcnN0dXd4eXpBQkNEREVGR0hJSktMTE1NTk9QUVJTVFVWVldYWVphYmNkZGVmZ2hpamtsbG1tbm9wcXJzdHV2dnd4eXpBQkNFRkdISUpLTk9QUVJTVFVXWFlaIjsNCgkJJGtleSA9IGFycmF5KCk7DQoJCSRiYWdzaXplID0gc3RybGVuKCRiYWcpIC0gMTsNCg0KCQlmb3IgKCRpID0gMDsgJGkgPCAkc2l6ZTsgJGkrKykNCgkJew0KCQkJJGdldCA9IHJhbmQoMCwgJGJhZ3NpemUpOw0KCQkJJGtleVtdID0gJGJhZ1skZ2V0XTsNCgkJfQ0KDQoJCXJldHVybiBpbXBsb2RlKCRrZXkpOw0KCX0NCg==', '{}', 'StringHelper', 'VDM\\Joomla\\Utilities.StringHelper', '1.0.0', '{}', 'Utilities String Helper', 'abstract class', '{\"use_selection0\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-08 21:35:37', '2022-10-29 21:40:16', 29, 7), (13, '', 'Some array tricks helper\r\n\r\n@since 3.0.9', '', '', '0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a', '', '', '', '{}', 'CS8qKg0KCSAqIENoZWNrIGlmIGhhdmUgYW4gYXJyYXkgd2l0aCBhIGxlbmd0aA0KCSAqDQoJICogQGlucHV0CWFycmF5ICAgVGhlIGFycmF5IHRvIGNoZWNrDQoJICoNCgkgKiBAcmV0dXJucyBib29sL2ludCAgbnVtYmVyIG9mIGl0ZW1zIGluIGFycmF5IG9uIHN1Y2Nlc3MNCgkgKiANCgkgKiBAc2luY2UgIDMuMC45DQoJICovDQoJcHVibGljIHN0YXRpYyBmdW5jdGlvbiBjaGVjaygkYXJyYXksICRyZW1vdmVFbXB0eVN0cmluZyA9IGZhbHN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CdWtldDsNCgkJfQ0KCQlyZXR1cm4gZmFsc2U7DQoJfQ0KDQoJLyoqDQoJICogQ2hlY2sgaWYgYXJyYXlzIGludGVyc2VjdA0KCSAqDQoJICogQGlucHV0CWFycmF5ICAgVGhlIGZpcnN0IGFycmF5DQoJICogQGlucHV0CWFycmF5ICAgVGhlIHNlY29uZCBhcnJheQ0KCSAqDQoJICogQHJldHVybnMgYm9vbCAgdHJ1ZSBpZiBpbnRlcnNlY3QgZWxzZSBmYWxzZQ0KCSAqIA0KCSAqIEBzaW5jZSAgMy4xLjENCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGludGVyc2VjdCgkYV9hcnJheSwgJGJfYXJyYXkpDQoJew0KCQkvLyBmbGlwIHRoZSBzZWNvbmQgYXJyYXkNCgkJJGJfYXJyYXkgPSBhcnJheV9mbGlwKCRiX2FycmF5KTsNCg0KCQkvLyBsb29wIHRoZSBmaXJzdCBhcnJheQ0KCQlmb3JlYWNoICgkYV9hcnJheSBhcyAkdikNCgkJew0KCQkJaWYgKGlzc2V0KCRiX2FycmF5WyR2XSkpDQoJCQl7DQoJCQkJcmV0dXJuIHRydWU7DQoJCQl9DQoJCX0NCgkJcmV0dXJuIGZhbHNlOw0KCX0NCg==', '{}', 'ArrayHelper', 'VDM\\Joomla\\Utilities.ArrayHelper', '1.0.0', '{}', 'Utilities Array Helper', 'abstract class', '{}', '', 1, '2022-03-08 22:53:52', '2022-09-20 09:51:40', 17, 8), (14, '', 'Control the naming of a namespace helper\r\n\r\n@since 3.0.9', '', '', 'ce8cf834-6bac-44fb-941c-861f7e046cc0', '', '', '', '{}', 'CS8qKg0KCSAqIE1ha2luZyBuYW1lc3BhY2Ugc2FmZQ0KCSAqDQoJICogQGlucHV0CXN0cmluZyAgICAgICBUaGUgeW91IHdvdWxkIGxpa2UgdG8gbWFrZSBzYWZlDQoJICoNCgkgKiBAcmV0dXJucyBzdHJpbmcgb24gc3VjY2Vzcw0KCSAqIA0KCSAqI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class', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"}}', '', 1, '2022-03-08 23:27:57', '2022-09-20 10:09:58', 16, 5), (15, 1, 'Control the naming of a field type\r\n\r\n@since 3.0.9', '', '', 'a8935cbe-7701-40dc-bfd5-675f2d600954', 'dXNlIEpvb21sYVxDTVNcQ29tcG9uZW50XENvbXBvbmVudEhlbHBlcjs=', '', '', '{}', 'CS8qKg0KCSAqIFRoZSBmaWVsZCBidWlsZGVyIHN3aXRjaA0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwcm90ZWN0ZWQgc3RhdGljICRidWlsZGVyID0gZmFsc2U7DQoNCgkvKioNCgkgKiBNYWtpbmcgZmllbGQgdHlwZSBuYW1lIHNhZmUNCgkgKg0KCSAqIEBwYXJhbSAgIFN0cmluZyAgICAgICRzdHJpbmcgICAgIFRoZSB5b3Ugd291bGQgbGlrZSB0byBtYWtlIHNhZmUNCgkgKiBAcGFyYW0gICBTdHJpbmcgICAgICAkb3B0aW9uICAgIFRoZSBvcHRpb24gZm9yIHRoZSBjb21wb25lbnQuDQoJICoNCgkgKiBAcmV0dXJucyBzdHJpbmcgb24gc3VjY2Vzcw0KCSAqIA0KCSAqIEBzaW5jZSAgMy4wLjkNCgkgKi8NCglwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIHNhZmUoJHN0cmluZywgJG9wdGlvbiA9IG51bGwpDQoJew0KCQkvLyBnZXQgZ2xvYmFsIHZhbHVlDQoJCWlmIChzZWxmOjokYnVpbGRlciA9PT0gZmFsc2UpDQoJCXsNCgkJCXNlbGY6OiRidWlsZGVyID0gSGVscGVyOjpnZXRQYXJhbXMoJG9wdGlvbiktPmdldCgndHlwZV9uYW1lX2J1aWxkZXInLCAxKTsNCgkJfQ0KDQoJCS8vIHVzZSB0aGUgbmV3IGNvbnZlbnRpb24NCgkJaWYgKDIgPT0gc2VsZjo6JGJ1aWxkZXIpDQoJC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', '{\"use_selection0\":{\"use\":\"1f28cb53-60d9-4db1-b517-3c7dc6b429ef\",\"as\":\"default\"},\"use_selection1\":{\"use\":\"640b5352-fb09-425f-a26e-cd44eda03f15\",\"as\":\"default\"}}', '', 1, '2022-03-08 23:33:09', '2022-09-20 10:10:03', 15, 5), @@ -2519,7 +2519,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` ( `target` VARCHAR(255) NOT NULL DEFAULT '', `hash` VARCHAR(64) NOT NULL DEFAULT '', PRIMARY KEY (`target`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; diff --git a/admin/views/search/tmpl/default.php b/admin/views/search/tmpl/default.php index 90394fe94..a85d22228 100644 --- a/admin/views/search/tmpl/default.php +++ b/admin/views/search/tmpl/default.php @@ -16,7 +16,6 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.formvalidator'); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); -use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; $this->app->input->set('hidemainmenu', false); $selectNotice = '

    ' . JText::_('COM_COMPONENTBUILDER_HI') . ' ' . $this->user->name . '

    '; @@ -54,33 +53,25 @@ $selectNotice .= '

    ' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT') name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">

    -
    +
    form->renderField('type_search'); ?> form->renderField('search_value'); ?> form->renderField('replace_value'); ?>
    -
    +
    form->renderFieldset('settings'); ?>
    -
    -
    - - - - - - - - - - - -
    +
    +
    +
    + 'search_results_table', 'headers' => $this->table_headers, 'items' => 7, 'init' => false]); ?>
    - @@ -88,14 +79,115 @@ $selectNotice .= '

    ' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT')

    item['tables']) && ComponentbuilderHelper::checkArray($this->item['tables'])) : ?> diff --git a/admin/views/search/view.html.php b/admin/views/search/view.html.php index 423db2bde..6cf532a4a 100644 --- a/admin/views/search/view.html.php +++ b/admin/views/search/view.html.php @@ -13,7 +13,6 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\View\HtmlView; -use Joomla\CMS\Filesystem\File; use Joomla\CMS\Form\Form; use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; @@ -45,7 +44,16 @@ class ComponentbuilderViewSearch extends HtmlView // get the needed form fields $this->form = $this->getDynamicForm(); - + + // build our table headers + $this->table_headers = array( + 'edit' => 'E', + 'code' => JText::_('COM_COMPONENTBUILDER_FOUND_TEXT'), + 'table' => JText::_('COM_COMPONENTBUILDER_TABLE'), + 'field' => JText::_('COM_COMPONENTBUILDER_FIELD'), + 'id' => JText::_('ID'), + 'line' => JText::_('COM_COMPONENTBUILDER_LINE') + ); // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') @@ -223,7 +231,7 @@ class ComponentbuilderViewSearch extends HtmlView 'name' => 'full_text', 'label' => 'COM_COMPONENTBUILDER_FULL_TEXT', 'width' => '100%', - 'height' => '450px', + 'height' => '250px', 'class' => 'full_text_editor', 'syntax' => 'php', 'buttons' => 'false', @@ -257,6 +265,12 @@ class ComponentbuilderViewSearch extends HtmlView // Initialize the header checker. $HeaderCheck = new componentbuilderHeaderCheck; + // always load these files. + $this->document->addStyleSheet(JURI::root(true) . "/media/com_componentbuilder/datatable/css/datatables.min.css", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css"); + $this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/pdfmake.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript"); + $this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/vfs_fonts.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript"); + $this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/datatables.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript"); + // Add View JavaScript File $this->document->addScript(JURI::root(true) . "/administrator/components/com_componentbuilder/assets/js/search.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript"); @@ -277,42 +291,16 @@ class ComponentbuilderViewSearch extends HtmlView { JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); } - - // Load the script to find all uikit components needed. - if ($uikit != 2) - { - // Set the default uikit components in this view. - $uikitComp = array(); - $uikitComp[] = 'uk-progress'; - } - - // Load the needed uikit components in this view. - if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) - { - // load just in case. - jimport('joomla.filesystem.file'); - // loading... - foreach ($uikitComp as $class) - { - foreach (ComponentbuilderHelper::$uk_components[$class] as $name) - { - // check if the CSS file exists. - if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css')) - { - // load the css. - JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']); - } - // check if the JavaScript file exists. - if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js')) - { - // load the js. - JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); - } - } - } - } // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/search.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + // Set the Custom CSS script to view + $this->document->addStyleDeclaration(" + .found_code { + color: #46a546; + font-weight: bolder; + } + + "); } /** diff --git a/componentbuilder.xml b/componentbuilder.xml index 4382d26e3..166c99692 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 23rd October, 2022 + 30th October, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io @@ -39,6 +39,7 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo js css images + datatable uikit-v2 footable-v3 diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php index 08cdaee10..49732a4b8 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php @@ -12,6 +12,7 @@ namespace VDM\Joomla\Componentbuilder\Search; +use Joomla\CMS\Language\Text; use VDM\Joomla\Componentbuilder\Search\Factory; use VDM\Joomla\Componentbuilder\Search\Config; use VDM\Joomla\Componentbuilder\Search\Database\Get; @@ -20,6 +21,7 @@ use VDM\Joomla\Componentbuilder\Search\Agent\Find; use VDM\Joomla\Componentbuilder\Search\Agent\Replace; use VDM\Joomla\Componentbuilder\Search\Agent\Search; use VDM\Joomla\Componentbuilder\Search\Agent\Update; +use VDM\Joomla\Componentbuilder\Search\Table; /** @@ -85,21 +87,55 @@ class Agent */ protected Update $update; + /** + * Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Return value to search view + * + * @var string + * @since 3.2.0 + */ + protected string $return; + + /** + * Marker start and end values + * + * @var array + * @since 3.2.0 + */ + protected array $marker; + + /** + * Marker start and end html values + * + * @var array + * @since 3.2.0 + */ + protected array $markerHtml; + /** * Constructor * - * @param Config|null $config The search config object. - * @param Get|null $get The search get database object. - * @param Set|null $set The search get database object. - * @param Find|null $find The search find object. - * @param Replace|null $replace The search replace object. - * @param Search|null $search The search object. + * @param Config|null $config The search config object. + * @param Get|null $get The search get database object. + * @param Set|null $set The search get database object. + * @param Find|null $find The search find object. + * @param Replace|null $replace The search replace object. + * @param Search|null $search The search object. + * @param Update|null $update The update object. + * @param Table|null $table The table object. * * @since 3.2.0 */ public function __construct(?Config $config = null, ?Get $get = null, ?Set$set = null, ?Find $find = null, ?Replace $replace = null, - ?Search $search = null, ?Update $update = null) + ?Search $search = null, ?Update $update = null, ?Table $table = null) { $this->config = $config ?: Factory::_('Config'); $this->get = $get ?: Factory::_('Get.Database'); @@ -108,23 +144,23 @@ class Agent $this->replace = $replace ?: Factory::_('Agent.Replace'); $this->search = $search ?: Factory::_('Agent.Search'); $this->update = $update ?: Factory::_('Agent.Update'); + $this->table = $table ?: Factory::_('Table'); } /** * Get the value of a field in a row and table * - * @param mixed $value The field value * @param int $id The item ID * @param string $field The field key * @param mixed $line The field line * @param string|null $table The table * @param bool $update The switch to triger an update (default is false) * - * @return mixed + * @return string * @since 3.2.0 */ public function getValue(int $id, string $field, $line = null, - ?string $table = null, bool $update = false) + ?string $table = null, bool $update = false): string { // set the table name if (empty($table)) @@ -134,13 +170,19 @@ class Agent if (($value = $this->get->value($id, $field, $table)) !== null) { - // try to update the value if required - if ($update && ($updated_value = $this->update->value($value, $line)) !== null) + // we only return strings that can load in an editor + if (is_string($value)) { - return $updated_value; + // try to update the value if required + if ($update && ($updated_value = $this->update->value($value, $line)) !== null) + { + return $updated_value; + } + + return $value; } - return $value; + return '// VALUE CAN NOT BE LOADED (AT THIS TIME) SINCE ITS NOT A STRING'; } return null; @@ -168,6 +210,48 @@ class Agent return $this->set->value($value, $id, $field, $table); } + /** + * Return Table Ready Search Results + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function table(?string $table = null): ?array + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if(($values = $this->find($table)) !== null) + { + $table_rows = []; + + // set the return value + $this->return = urlencode(base64_encode('index.php?option=com_componentbuilder&view=search')); + + // set the markers + $this->marker = [$this->config->marker_start, $this->config->marker_end]; + $this->markerHtml = ['','']; + + foreach ($values as $id => $fields) + { + foreach ($fields as $field => $lines) + { + foreach ($lines as $line => $code) + { + $table_rows[] = $this->getRow($code, $table, $field, $id, $line); + } + } + } + return $table_rows; + } + return null; + } + /** * Search the posted table for the search value and return all * @@ -233,6 +317,68 @@ class Agent $set++; } } + + /** + * Return prepared code string for table + * + * @param string $code The code value fro the table + * @param string|null $table The table + * @param string $field The field key + * @param int $id The the row id + * @param mixed $line The code line where found + * + * @return array + * @since 3.2.0 + */ + protected function getRow(string $code, string $table, string $field, int $id, $line): array + { + return [ + 'edit' => $this->getRowEditButton($table, $field, $id, $line), + 'code' => $this->getRowCode($code), + 'table' => $table, + 'field' => $field, + 'id' => $id, + 'line' => $line + ]; + } + + /** + * Return prepared code string for table + * + * @param string $code The code value fro the table + * + * @return string + * @since 3.2.0 + */ + protected function getRowCode(string $code): string + { + return str_replace($this->marker, $this->markerHtml, htmlentities($code)); + } + + /** + * Get the Item button to edit an item + * + * @param string|null $view The single view + * @param string $field The field key + * @param int $id The the row id + * @param mixed $line The code line where found + * + * @return string + * @since 3.2.0 + */ + protected function getRowEditButton(string $view, string $field, int $id, $line): string + { + // get list view + $views = $this->table->get($view, $field, 'list'); + + // return edit link + return ''; + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Basic.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Basic.php index c7d19a988..2a6e8f334 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Basic.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Engine/Basic.php @@ -46,7 +46,7 @@ class Basic extends Engine implements SearchTypeInterface parent::__construct($config); // quote all regular expression characters - $searchValue = \preg_quote($this->searchValue); + $searchValue = preg_quote($this->searchValue, '/'); $start = ''; $end = ''; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php index 5ae0b98c7..5816ba6ff 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php @@ -20,17 +20,17 @@ namespace VDM\Joomla\Componentbuilder\Search\Interfaces; interface GetInterface { /** - * Get values from a given table + * Get a value from a given table * Example: $this->value(23, 'value_key', 'table_name'); * - * @param string $field The field key * @param int $id The item ID + * @param string $field The field key * @param string|null $table The table * * @return mixed * @since 3.2.0 */ - public function value(string $field, int $id, string $table = null); + public function value(int $id, string $field, string $table = null); /** * Get values from a given table diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php index b2bf81a82..e74ea731b 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php @@ -70,7 +70,9 @@ class Agent implements ServiceProviderInterface $container->get('Set.Database'), $container->get('Agent.Find'), $container->get('Agent.Replace'), - $container->get('Agent.Search') + $container->get('Agent.Search'), + $container->get('Agent.Update'), + $container->get('Table') ); } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php index fa4e59683..359fa4b33 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php @@ -237,7 +237,7 @@ abstract class StringHelper * * @since 3.0.9 */ - public static function html($var, $charset = 'UTF-8', $shorten = false, $length = 40) + public static function html($var, $charset = 'UTF-8', $shorten = false, $length = 40, $addTip = true) { if (self::check($var)) { @@ -254,7 +254,7 @@ abstract class StringHelper ); if ($shorten) { - return self::shorten($string, $length); + return self::shorten($string, $length, $addTip); } return $string; } diff --git a/media/datatable/css/datatables.min.css b/media/datatable/css/datatables.min.css new file mode 100644 index 000000000..5c9d00a40 --- /dev/null +++ b/media/datatable/css/datatables.min.css @@ -0,0 +1,57 @@ +/* + * This combined file was created by the DataTables downloader builder: + * https://datatables.net/download + * + * To rebuild or modify this file with the latest versions of the included + * software please visit: + * https://datatables.net/download/#dt/jszip-2.5.0/dt-1.11.5/b-2.2.2/b-colvis-2.2.2/b-html5-2.2.2/b-print-2.2.2/cr-1.5.5/date-1.1.2/fc-4.0.2/fh-3.2.2/kt-2.6.4/r-2.2.9/rg-1.1.4/rr-1.2.8/sc-2.0.5/sb-1.3.2/sp-2.0.0/sl-1.3.4/sr-1.1.0 + * + * Included libraries: + * JSZip 2.5.0, DataTables 1.11.5, Buttons 2.2.2, Column visibility 2.2.2, HTML5 export 2.2.2, Print view 2.2.2, ColReorder 1.5.5, DateTime 1.1.2, FixedColumns 4.0.2, FixedHeader 3.2.2, KeyTable 2.6.4, Responsive 2.2.9, RowGroup 1.1.4, RowReorder 1.2.8, Scroller 2.0.5, SearchBuilder 1.3.2, SearchPanes 2.0.0, Select 1.3.4, StateRestore 1.1.0 + */ + +table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable td.dt-control{text-align:center;cursor:pointer}table.dataTable td.dt-control:before{height:1em;width:1em;margin-top:-9px;display:inline-block;color:white;border:.15em solid white;border-radius:1em;box-shadow:0 0 .2em #444;box-sizing:content-box;text-align:center;text-indent:0 !important;font-family:"Courier New",Courier,monospace;line-height:1em;content:"+";background-color:#31b131}table.dataTable tr.dt-hasChild td.dt-control:before{content:"-";background-color:#d33333}table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("/DataTables-1.11.5/images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("/DataTables-1.11.5/images/sort_asc.png") !important}table.dataTable thead .sorting_desc{background-image:url("/DataTables-1.11.5/images/sort_desc.png") !important}table.dataTable thead .sorting_asc_disabled{background-image:url("/DataTables-1.11.5/images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("/DataTables-1.11.5/images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#fff}table.dataTable tbody tr.selected{background-color:#b0bed9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_length select{border:1px solid #aaa;border-radius:3px;padding:5px;background-color:transparent;padding:4px}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{border:1px solid #aaa;border-radius:3px;padding:5px;background-color:transparent;margin-left:3px}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, white 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, white 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, white 0%, #dcdcdc 100%);background:-o-linear-gradient(top, white 0%, #dcdcdc 100%);background:linear-gradient(to bottom, white 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(25%, rgba(255, 255, 255, 0.9)), color-stop(75%, rgba(255, 255, 255, 0.9)), color-stop(100%, rgba(255, 255, 255, 0)));background:-webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:.5em}} + + +@keyframes dtb-spinner{100%{transform:rotate(360deg)}}@-o-keyframes dtb-spinner{100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes dtb-spinner{100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dtb-spinner{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes dtb-spinner{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}div.dataTables_wrapper{position:relative}div.dt-buttons{position:initial}div.dt-button-info{position:fixed;top:50%;left:50%;width:400px;margin-top:-100px;margin-left:-200px;background-color:white;border:2px solid #111;box-shadow:3px 4px 10px 1px rgba(0, 0, 0, 0.3);border-radius:3px;text-align:center;z-index:21}div.dt-button-info h2{padding:.5em;margin:0;font-weight:normal;border-bottom:1px solid #ddd;background-color:#f3f3f3}div.dt-button-info>div{padding:1em}div.dtb-popover-close{position:absolute;top:10px;right:10px;width:22px;height:22px;border:1px solid #eaeaea;background-color:#f9f9f9;text-align:center;border-radius:3px;cursor:pointer;z-index:12}button.dtb-hide-drop{display:none !important}div.dt-button-collection-title{text-align:center;padding:.3em 0 .5em;margin-left:.5em;margin-right:.5em;font-size:.9em}div.dt-button-collection-title:empty{display:none}span.dt-button-spacer{display:inline-block;margin:.5em;white-space:nowrap}span.dt-button-spacer.bar{border-left:1px solid rgba(0, 0, 0, 0.3);vertical-align:middle;padding-left:.5em}span.dt-button-spacer.bar:empty{height:1em;width:1px;padding-left:0}div.dt-button-collection span.dt-button-spacer{width:100%;font-size:.9em;text-align:center;margin:.5em 0}div.dt-button-collection span.dt-button-spacer:empty{height:0;width:100%}div.dt-button-collection span.dt-button-spacer.bar{border-left:none;border-bottom:1px solid rgba(0, 0, 0, 0.3);padding-left:0}button.dt-button,div.dt-button,a.dt-button,input.dt-button{position:relative;display:inline-block;box-sizing:border-box;margin-left:.167em;margin-right:.167em;margin-bottom:.333em;padding:.5em 1em;border:1px solid rgba(0, 0, 0, 0.3);border-radius:2px;cursor:pointer;font-size:.88em;line-height:1.6em;color:black;white-space:nowrap;overflow:hidden;background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(230, 230, 230, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;outline:none;text-overflow:ellipsis}button.dt-button:first-child,div.dt-button:first-child,a.dt-button:first-child,input.dt-button:first-child{margin-left:0}button.dt-button.disabled,div.dt-button.disabled,a.dt-button.disabled,input.dt-button.disabled{cursor:default;opacity:.4}button.dt-button:active:not(.disabled),button.dt-button.active:not(.disabled),div.dt-button:active:not(.disabled),div.dt-button.active:not(.disabled),a.dt-button:active:not(.disabled),a.dt-button.active:not(.disabled),input.dt-button:active:not(.disabled),input.dt-button.active:not(.disabled){background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(179, 179, 179, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(179, 179, 179, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)");box-shadow:inset 1px 1px 3px #999}button.dt-button:active:not(.disabled):hover:not(.disabled),button.dt-button.active:not(.disabled):hover:not(.disabled),div.dt-button:active:not(.disabled):hover:not(.disabled),div.dt-button.active:not(.disabled):hover:not(.disabled),a.dt-button:active:not(.disabled):hover:not(.disabled),a.dt-button.active:not(.disabled):hover:not(.disabled),input.dt-button:active:not(.disabled):hover:not(.disabled),input.dt-button.active:not(.disabled):hover:not(.disabled){box-shadow:inset 1px 1px 3px #999;background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(128, 128, 128, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(128, 128, 128, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)")}button.dt-button:hover,div.dt-button:hover,a.dt-button:hover,input.dt-button:hover{text-decoration:none}button.dt-button:hover:not(.disabled),div.dt-button:hover:not(.disabled),a.dt-button:hover:not(.disabled),input.dt-button:hover:not(.disabled){border:1px solid #666;background-color:rgba(0, 0, 0, 0.1);background:-webkit-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-moz-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-ms-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:-o-linear-gradient(top, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);background:linear-gradient(to bottom, rgba(153, 153, 153, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="rgba(153, 153, 153, 0.1)", EndColorStr="rgba(0, 0, 0, 0.1)")}button.dt-button:focus:not(.disabled),div.dt-button:focus:not(.disabled),a.dt-button:focus:not(.disabled),input.dt-button:focus:not(.disabled){border:1px solid #426c9e;text-shadow:0 1px 0 #c4def1;outline:none;background-color:#79ace9;background:-webkit-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:-moz-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:-ms-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:-o-linear-gradient(top, #d1e2f7 0%, #79ace9 100%);background:linear-gradient(to bottom, #d1e2f7 0%, #79ace9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#d1e2f7", EndColorStr="#79ace9")}button.dt-button span.dt-down-arrow,div.dt-button span.dt-down-arrow,a.dt-button span.dt-down-arrow,input.dt-button span.dt-down-arrow{position:relative;top:-2px;color:rgba(70, 70, 70, 0.75);font-size:8px;padding-left:10px;line-height:1em}.dt-button embed{outline:none}div.dt-buttons{float:left}div.dt-buttons.buttons-right{float:right}div.dataTables_layout_cell div.dt-buttons{float:none}div.dataTables_layout_cell div.dt-buttons.buttons-right{float:none}div.dt-btn-split-wrapper{display:inline-block}div.dt-button-collection{position:absolute;top:0;left:0;width:200px;margin-top:3px;margin-bottom:3px;padding:4px 4px 2px 4px;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.4);background-color:white;overflow:hidden;z-index:2002;border-radius:5px;box-shadow:3px 4px 10px 1px rgba(0, 0, 0, 0.3);box-sizing:border-box}div.dt-button-collection button.dt-button,div.dt-button-collection div.dt-button,div.dt-button-collection a.dt-button{position:relative;left:0;right:0;width:100%;display:block;float:none;margin:4px 0 2px 0}div.dt-button-collection button.dt-button:active:not(.disabled),div.dt-button-collection button.dt-button.active:not(.disabled),div.dt-button-collection div.dt-button:active:not(.disabled),div.dt-button-collection div.dt-button.active:not(.disabled),div.dt-button-collection a.dt-button:active:not(.disabled),div.dt-button-collection a.dt-button.active:not(.disabled){background-color:#dadada;background:-webkit-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-moz-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-ms-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-o-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:linear-gradient(to bottom, #f0f0f0 0%, #dadada 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#f0f0f0", EndColorStr="#dadada");box-shadow:inset 1px 1px 3px #666}div.dt-button-collection button.dt-button:first-child,div.dt-button-collection div.dt-button:first-child,div.dt-button-collection a.dt-button:first-child{margin-top:0;border-top-left-radius:3px;border-top-right-radius:3px}div.dt-button-collection button.dt-button:last-child,div.dt-button-collection div.dt-button:last-child,div.dt-button-collection a.dt-button:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}div.dt-button-collection div.dt-btn-split-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:stretch;margin:4px 0 2px 0}div.dt-button-collection div.dt-btn-split-wrapper button.dt-button{margin:0;display:inline-block;width:0;flex-grow:1;flex-shrink:0;flex-basis:50px;border-radius:0}div.dt-button-collection div.dt-btn-split-wrapper button.dt-btn-split-drop{min-width:20px;flex-grow:0;flex-shrink:0;flex-basis:0}div.dt-button-collection div.dt-btn-split-wrapper:first-child{margin-top:0}div.dt-button-collection div.dt-btn-split-wrapper:first-child button.dt-button{border-top-left-radius:3px}div.dt-button-collection div.dt-btn-split-wrapper:first-child button.dt-btn-split-drop{border-top-right-radius:3px}div.dt-button-collection div.dt-btn-split-wrapper:last-child button.dt-button{border-bottom-left-radius:3px}div.dt-button-collection div.dt-btn-split-wrapper:last-child button.dt-btn-split-drop{border-bottom-right-radius:3px}div.dt-button-collection div.dt-btn-split-wrapper:active:not(.disabled) button.dt-button,div.dt-button-collection div.dt-btn-split-wrapper.active:not(.disabled) button.dt-button{background-color:#dadada;background:-webkit-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-moz-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-ms-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:-o-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background:linear-gradient(to bottom, #f0f0f0 0%, #dadada 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#f0f0f0", EndColorStr="#dadada");box-shadow:inset 0px 0px 4px #666}div.dt-button-collection div.dt-btn-split-wrapper:active:not(.disabled) button.dt-btn-split-drop,div.dt-button-collection div.dt-btn-split-wrapper.active:not(.disabled) button.dt-btn-split-drop{box-shadow:none}div.dt-button-collection.fixed .dt-button:first-child{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}div.dt-button-collection.fixed .dt-button:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0}div.dt-button-collection.fixed{position:fixed;display:block;top:50%;left:50%;margin-left:-75px;border-radius:5px;background-color:white}div.dt-button-collection.fixed.two-column{margin-left:-200px}div.dt-button-collection.fixed.three-column{margin-left:-225px}div.dt-button-collection.fixed.four-column{margin-left:-300px}div.dt-button-collection.fixed.columns{margin-left:-409px}@media screen and (max-width: 1024px){div.dt-button-collection.fixed.columns{margin-left:-308px}}@media screen and (max-width: 640px){div.dt-button-collection.fixed.columns{margin-left:-203px}}@media screen and (max-width: 460px){div.dt-button-collection.fixed.columns{margin-left:-100px}}div.dt-button-collection.fixed>:last-child{max-height:100vh;overflow:auto}div.dt-button-collection.two-column>:last-child,div.dt-button-collection.three-column>:last-child,div.dt-button-collection.four-column>:last-child{display:block !important;-webkit-column-gap:8px;-moz-column-gap:8px;-ms-column-gap:8px;-o-column-gap:8px;column-gap:8px}div.dt-button-collection.two-column>:last-child>*,div.dt-button-collection.three-column>:last-child>*,div.dt-button-collection.four-column>:last-child>*{-webkit-column-break-inside:avoid;break-inside:avoid}div.dt-button-collection.two-column{width:400px}div.dt-button-collection.two-column>:last-child{padding-bottom:1px;column-count:2}div.dt-button-collection.three-column{width:450px}div.dt-button-collection.three-column>:last-child{padding-bottom:1px;column-count:3}div.dt-button-collection.four-column{width:600px}div.dt-button-collection.four-column>:last-child{padding-bottom:1px;column-count:4}div.dt-button-collection .dt-button{border-radius:0}div.dt-button-collection.columns{width:auto}div.dt-button-collection.columns>:last-child{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:6px;width:818px;padding-bottom:1px}div.dt-button-collection.columns>:last-child .dt-button{min-width:200px;flex:0 1;margin:0}div.dt-button-collection.columns.dtb-b3>:last-child,div.dt-button-collection.columns.dtb-b2>:last-child,div.dt-button-collection.columns.dtb-b1>:last-child{justify-content:space-between}div.dt-button-collection.columns.dtb-b3 .dt-button{flex:1 1 32%}div.dt-button-collection.columns.dtb-b2 .dt-button{flex:1 1 48%}div.dt-button-collection.columns.dtb-b1 .dt-button{flex:1 1 100%}@media screen and (max-width: 1024px){div.dt-button-collection.columns>:last-child{width:612px}}@media screen and (max-width: 640px){div.dt-button-collection.columns>:last-child{width:406px}div.dt-button-collection.columns.dtb-b3 .dt-button{flex:0 1 32%}}@media screen and (max-width: 460px){div.dt-button-collection.columns>:last-child{width:200px}}div.dt-button-background{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);background:-ms-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:-moz-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:-o-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:-webkit-gradient(radial, center center, 0, center center, 497, color-stop(0, rgba(0, 0, 0, 0.3)), color-stop(1, rgba(0, 0, 0, 0.7)));background:-webkit-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);background:radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);z-index:2001}@media screen and (max-width: 640px){div.dt-buttons{float:none !important;text-align:center}}button.dt-button.processing,div.dt-button.processing,a.dt-button.processing{color:rgba(0, 0, 0, 0.2)}button.dt-button.processing:after,div.dt-button.processing:after,a.dt-button.processing:after{position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px;box-sizing:border-box;display:block;content:" ";border:2px solid #282828;border-radius:50%;border-left-color:transparent;border-right-color:transparent;animation:dtb-spinner 1500ms infinite linear;-o-animation:dtb-spinner 1500ms infinite linear;-ms-animation:dtb-spinner 1500ms infinite linear;-webkit-animation:dtb-spinner 1500ms infinite linear;-moz-animation:dtb-spinner 1500ms infinite linear}button.dt-btn-split-drop{margin-left:calc(-1px - .333em);padding-bottom:calc(.5em - 1px);border-radius:0px 1px 1px 0px;color:rgba(70, 70, 70, 0.9);border-left:none}button.dt-btn-split-drop span.dt-btn-split-drop-arrow{position:relative;top:-1px;left:-2px;font-size:8px}button.dt-btn-split-drop:hover{z-index:2}button.buttons-split{border-right:1px solid rgba(70, 70, 70, 0);border-radius:1px 0px 0px 1px}button.dt-btn-split-drop-button{background-color:white}button.dt-btn-split-drop-button:hover{background-color:white} + + +table.DTCR_clonedTable.dataTable{position:absolute !important;background-color:rgba(255, 255, 255, 0.7);z-index:202}div.DTCR_pointer{width:1px;background-color:#0259c4;z-index:201} + + +div.dt-datetime{position:absolute;background-color:white;z-index:2050;border:1px solid #ccc;box-shadow:0 5px 15px -5px rgba(0, 0, 0, 0.5);padding:0 20px 6px 20px;width:275px}div.dt-datetime.inline{position:relative;box-shadow:none}div.dt-datetime div.dt-datetime-title{text-align:center;padding:5px 0px 3px}div.dt-datetime div.dt-datetime-buttons{text-align:center}div.dt-datetime div.dt-datetime-buttons a{display:inline-block;padding:0 .5em .5em .5em;margin:0;font-size:.9em}div.dt-datetime div.dt-datetime-buttons a:hover{text-decoration:underline}div.dt-datetime table{border-spacing:0;margin:12px 0;width:100%}div.dt-datetime table.dt-datetime-table-nospace{margin-top:-12px}div.dt-datetime table th{font-size:.8em;color:#777;font-weight:normal;width:14.285714286%;padding:0 0 4px 0;text-align:center}div.dt-datetime table td{font-size:.9em;color:#444;padding:0}div.dt-datetime table td.selectable{text-align:center;background:#f5f5f5}div.dt-datetime table td.selectable.disabled{color:#aaa;background:white}div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:white}div.dt-datetime table td.selectable.now{background-color:#ddd}div.dt-datetime table td.selectable.now button{font-weight:bold}div.dt-datetime table td.selectable.selected button{background:#4e6ca3;color:white;border-radius:2px}div.dt-datetime table td.selectable button:hover{background:#ff8000;color:white;border-radius:2px}div.dt-datetime table td.dt-datetime-week{font-size:.7em}div.dt-datetime table button{width:100%;box-sizing:border-box;border:none;background:transparent;font-size:inherit;color:inherit;text-align:center;padding:4px 0;cursor:pointer;margin:0}div.dt-datetime table button span{display:inline-block;min-width:14px;text-align:right}div.dt-datetime table.weekNumber th{width:12.5%}div.dt-datetime div.dt-datetime-calendar table{margin-top:0}div.dt-datetime div.dt-datetime-label{position:relative;display:inline-block;height:30px;padding:5px 6px;border:1px solid transparent;box-sizing:border-box;cursor:pointer}div.dt-datetime div.dt-datetime-label:hover{border:1px solid #ddd;border-radius:2px;background-color:#f5f5f5}div.dt-datetime div.dt-datetime-label select{position:absolute;top:6px;left:0;cursor:pointer;opacity:0}div.dt-datetime.horizontal{width:550px}div.dt-datetime.horizontal div.dt-datetime-date,div.dt-datetime.horizontal div.dt-datetime-time{width:48%}div.dt-datetime.horizontal div.dt-datetime-time{margin-left:4%}div.dt-datetime div.dt-datetime-date{position:relative;float:left;width:100%}div.dt-datetime div.dt-datetime-time{position:relative;float:left;width:100%;text-align:center}div.dt-datetime div.dt-datetime-time>span{vertical-align:middle}div.dt-datetime div.dt-datetime-time th{text-align:left}div.dt-datetime div.dt-datetime-time div.dt-datetime-timeblock{display:inline-block;vertical-align:middle}div.dt-datetime div.dt-datetime-iconLeft,div.dt-datetime div.dt-datetime-iconRight,div.dt-datetime div.dt-datetime-iconUp,div.dt-datetime div.dt-datetime-iconDown{width:30px;height:30px;background-position:center;background-repeat:no-repeat;opacity:.3;overflow:hidden;box-sizing:border-box}div.dt-datetime div.dt-datetime-iconLeft:hover,div.dt-datetime div.dt-datetime-iconRight:hover,div.dt-datetime div.dt-datetime-iconUp:hover,div.dt-datetime div.dt-datetime-iconDown:hover{border:1px solid #ccc;border-radius:2px;background-color:#f0f0f0;opacity:.6}div.dt-datetime div.dt-datetime-iconLeft button,div.dt-datetime div.dt-datetime-iconRight button,div.dt-datetime div.dt-datetime-iconUp button,div.dt-datetime div.dt-datetime-iconDown button{border:none;background:transparent;text-indent:30px;height:100%;width:100%;cursor:pointer}div.dt-datetime div.dt-datetime-iconLeft{position:absolute;top:5px;left:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==")}div.dt-datetime div.dt-datetime-iconRight{position:absolute;top:5px;right:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=")}div.dt-datetime div.dt-datetime-iconUp{height:20px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAALCAMAAABf9c24AAAAFVBMVEX///99fX1+fn57e3t6enoAAAAAAAC73bqPAAAABnRSTlMAYmJkZt92bnysAAAAL0lEQVR4AWOgJmBhxCvLyopHnpmVjY2VCadeoCxIHrcsWJ4RlyxCHlMWCTBRJxwAjrIBDMWSiM0AAAAASUVORK5CYII=")}div.dt-datetime div.dt-datetime-iconDown{height:20px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAALCAMAAABf9c24AAAAFVBMVEX///99fX1+fn57e3t6enoAAAAAAAC73bqPAAAABnRSTlMAYmJkZt92bnysAAAAMElEQVR4AWOgDmBiRQIsmPKMrGxQgJDFlEfIYpoPk8Utz8qM232MYFfhkQfKUg8AANefAQxecJ58AAAAAElFTkSuQmCC")}div.dt-datetime-error{clear:both;padding:0 1em;max-width:240px;font-size:11px;line-height:1.25em;text-align:center;color:#b11f1f} + + +table.dataTable.display tbody tr.DTFC_NoData{background-color:transparent}tr.even td{background-color:#fff}tr.odd td{background-color:#f9f9f9}tr.selected td{background-color:#a6b4cd}thead th{background-color:white}tfoot th{background-color:white}tr.dt-rowReorder-moving td.dtfc-fixed-left,tr.dt-rowReorder-moving td.dtfc-fixed-right{border-top:2px solid #555 !important;border-bottom:2px solid #555 !important}tr.dt-rowReorder-moving td.dtfc-fixed-left:first-child{border-left:2px solid #555 !important}tr.dt-rowReorder-moving td.dtfc-fixed-right:last-child{border-right:2px solid #555 !important} + + +table.fixedHeader-floating{background-color:white}table.fixedHeader-floating.no-footer{border-bottom-width:0}table.fixedHeader-locked{position:absolute !important;background-color:white}@media print{table.fixedHeader-floating{display:none}} + + +table.dataTable tbody th.focus,table.dataTable tbody td.focus{box-shadow:inset 0 0 1px 2px #36f}div.dtk-focus-alt table.dataTable tbody th.focus,div.dtk-focus-alt table.dataTable tbody td.focus{box-shadow:inset 0 0 1px 2px #ff8b33} + + +table.dataTable.dtr-inline.collapsed>tbody>tr>td.child,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty{cursor:default !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty:before{display:none !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control,table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control{position:relative;padding-left:30px;cursor:pointer}table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before{top:50%;left:5px;height:1em;width:1em;margin-top:-9px;display:block;position:absolute;color:white;border:.15em solid white;border-radius:1em;box-shadow:0 0 .2em #444;box-sizing:content-box;text-align:center;text-indent:0 !important;font-family:"Courier New",Courier,monospace;line-height:1em;content:"+";background-color:#31b131}table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th.dtr-control:before{content:"-";background-color:#d33333}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td.dtr-control,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th.dtr-control{padding-left:27px}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td.dtr-control:before,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th.dtr-control:before{left:4px;height:14px;width:14px;border-radius:14px;line-height:14px;text-indent:3px}table.dataTable.dtr-column>tbody>tr>td.dtr-control,table.dataTable.dtr-column>tbody>tr>th.dtr-control,table.dataTable.dtr-column>tbody>tr>td.control,table.dataTable.dtr-column>tbody>tr>th.control{position:relative;cursor:pointer}table.dataTable.dtr-column>tbody>tr>td.dtr-control:before,table.dataTable.dtr-column>tbody>tr>th.dtr-control:before,table.dataTable.dtr-column>tbody>tr>td.control:before,table.dataTable.dtr-column>tbody>tr>th.control:before{top:50%;left:50%;height:.8em;width:.8em;margin-top:-0.5em;margin-left:-0.5em;display:block;position:absolute;color:white;border:.15em solid white;border-radius:1em;box-shadow:0 0 .2em #444;box-sizing:content-box;text-align:center;text-indent:0 !important;font-family:"Courier New",Courier,monospace;line-height:1em;content:"+";background-color:#31b131}table.dataTable.dtr-column>tbody>tr.parent td.dtr-control:before,table.dataTable.dtr-column>tbody>tr.parent th.dtr-control:before,table.dataTable.dtr-column>tbody>tr.parent td.control:before,table.dataTable.dtr-column>tbody>tr.parent th.control:before{content:"-";background-color:#d33333}table.dataTable>tbody>tr.child{padding:.5em 1em}table.dataTable>tbody>tr.child:hover{background:transparent !important}table.dataTable>tbody>tr.child ul.dtr-details{display:inline-block;list-style-type:none;margin:0;padding:0}table.dataTable>tbody>tr.child ul.dtr-details>li{border-bottom:1px solid #efefef;padding:.5em 0}table.dataTable>tbody>tr.child ul.dtr-details>li:first-child{padding-top:0}table.dataTable>tbody>tr.child ul.dtr-details>li:last-child{border-bottom:none}table.dataTable>tbody>tr.child span.dtr-title{display:inline-block;min-width:75px;font-weight:bold}div.dtr-modal{position:fixed;box-sizing:border-box;top:0;left:0;height:100%;width:100%;z-index:100;padding:10em 1em}div.dtr-modal div.dtr-modal-display{position:absolute;top:0;left:0;bottom:0;right:0;width:50%;height:50%;overflow:auto;margin:auto;z-index:102;overflow:auto;background-color:#f5f5f7;border:1px solid black;border-radius:.5em;box-shadow:0 12px 30px rgba(0, 0, 0, 0.6)}div.dtr-modal div.dtr-modal-content{position:relative;padding:1em}div.dtr-modal div.dtr-modal-close{position:absolute;top:6px;right:6px;width:22px;height:22px;border:1px solid #eaeaea;background-color:#f9f9f9;text-align:center;border-radius:3px;cursor:pointer;z-index:12}div.dtr-modal div.dtr-modal-close:hover{background-color:#eaeaea}div.dtr-modal div.dtr-modal-background{position:fixed;top:0;left:0;right:0;bottom:0;z-index:101;background:rgba(0, 0, 0, 0.6)}@media screen and (max-width: 767px){div.dtr-modal div.dtr-modal-display{width:95%}} + + +table.dataTable tr.dtrg-group td{background-color:#e0e0e0}table.dataTable tr.dtrg-group.dtrg-level-0 td{font-weight:bold}table.dataTable tr.dtrg-group.dtrg-level-1 td,table.dataTable tr.dtrg-group.dtrg-level-2 td,table.dataTable tr.dtrg-group.dtrg-level-3 td,table.dataTable tr.dtrg-group.dtrg-level-4 td,table.dataTable tr.dtrg-group.dtrg-level-5 td{background-color:#f0f0f0;padding-top:.25em;padding-bottom:.25em;padding-left:2em;font-size:.9em}table.dataTable tr.dtrg-group.dtrg-level-2 td{background-color:#f3f3f3;padding-left:2.5em}table.dataTable tr.dtrg-group.dtrg-level-3 td{background-color:#f3f3f3;padding-left:3em}table.dataTable tr.dtrg-group.dtrg-level-4 td{background-color:#f3f3f3;padding-left:3.5em}table.dataTable tr.dtrg-group.dtrg-level-5 td{background-color:#f3f3f3;padding-left:4em} + + +table.dt-rowReorder-float{position:absolute !important;opacity:.8;table-layout:fixed;outline:2px solid #888;outline-offset:-2px;z-index:2001}tr.dt-rowReorder-moving{outline:2px solid #555;outline-offset:-2px}body.dt-rowReorder-noOverflow{overflow-x:hidden}table.dataTable td.reorder{text-align:center;cursor:move} + + +div.dts{display:block !important}div.dts tbody th,div.dts tbody td{white-space:nowrap}div.dts div.dts_loading{z-index:1}div.dts div.dts_label{position:absolute;right:10px;background:rgba(0, 0, 0, 0.8);color:white;box-shadow:3px 3px 10px rgba(0, 0, 0, 0.5);text-align:right;border-radius:3px;padding:.4em;z-index:2;display:none}div.dts div.dataTables_scrollBody{background:repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, white 10px, white 20px)}div.dts div.dataTables_scrollBody table{z-index:2}div.dts div.dataTables_paginate,div.dts div.dataTables_length{display:none} + + +div.dt-button-collection{overflow:visible !important;z-index:2002 !important}div.dt-button-collection div.dtsb-searchBuilder{width:99% !important;padding-left:10px !important;padding-right:10px !important}div.dt-button-collection.dtb-collection-closeable div.dtsb-titleRow{padding-right:40px}.dtsb-greyscale{border:1px solid #cecece !important}div.dtsb-logicContainer .dtsb-greyscale{border:none !important}div.dtsb-searchBuilder{justify-content:space-evenly;cursor:default;margin-bottom:1em;text-align:left}div.dtsb-searchBuilder button.dtsb-button,div.dtsb-searchBuilder select{font-size:1em}div.dtsb-searchBuilder div.dtsb-titleRow{justify-content:space-evenly;margin-bottom:.5em}div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title{display:inline-block;padding-top:6px}div.dtsb-searchBuilder div.dtsb-titleRow div.dtsb-title:empty{display:inline}div.dtsb-searchBuilder div.dtsb-titleRow button.dtsb-clearAll{float:right;margin-bottom:.333em}div.dtsb-searchBuilder div.dtsb-vertical .dtsb-value,div.dtsb-searchBuilder div.dtsb-vertical .dtsb-data,div.dtsb-searchBuilder div.dtsb-vertical .dtsb-condition{display:block}div.dtsb-searchBuilder div.dtsb-group{position:relative;clear:both;margin-bottom:.8em}div.dtsb-searchBuilder div.dtsb-group button.dtsb-clearGroup{margin:2px;text-align:center;padding:0}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);position:absolute;margin-top:.8em;margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria{margin-bottom:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input{padding:.4em;margin-right:.8em;max-width:20em;background-color:rgba(200, 200, 200, 0.3)}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown option.dtsb-notItalic,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input option.dtsb-notItalic{font-style:normal}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-italic{font-style:italic}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer{float:right;display:inline-block}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left{margin-right:.8em}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-delete:last-child,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-right:last-child,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria div.dtsb-buttonContainer button.dtsb-left:last-child{margin-right:0}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria span.dtsp-joiner{margin-right:.8em}div.dtsb-searchBuilder button,div.dtsb-searchBuilder select,div.dtsb-searchBuilder input{background-color:#f9f9f9}div.dtsb-searchBuilder button.dtsb-button{position:relative;display:inline-block;box-sizing:border-box;padding:.5em 1em;border:1px solid rgba(0, 0, 0, 0.3);border-radius:2px;cursor:pointer;font-size:.88em;line-height:1.6em;color:black;white-space:nowrap;overflow:hidden;background-color:rgba(0, 0, 0, 0.1);background:linear-gradient(to bottom, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;outline:none;text-overflow:ellipsis}div.dtsb-searchBuilder button.dtsb-button:hover{background-color:#cecece !important;cursor:pointer}div.dtsb-searchBuilder div.dtsb-logicContainer{border:1px solid rgba(0, 0, 0, 0.3);background-color:rgba(0, 0, 0, 0.1);background:linear-gradient(to right, rgba(230, 230, 230, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%)}div.dtsb-searchBuilder div.dtsb-logicContainer button{border:1px solid transparent;background:transparent}div.dtsb-searchBuilder button.dtsb-clearGroup{min-width:2em;padding:0}div.dtsb-searchBuilder button.dtsb-iptbtn{min-width:100px;text-align:left}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer{border:1px solid;border-color:#cecece;border-radius:3px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:flex-start}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-logic{border:none;border-radius:0px;flex-grow:1;flex-shrink:0;flex-basis:3em;margin:0px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-logicContainer button.dtsb-clearGroup{border:none;border-radius:0px;width:2em;margin:0px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-dropDown,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-input{border:1px solid;border-radius:3px}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-condition{border-color:#48b13c}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-data{border-color:#e70f00}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-value,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria input.dtsb-value{border-color:#0069ba}div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-condition option.dtsb-option,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-data option.dtsb-option,div.dtsb-searchBuilder div.dtsb-group div.dtsb-criteria select.dtsb-value option.dtsb-option{background-color:white} + + +div.dtsp-topRow{display:flex;flex-direction:row;flex-wrap:nowrap;border:2px solid rgba(0, 0, 0, 0);border-radius:3px;justify-content:space-around;align-content:flex-start;align-items:flex-start;min-height:37px}div.dtsp-topRow input.dtsp-search{text-overflow:ellipsis;min-width:50px;flex-basis:90px;max-width:none}div.dtsp-topRow input.dtsp-search::placeholder{color:black}div.dtsp-topRow div.dtsp-subRow1{display:flex;flex-direction:row;flex-wrap:nowrap;flex:1 1 auto}div.dtsp-topRow div.dtsp-subRow1 div.dtsp-searchCont{position:relative;width:100%}div.dtsp-topRow div.dtsp-subRow1 div.dtsp-searchCont input.dtsp-disabledButton{padding-top:10px;padding-bottom:10px;background-color:transparent}div.dtsp-topRow div.dtsp-subRow1 input{padding-right:2em;width:100% !important;box-sizing:border-box;font-size:1em}div.dtsp-topRow div.dtsp-subRow1 button.dtsp-searchIcon{position:absolute;top:0;right:0;bottom:0;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAABbmlDQ1BpY2MAACiRdZE7SwNBFIU/EyWikRRaiFhsoWKhEBREO42FTZAQFYza7G5eQhKX3QQJtoKNhWAh2vgq/AfaCrYKgqAIIhb+Al+NhPVOEkiQZJbZ+3FmzmXmDHjCGTPrtAYhm8vb0bmQthxb0Xzv+PHRxRSabjrWTCQSpun4eaRF1YdR1av5voajM55wTGhpF54wLTsvPC0c3sxbineFe8y0Hhc+ER6x5YDCt0o3KvymOFXhL8X2YnQWPKqnlqpjo47NtJ0VHhYeyGYKZvU86ib+RG5pQWqfzH4coswRQsOgwDoZ8oxKzUlmjX3Bsm+eDfGY8rcoYosjRVq8I6IWpGtCalL0hHwZiir3/3k6yfGxSnd/CNpeXfdzEHz7UNpz3d9T1y2dgfcFrnM1/4bkNPkt+l5NGziGwDZc3tQ04wCudqD32dJtvSx5ZXqSSfi4gK4YdN9Dx2olq+o650+wuCVPdAeHRzAk+wNrfw8JaBFXEnV+AAAACXBIWXMAAA9hAAAPYQGoP6dpAAABMUlEQVQoU6XRr0vDQRjH8akoM4iIjqGoOIZ5oIjB5XWxajaYDGLSIhhNYjcPRDSJwbQNw+L+BNGgYYo/5pT5/shz8vDlBgMPXux7z3N3z+25VOofYyCyd4ZYCavI4gXPsRp9LqiDdrEMH+8wv8Vh8gBfWclFPOEUN3hAHjlMoRa7wTzBS5xgKLFglPkZLjDic6HyDsEMNvGR2Nxifoci3tEI+X770JU0XmPXIlax+LTPh83fFox1X6kxyzdjm9UcdXi9S+Vti6svfyNULhNR9TVsYNhW6Ff9KKCNR7/Zv6eeaQ+6+qcdpu9BqGlp1HFgud+FYdzzUcUExu0Q/cdzHGEFetIlXKPjK/sbqYoOftMiS+j9jzEJPd1Wt+5+kdR/9EM9ucIC5jCbyPc01Q32kfsBppYz3hYFcCwAAAAASUVORK5CYII=") !important;background-repeat:no-repeat;background-position:center;background-size:12px}div.dtsp-topRow div.dtsp-subRow2{white-space:nowrap;flex:0 0 auto}div.dtsp-topRow button.dtsp-nameButton{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAYAAAAe2bNZAAABcGlDQ1BpY2MAACiRdZHNSwJBGMYftTDS8FCHkA57sOigIAXRMQzyYh3UIKvL7rirwe66zK6IdA26dBA6RF36OvQf1DXoWhAERRAR9B/0dQnZ3nEFJXSG2ffHs/O8zDwD+DM6M+yBJGCYDs+mU9JaYV0KviNMM4QoEjKzreXcUh59x88jfKI+JESv/vt6jlBRtRngGyKeYxZ3iBeIMzXHErxHPMbKcpH4hDjO6YDEt0JXPH4TXPL4SzDPZxcBv+gplbpY6WJW5gbxNHHM0KusfR5xk7BqruaoRmlNwEYWaaQgQUEVW9DhIEHVpMx6+5It3woq5GH0tVAHJ0cJZfLGSa1SV5WqRrpKU0dd5P4/T1ubnfG6h1PA4Kvrfk4CwX2g2XDd31PXbZ4BgRfg2uz4K5TT/DfpjY4WOwYiO8DlTUdTDoCrXWD82ZK53JICtPyaBnxcACMFYPQeGN7wsmr/x/kTkN+mJ7oDDo+AKdof2fwDCBRoDkL8UccAAAAJcEhZcwAAD2EAAA9hAag/p2kAAAK2SURBVFgJ7ZY9j41BFICvryCExrJBQ6HyEYVEIREaUZDQIRoR2ViJKCioxV+gkVXYTVZEQiEUhG2EQnxUCh0FKolY4ut5XnM2cyfva3Pt5m7EPcmzZ2bemTNnzjkzd1utnvQi0IvAfxiBy5z5FoxO89kPY+8mbMjtzs47RXs5/WVpbAG6bWExt5PuIibvhVkwmC+ck3eK9ln6/fAddFojYzBVuYSBpcnIEvRaqOw2RcaN18FPuJH0JvRUxbT3wWf4ltiKPgfVidWlbGZgPozDFfgAC+EA/K2EI4cwcAJ+gPaeQ+VQU2SOMMGcPgPl/m/V2p50rrbRsRgt9Iv5h6xtpP22Bz7Ce1C+gFFxfKzOmShcU+Qmyh2w3w8rIJfddHTck66EukL/xPhj+JM8rHNmFys0Pg4v0up3aFNlwR9NYyodd3OL/C64zpsymcTFcf6ElM4YzjAWKYrJkaq8kE/yUYNP4BoYvS1QRo+hNtF5xfkTUjoTheukSFFMjlTFm6PjceOca/SMpKfeCR1L6Uzk/y2WIkVhNFJlJAZhP+hYns7b9D3IPuhY5mYrIv8OrQJvR5NYyNaW4jsU8pSGNySiVx4o5tXq3JkoXE/mg5R/M8dGJCJpKhaDcjBRdbI/Rm8g69c122om33BHmj2CHoV5qa9jUXBraJ+G1fAVjIBO1klc87ro1K4JZ/K35SWW3TwcyDd6TecqnAEd8cGq2+w84xvBm1n3vS0izKkkwh5XNC/GmFPqqAtPF89AOScKuemaNzoTV1SD5dtSbmLf1/RV+tC0WTgcj6R7HEtrVGWaqu/lYDZ/2pvxQ/kIyw/gFByHC9AHw910hv1aUUumyd8yy0QfhmEkfiNod0Xusct68J1qc8Tdux0Z97Q+hsDb+AYGYEbF/4Guw2Q/qDPqZG/zXgT+3Qj8AtKnfWhFwmuAAAAAAElFTkSuQmCC") !important;background-repeat:no-repeat;background-position:center;background-size:23px;vert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587ZkIGdesLTt2EkynOnbreMUUKMI/dA4B/QVOcO13CQh+5wWCgDwo/75u59odB/wjmfhbgvACcAOyZPHihMWAoIwxyCLgf1oxfgjzVbgBXSTzIN+f0pg6s5DkcesLMRpsBrgE2XO3CN64JFP7JtUeKHX4CKtRRXFZ+7dEAAAAASUVORK5CYII=") !important;background-repeat:no-repeat;background-position:center;background-size:18px;vertical-align:bottom}div.dtsp-topRow button.dtsp-collapseButton span.dtsp-caret{position:relative;top:2px;display:inline-block}div.dtsp-topRow button.dtsp-collapseButton.dtsp-rotated{transform:rotate(180deg)}div.dtsp-topRow.dtsp-bordered{border:2px solid #f0f0f0;border-radius:3px}div.dtsp-topRow.dtsp-bordered:hover{background-color:#f0f0f0;opacity:.6;border:2px solid #cfcfcf;border-radius:3px;cursor:pointer !important}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane table thead th,div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane table thead td{width:100% !important}div.dt-button-collection{z-index:2002}div.dt-button-collection.dtb-collection-closeable div.dtsp-titleRow{padding-right:25px}div.dtsp-columns-1{max-width:100%;margin:0px !important}div.dtsp-columns-2{max-width:49%;margin:0px !important}div.dtsp-columns-3{max-width:32%;margin:0px !important}div.dtsp-columns-4{max-width:24%;margin:0px !important}div.dtsp-columns-5{max-width:19%;margin:0px !important}div.dtsp-columns-6{max-width:16%;margin:0px !important}div.dtsp-columns-7{max-width:14%;margin:0px !important}div.dtsp-columns-8{min-width:12%;margin:0px !important}div.dtsp-columns-9{max-width:10.5%;margin:0px !important}div.dt-button-collection{float:none}div.dtsp-panesContainer{margin-bottom:1em}div.dtsp-panesContainer div.dataTables_wrapper{width:100%}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_layout_cell{padding:0}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollHead{display:none !important}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody{background:white !important;border-bottom:none}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody thead{display:none}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody table{table-layout:fixed}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody table tr>th,div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody table tr>td{padding:5px 10px}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody td.dtsp-nameColumn{width:100% !important}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody div.dtsp-nameCont{width:100%;display:flex;flex-direction:row;justify-content:flex-start;align-content:flex-start;align-items:flex-start}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody div.dtsp-nameCont span.dtsp-name,div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody div.dtsp-nameCont span.dtsp-pill{cursor:default}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody div.dtsp-nameCont span.dtsp-name{text-overflow:ellipsis;overflow:hidden;display:inline-block;vertical-align:middle;white-space:nowrap;flex-grow:1;text-align:left}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody div.dtsp-nameCont span.dtsp-pill{display:inline-block;background-color:#cfcfcf;text-align:center;border:1px solid #cfcfcf;border-radius:10px;width:auto;min-width:30px;color:black;font-size:.9em;padding:0 4px}div.dtsp-panesContainer div.dataTables_wrapper div.dataTables_scrollBody div.dtsp-nameCont span.dtsp-pill:empty{display:none}div.dtsp-panesContainer{clear:both;padding-left:0;padding-right:0;text-align:center}div.dtsp-panesContainer div.dtsp-searchPanes{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;align-content:flex-start;align-items:stretch;clear:both;text-align:left}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane{flex-grow:1;flex-shrink:0;font-size:.9em;margin-top:15px !important}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane div.dataTables_wrapper{flex:1;box-sizing:border-box}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane div.dataTables_wrapper div.dataTables_filter{display:none}div.dtsp-panesContainer div.dtsp-title{float:left;padding:10px 0}div.dtsp-panesContainer button.dtsp-clearAll,div.dtsp-panesContainer button.dtsp-collapseAll,div.dtsp-panesContainer button.dtsp-showAll{float:right;padding:10px}div.dtsp-hidden{display:none !important}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane div.dataTables_wrapper{border:2px solid #f0f0f0;border-radius:4px}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane div.dataTables_wrapper:hover{border:2px solid #cfcfcf}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane div.dtsp-selected{border:2px solid #3276b1;border-radius:4px}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane div.dtsp-selected:hover{border:2px solid #286092}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane div.dtsp-topRow div.dtsp-searchCont input.dtsp-search{border:none;padding-left:3px}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane input.dtsp-paneInputButton,div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane button.dtsp-paneButton{height:35px;width:35px;min-width:0;display:inline-block;margin:2px;border:0px solid transparent;background-color:transparent;margin-bottom:0px}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane input.dtsp-paneInputButton:hover,div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane button.dtsp-paneButton:hover{background-color:#f0f0f0;border-radius:2px;cursor:pointer}div.dtsp-panesContainer div.dtsp-searchPanes div.dtsp-searchPane button.dtsp-paneButton{opacity:.6}div.dtsp-panesContainer button.dtsp-clearAll,div.dtsp-panesContainer button.dtsp-collapseAll,div.dtsp-panesContainer button.dtsp-showAll{border:1px solid transparent;background-color:transparent}div.dtsp-panesContainer button.dtsp-clearAll:hover,div.dtsp-panesContainer button.dtsp-collapseAll:hover,div.dtsp-panesContainer button.dtsp-showAll:hover{background-color:#f0f0f0;border-radius:2px;cursor:pointer}div.dtsp-panesContainer button.dtsp-disabledButton{cursor:default !important;color:#7c7c7c}div.dtsp-panesContainer button.dtsp-disabledButton:hover{background-color:transparent}div.dtsp-panesContainer button.dtsp-disabledButton:focus{outline:none}div.dtsp-topRow.dtsp-bordered:hover button.dtsp-disabledButton{cursor:pointer !important;pointer-events:none}div.dtsp-topRow.dtsp-bordered:hover input.dtsp-paneInputButton{pointer-events:none}div.dtsp-narrow{flex-direction:column !important}div.dtsp-narrow div.dtsp-subRows{width:100%;text-align:right}@media screen and (max-width: 767px){div.dtsp-columns-4,div.dtsp-columns-5,div.dtsp-columns-6{max-width:31% !important;min-width:31% !important}}@media screen and (max-width: 640px){div.dtsp-searchPanes{flex-direction:column !important}div.dtsp-searchPane{max-width:98% !important;min-width:98% !important}} + + +table.dataTable tbody>tr.selected,table.dataTable tbody>tr>.selected{background-color:#b0bed9}table.dataTable.stripe tbody>tr.odd.selected,table.dataTable.stripe tbody>tr.odd>.selected,table.dataTable.display tbody>tr.odd.selected,table.dataTable.display tbody>tr.odd>.selected{background-color:#acbad4}table.dataTable.hover tbody>tr.selected:hover,table.dataTable.hover tbody>tr>.selected:hover,table.dataTable.display tbody>tr.selected:hover,table.dataTable.display tbody>tr>.selected:hover{background-color:#aab7d1}table.dataTable.order-column tbody>tr.selected>.sorting_1,table.dataTable.order-column tbody>tr.selected>.sorting_2,table.dataTable.order-column tbody>tr.selected>.sorting_3,table.dataTable.order-column tbody>tr>.selected,table.dataTable.display tbody>tr.selected>.sorting_1,table.dataTable.display tbody>tr.selected>.sorting_2,table.dataTable.display tbody>tr.selected>.sorting_3,table.dataTable.display tbody>tr>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody>tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody>tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody>tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody>tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody>tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody>tr.odd>.selected,table.dataTable.order-column.stripe tbody>tr.odd>.selected{background-color:#a6b4cd}table.dataTable.display tbody>tr.even>.selected,table.dataTable.order-column.stripe tbody>tr.even>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.selected:hover>.sorting_1,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody>tr.selected:hover>.sorting_2,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody>tr.selected:hover>.sorting_3,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_3{background-color:#a5b2cb}table.dataTable.display tbody>tr:hover>.selected,table.dataTable.display tbody>tr>.selected:hover,table.dataTable.order-column.hover tbody>tr:hover>.selected,table.dataTable.order-column.hover tbody>tr>.selected:hover{background-color:#a2aec7}table.dataTable tbody td.select-checkbox,table.dataTable tbody th.select-checkbox{position:relative}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody td.select-checkbox:after,table.dataTable tbody th.select-checkbox:before,table.dataTable tbody th.select-checkbox:after{display:block;position:absolute;top:1.2em;left:50%;width:12px;height:12px;box-sizing:border-box}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody th.select-checkbox:before{content:" ";margin-top:-6px;margin-left:-6px;border:1px solid black;border-radius:3px}table.dataTable tr.selected td.select-checkbox:after,table.dataTable tr.selected th.select-checkbox:after{content:"✓";font-size:20px;margin-top:-19px;margin-left:-6px;text-align:center;text-shadow:1px 1px #b0bed9,-1px -1px #b0bed9,1px -1px #b0bed9,-1px 1px #b0bed9}table.dataTable.compact tbody td.select-checkbox:before,table.dataTable.compact tbody th.select-checkbox:before{margin-top:-12px}table.dataTable.compact tr.selected td.select-checkbox:after,table.dataTable.compact tr.selected th.select-checkbox:after{margin-top:-16px}div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:.5em}@media screen and (max-width: 640px){div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0;display:block}} + + +div.dtsr-confirmation,div.dtsr-creation{position:fixed;top:20%;left:50%;width:500px;background-color:white;margin-left:-250px;border-radius:6px;box-shadow:0 0 5px #555;border:2px solid #444;z-index:2003;box-sizing:border-box;padding:1em}div.dtsr-confirmation div.dtsr-confirmation-title-row,div.dtsr-creation div.dtsr-confirmation-title-row{text-align:left}div.dtsr-confirmation div.dtsr-confirmation-title-row h2,div.dtsr-creation div.dtsr-confirmation-title-row h2{border-bottom:0px;margin-top:0px;padding-top:0px}div.dtsr-confirmation div.dtsr-confirmation-text,div.dtsr-creation div.dtsr-confirmation-text{text-align:center}div.dtsr-confirmation div.dtsr-confirmation-buttons,div.dtsr-creation div.dtsr-confirmation-buttons{text-align:right;margin-top:1em}div.dtsr-confirmation div.dtsr-confirmation-buttons button.dtsr-confirmation-button,div.dtsr-creation div.dtsr-confirmation-buttons button.dtsr-confirmation-button{margin:0px}div.dtsr-confirmation div.dtsr-creation-text,div.dtsr-creation div.dtsr-creation-text{text-align:left;padding:0px;border:none}div.dtsr-confirmation div.dtsr-creation-text span,div.dtsr-creation div.dtsr-creation-text span{font-size:20px}div.dtsr-confirmation div.dtsr-creation-form div.dtsr-left,div.dtsr-confirmation div.dtsr-creation-form div.dtsr-right,div.dtsr-creation div.dtsr-creation-form div.dtsr-left,div.dtsr-creation div.dtsr-creation-form div.dtsr-right{display:inline-block;width:50%}div.dtsr-confirmation div.dtsr-creation-form div.dtsr-left,div.dtsr-creation div.dtsr-creation-form div.dtsr-left{text-align:right}div.dtsr-confirmation div.dtsr-creation-form div.dtsr-right,div.dtsr-confirmation div.dtsr-creation-form div.dtsr-name-row,div.dtsr-creation div.dtsr-creation-form div.dtsr-right,div.dtsr-creation div.dtsr-creation-form div.dtsr-name-row{text-align:left}div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label.dtsr-name-label,div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label.dtsr-name-label{width:33.3%;display:inline-block;text-align:right;padding-right:15px;padding-left:15px}div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input,div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input{width:66.6%;display:inline-block}div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box,div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box{margin-left:33.3%;margin-right:14px;display:inline-block}div.dtsr-confirmation div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title,div.dtsr-creation div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title{margin-right:-33.3%}div.dtsr-confirmation div.dtsr-confirmation-text,div.dtsr-creation div.dtsr-confirmation-text{text-align:left}div.dtsr-confirmation div.dtsr-confirmation-text label.dtsr-name-label,div.dtsr-creation div.dtsr-confirmation-text label.dtsr-name-label{width:auto;display:inline-block;text-align:right;padding-right:15px}div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-name-input,div.dtsr-creation div.dtsr-confirmation-text input.dtsr-name-input{width:66.6%;display:inline-block}div.dtsr-confirmation div.dtsr-confirmation-text input.dtsr-check-box,div.dtsr-creation div.dtsr-confirmation-text input.dtsr-check-box{margin-left:33.3%;margin-right:14px;display:inline-block}div.dtsr-confirmation div.dtsr-modal-foot,div.dtsr-creation div.dtsr-modal-foot{text-align:right;padding-top:10px}div.dtsr-confirmation span.dtsr-modal-error,div.dtsr-creation span.dtsr-modal-error{color:red;font-size:.9em}div.dtsr-creation{top:10%}div.dtsr-form-row{padding:10px}div.dtsr-check-row{padding-top:0px}div.dtsr-creation-text{padding:10px}div.dtsr-popover-close{position:absolute;top:10px;right:10px;width:22px;height:22px;border:1px solid #eaeaea;background-color:#f9f9f9;text-align:center;border-radius:3px;cursor:pointer;z-index:12}div.dtsr-background{z-index:2002;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);background:radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%)}div.dt-button-collection h3{text-align:center;margin-top:4px;margin-bottom:8px;font-size:1.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}div.dt-button-collection span.dtsr-emptyStates{border-radius:5px;display:inline-block;line-height:1.6em;white-space:nowrap;text-align:center;vertical-align:middle;width:100%;padding-bottom:7px;padding-top:3px}div.dt-button-collection h3{font-size:1.1em}div.dtsr-creation-form div.dtsr-form-row input.dtsr-name-input{width:57% !important;padding:5px 4px;border:1px solid #aaa;border-radius:3px}div.dtsr-creation-form div.dtsr-form-row input.dtsr-check-box{margin-left:calc(33.3% + 30px) !important}div.dtsr-creation-form div.dtsr-form-row label.dtsr-toggle-title{margin-right:calc(-33.3% - 30px) !important} + + diff --git a/media/datatable/css/index.html b/media/datatable/css/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/media/datatable/css/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/datatable/index.html b/media/datatable/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/media/datatable/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/media/datatable/js/datatables.min.js b/media/datatable/js/datatables.min.js new file mode 100644 index 000000000..cd9d16380 --- /dev/null +++ b/media/datatable/js/datatables.min.js @@ -0,0 +1,1238 @@ +/* + * This combined file was created by the DataTables downloader builder: + * https://datatables.net/download + * + * To rebuild or modify this file with the latest versions of the included + * software please visit: + * https://datatables.net/download/#dt/jszip-2.5.0/dt-1.11.5/b-2.2.2/b-colvis-2.2.2/b-html5-2.2.2/b-print-2.2.2/cr-1.5.5/date-1.1.2/fc-4.0.2/fh-3.2.2/kt-2.6.4/r-2.2.9/rg-1.1.4/rr-1.2.8/sc-2.0.5/sb-1.3.2/sp-2.0.0/sl-1.3.4/sr-1.1.0 + * + * Included libraries: + * JSZip 2.5.0, DataTables 1.11.5, Buttons 2.2.2, Column visibility 2.2.2, HTML5 export 2.2.2, Print view 2.2.2, ColReorder 1.5.5, DateTime 1.1.2, FixedColumns 4.0.2, FixedHeader 3.2.2, KeyTable 2.6.4, Responsive 2.2.9, RowGroup 1.1.4, RowReorder 1.2.8, Scroller 2.0.5, SearchBuilder 1.3.2, SearchPanes 2.0.0, Select 1.3.4, StateRestore 1.1.0 + */ + +/*! + +JSZip - A Javascript class for generating and reading zip files + + +(c) 2009-2014 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/master/LICENSE +*/ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.JSZip=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g>2,g=(3&b)<<4|c>>4,h=(15&c)<<2|e>>6,i=63&e,isNaN(c)?h=i=64:isNaN(e)&&(i=64),j=j+d.charAt(f)+d.charAt(g)+d.charAt(h)+d.charAt(i);return j},c.decode=function(a){var b,c,e,f,g,h,i,j="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k>4,c=(15&g)<<4|h>>2,e=(3&h)<<6|i,j+=String.fromCharCode(b),64!=h&&(j+=String.fromCharCode(c)),64!=i&&(j+=String.fromCharCode(e));return j}},{}],2:[function(a,b){"use strict";function c(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}c.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},b.exports=c},{}],3:[function(a,b,c){"use strict";c.STORE={magic:"\x00\x00",compress:function(a){return a},uncompress:function(a){return a},compressInputType:null,uncompressInputType:null},c.DEFLATE=a("./flate")},{"./flate":8}],4:[function(a,b){"use strict";var c=a("./utils"),d=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];b.exports=function(a,b){if("undefined"==typeof a||!a.length)return 0;var e="string"!==c.getTypeOf(a);"undefined"==typeof b&&(b=0);var f=0,g=0,h=0;b=-1^b;for(var i=0,j=a.length;j>i;i++)h=e?a[i]:a.charCodeAt(i),g=255&(b^h),f=d[g],b=b>>>8^f;return-1^b}},{"./utils":21}],5:[function(a,b){"use strict";function c(){this.data=null,this.length=0,this.index=0}var d=a("./utils");c.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.lengtha)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var b,c=0;for(this.checkOffset(a),b=this.index+a-1;b>=this.index;b--)c=(c<<8)+this.byteAt(b);return this.index+=a,c},readString:function(a){return d.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)}},b.exports=c},{"./utils":21}],6:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!1,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],7:[function(a,b,c){"use strict";var d=a("./utils");c.string2binary=function(a){return d.string2binary(a)},c.string2Uint8Array=function(a){return d.transformTo("uint8array",a)},c.uint8Array2String=function(a){return d.transformTo("string",a)},c.string2Blob=function(a){var b=d.transformTo("arraybuffer",a);return d.arrayBuffer2Blob(b)},c.arrayBuffer2Blob=function(a){return d.arrayBuffer2Blob(a)},c.transformTo=function(a,b){return d.transformTo(a,b)},c.getTypeOf=function(a){return d.getTypeOf(a)},c.checkSupport=function(a){return d.checkSupport(a)},c.MAX_VALUE_16BITS=d.MAX_VALUE_16BITS,c.MAX_VALUE_32BITS=d.MAX_VALUE_32BITS,c.pretty=function(a){return d.pretty(a)},c.findCompression=function(a){return d.findCompression(a)},c.isRegExp=function(a){return d.isRegExp(a)}},{"./utils":21}],8:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,e=a("pako");c.uncompressInputType=d?"uint8array":"array",c.compressInputType=d?"uint8array":"array",c.magic="\b\x00",c.compress=function(a,b){return e.deflateRaw(a,{level:b.level||-1})},c.uncompress=function(a){return e.inflateRaw(a)}},{pako:24}],9:[function(a,b){"use strict";function c(a,b){return this instanceof c?(this.files={},this.comment=null,this.root="",a&&this.load(a,b),void(this.clone=function(){var a=new c;for(var b in this)"function"!=typeof this[b]&&(a[b]=this[b]);return a})):new c(a,b)}var d=a("./base64");c.prototype=a("./object"),c.prototype.load=a("./load"),c.support=a("./support"),c.defaults=a("./defaults"),c.utils=a("./deprecatedPublicUtils"),c.base64={encode:function(a){return d.encode(a)},decode:function(a){return d.decode(a)}},c.compressions=a("./compressions"),b.exports=c},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(a,b){"use strict";var c=a("./base64"),d=a("./zipEntries");b.exports=function(a,b){var e,f,g,h;for(b=b||{},b.base64&&(a=c.decode(a)),f=new d(a,b),e=f.files,g=0;gc;c++)d+=String.fromCharCode(255&a),a>>>=8;return d},t=function(){var a,b,c={};for(a=0;a0?a.substring(0,b):""},x=function(a){return"/"!=a.slice(-1)&&(a+="/"),a},y=function(a,b){return b="undefined"!=typeof b?b:!1,a=x(a),this.files[a]||v.call(this,a,null,{dir:!0,createFolders:b}),this.files[a]},z=function(a,b,c){var f,g=new j;return a._data instanceof j?(g.uncompressedSize=a._data.uncompressedSize,g.crc32=a._data.crc32,0===g.uncompressedSize||a.dir?(b=i.STORE,g.compressedContent="",g.crc32=0):a._data.compressionMethod===b.magic?g.compressedContent=a._data.getCompressedContent():(f=a._data.getContent(),g.compressedContent=b.compress(d.transformTo(b.compressInputType,f),c))):(f=p(a),(!f||0===f.length||a.dir)&&(b=i.STORE,f=""),g.uncompressedSize=f.length,g.crc32=e(f),g.compressedContent=b.compress(d.transformTo(b.compressInputType,f),c)),g.compressedSize=g.compressedContent.length,g.compressionMethod=b.magic,g},A=function(a,b){var c=a;return a||(c=b?16893:33204),(65535&c)<<16},B=function(a){return 63&(a||0)},C=function(a,b,c,g,h){var i,j,k,m,n=(c.compressedContent,d.transformTo("string",l.utf8encode(b.name))),o=b.comment||"",p=d.transformTo("string",l.utf8encode(o)),q=n.length!==b.name.length,r=p.length!==o.length,t=b.options,u="",v="",w="";k=b._initialMetadata.dir!==b.dir?b.dir:t.dir,m=b._initialMetadata.date!==b.date?b.date:t.date;var x=0,y=0;k&&(x|=16),"UNIX"===h?(y=798,x|=A(b.unixPermissions,k)):(y=20,x|=B(b.dosPermissions,k)),i=m.getHours(),i<<=6,i|=m.getMinutes(),i<<=5,i|=m.getSeconds()/2,j=m.getFullYear()-1980,j<<=4,j|=m.getMonth()+1,j<<=5,j|=m.getDate(),q&&(v=s(1,1)+s(e(n),4)+n,u+="up"+s(v.length,2)+v),r&&(w=s(1,1)+s(this.crc32(p),4)+p,u+="uc"+s(w.length,2)+w);var z="";z+="\n\x00",z+=q||r?"\x00\b":"\x00\x00",z+=c.compressionMethod,z+=s(i,2),z+=s(j,2),z+=s(c.crc32,4),z+=s(c.compressedSize,4),z+=s(c.uncompressedSize,4),z+=s(n.length,2),z+=s(u.length,2);var C=f.LOCAL_FILE_HEADER+z+n+u,D=f.CENTRAL_FILE_HEADER+s(y,2)+z+s(p.length,2)+"\x00\x00\x00\x00"+s(x,4)+s(g,4)+n+u+p;return{fileRecord:C,dirRecord:D,compressedObject:c}},D={load:function(){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(a){var b,c,d,e,f=[];for(b in this.files)this.files.hasOwnProperty(b)&&(d=this.files[b],e=new r(d.name,d._data,t(d.options)),c=b.slice(this.root.length,b.length),b.slice(0,this.root.length)===this.root&&a(c,e)&&f.push(e));return f},file:function(a,b,c){if(1===arguments.length){if(d.isRegExp(a)){var e=a;return this.filter(function(a,b){return!b.dir&&e.test(a)})}return this.filter(function(b,c){return!c.dir&&b===a})[0]||null}return a=this.root+a,v.call(this,a,b,c),this},folder:function(a){if(!a)return this;if(d.isRegExp(a))return this.filter(function(b,c){return c.dir&&a.test(b)});var b=this.root+a,c=y.call(this,b),e=this.clone();return e.root=c.name,e},remove:function(a){a=this.root+a;var b=this.files[a];if(b||("/"!=a.slice(-1)&&(a+="/"),b=this.files[a]),b&&!b.dir)delete this.files[a];else for(var c=this.filter(function(b,c){return c.name.slice(0,a.length)===a}),d=0;d=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)return f;return-1},c.prototype.readData=function(a){if(this.checkOffset(a),0===a)return new Uint8Array(0);var b=this.data.subarray(this.index,this.index+a);return this.index+=a,b},b.exports=c},{"./dataReader":5}],19:[function(a,b){"use strict";var c=a("./utils"),d=function(a){this.data=new Uint8Array(a),this.index=0};d.prototype={append:function(a){0!==a.length&&(a=c.transformTo("uint8array",a),this.data.set(a,this.index),this.index+=a.length)},finalize:function(){return this.data}},b.exports=d},{"./utils":21}],20:[function(a,b,c){"use strict";for(var d=a("./utils"),e=a("./support"),f=a("./nodeBuffer"),g=new Array(256),h=0;256>h;h++)g[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;g[254]=g[254]=1;var i=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=e.uint8array?new Uint8Array(i):new Array(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},j=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+g[a[c]]>b?c:b},k=function(a){var b,c,e,f,h=a.length,i=new Array(2*h);for(c=0,b=0;h>b;)if(e=a[b++],128>e)i[c++]=e;else if(f=g[e],f>4)i[c++]=65533,b+=f-1;else{for(e&=2===f?31:3===f?15:7;f>1&&h>b;)e=e<<6|63&a[b++],f--;f>1?i[c++]=65533:65536>e?i[c++]=e:(e-=65536,i[c++]=55296|e>>10&1023,i[c++]=56320|1023&e)}return i.length!==c&&(i.subarray?i=i.subarray(0,c):i.length=c),d.applyFromCharCode(i)};c.utf8encode=function(a){return e.nodebuffer?f(a,"utf-8"):i(a)},c.utf8decode=function(a){if(e.nodebuffer)return d.transformTo("nodebuffer",a).toString("utf-8");a=d.transformTo(e.uint8array?"uint8array":"array",a);for(var b=[],c=0,f=a.length,g=65536;f>c;){var h=j(a,Math.min(c+g,f));b.push(e.uint8array?k(a.subarray(c,h)):k(a.slice(c,h))),c=h}return b.join("")}},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(a,b,c){"use strict";function d(a){return a}function e(a,b){for(var c=0;cg&&b>1;)try{d.push("array"===f||"nodebuffer"===f?String.fromCharCode.apply(null,a.slice(g,Math.min(g+b,e))):String.fromCharCode.apply(null,a.subarray(g,Math.min(g+b,e)))),g+=b}catch(i){b=Math.floor(b/2)}return d.join("")}function g(a,b){for(var c=0;cb?"0":"")+b.toString(16).toUpperCase();return d},c.findCompression=function(a){for(var b in i)if(i.hasOwnProperty(b)&&i[b].magic===a)return i[b];return null},c.isRegExp=function(a){return"[object RegExp]"===Object.prototype.toString.call(a)}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(a,b){"use strict";function c(a,b){this.files=[],this.loadOptions=b,a&&this.load(a)}var d=a("./stringReader"),e=a("./nodeBufferReader"),f=a("./uint8ArrayReader"),g=a("./utils"),h=a("./signature"),i=a("./zipEntry"),j=a("./support"),k=a("./object");c.prototype={checkSignature:function(a){var b=this.reader.readString(4);if(b!==a)throw new Error("Corrupted zip or bug : unexpected signature ("+g.pretty(b)+", expected "+g.pretty(a)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=k.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var a,b,c,d=this.zip64EndOfCentralSize-44,e=0;d>e;)a=this.reader.readInt(2),b=this.reader.readInt(4),c=this.reader.readString(b),this.zip64ExtensibleData[a]={id:a,length:b,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var a,b;for(a=0;a>8;this.dir=16&this.externalFileAttributes?!0:!1,a===h&&(this.dosPermissions=63&this.externalFileAttributes),a===i&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileName.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var a=new d(this.extraFields[1].value);this.uncompressedSize===e.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===e.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===e.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===e.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4))}},readExtraFields:function(a){var b,c,d,e=a.index;for(this.extraFields=this.extraFields||{};a.index0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==n)throw new Error(j[c]);b.header&&g.deflateSetHeader(this.strm,b.header)};s.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?m:l,e.input="string"==typeof a?i.string2buf(a):a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new h.Buf8(f),e.next_out=0,e.avail_out=f),c=g.deflate(e,d),c!==o&&c!==n)return this.onEnd(c),this.ended=!0,!1;(0===e.avail_out||0===e.avail_in&&d===m)&&this.onData("string"===this.options.to?i.buf2binstring(h.shrinkBuf(e.output,e.next_out)):h.shrinkBuf(e.output,e.next_out))}while((e.avail_in>0||0===e.avail_out)&&c!==o);return d===m?(c=g.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===n):!0},s.prototype.onData=function(a){this.chunks.push(a)},s.prototype.onEnd=function(a){a===n&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=s,c.deflate=d,c.deflateRaw=e,c.gzip=f},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(a,b,c){"use strict";function d(a,b){var c=new m(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function e(a,b){return b=b||{},b.raw=!0,d(a,b)}var f=a("./zlib/inflate.js"),g=a("./utils/common"),h=a("./utils/strings"),i=a("./zlib/constants"),j=a("./zlib/messages"),k=a("./zlib/zstream"),l=a("./zlib/gzheader"),m=function(a){this.options=g.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=f.inflateInit2(this.strm,b.windowBits);if(c!==i.Z_OK)throw new Error(j[c]);this.header=new l,f.inflateGetHeader(this.strm,this.header)};m.prototype.push=function(a,b){var c,d,e,j,k,l=this.strm,m=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?i.Z_FINISH:i.Z_NO_FLUSH,l.input="string"==typeof a?h.binstring2buf(a):a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new g.Buf8(m),l.next_out=0,l.avail_out=m),c=f.inflate(l,i.Z_NO_FLUSH),c!==i.Z_STREAM_END&&c!==i.Z_OK)return this.onEnd(c),this.ended=!0,!1;l.next_out&&(0===l.avail_out||c===i.Z_STREAM_END||0===l.avail_in&&d===i.Z_FINISH)&&("string"===this.options.to?(e=h.utf8border(l.output,l.next_out),j=l.next_out-e,k=h.buf2string(l.output,e),l.next_out=j,l.avail_out=m-j,j&&g.arraySet(l.output,l.output,e,j,0),this.onData(k)):this.onData(g.shrinkBuf(l.output,l.next_out)))}while(l.avail_in>0&&c!==i.Z_STREAM_END);return c===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(c=f.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===i.Z_OK):!0},m.prototype.onData=function(a){this.chunks.push(a)},m.prototype.onEnd=function(a){a===i.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=m,c.inflate=d,c.inflateRaw=e,c.ungzip=d},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){var b,c,d,e,f,g;for(d=0,b=0,c=a.length;c>b;b++)d+=a[b].length;for(g=new Uint8Array(d),e=0,b=0,c=a.length;c>b;b++)f=a[b],g.set(f,e),e+=f.length;return g}},f={arraySet:function(a,b,c,d,e){for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(a){a?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,e)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,f))},c.setTyped(d)},{}],28:[function(a,b,c){"use strict";function d(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&f))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var c="",d=0;b>d;d++)c+=String.fromCharCode(a[d]);return c}var e=a("./common"),f=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(h){f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){g=!1}for(var i=new e.Buf8(256),j=0;256>j;j++)i[j]=j>=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=new e.Buf8(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;d>c;c++)b[c]=a.charCodeAt(c);return b},c.buf2string=function(a,b){var c,e,f,g,h=b||a.length,j=new Array(2*h);for(e=0,c=0;h>c;)if(f=a[c++],128>f)j[e++]=f;else if(g=i[f],g>4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&h>c;)f=f<<6|63&a[c++],g--;g>1?j[e++]=65533:65536>f?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":27}],29:[function(a,b){"use strict";function c(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0}b.exports=c},{}],30:[function(a,b){b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(a,b){"use strict";function c(){for(var a,b=[],c=0;256>c;c++){a=c;for(var d=0;8>d;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function d(a,b,c,d){var f=e,g=d+c;a=-1^a;for(var h=d;g>h;h++)a=a>>>8^f[255&(a^b[h])];return-1^a}var e=c();b.exports=d},{}],32:[function(a,b,c){"use strict";function d(a,b){return a.msg=G[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(C.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){D._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,C.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=E(a.adler,b,e,c):2===a.state.wrap&&(a.adler=F(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-jb?a.strstart-(a.w_size-jb):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ib,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&m>f);if(d=ib-(m-f),f=m-ib,d>g){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-jb)){C.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=hb)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===H)return sb;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return sb;if(a.strstart-a.block_start>=a.w_size-jb&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?sb:sb}function o(a,b){for(var c,d;;){if(a.lookahead=hb&&(a.ins_h=(a.ins_h<=hb)if(d=D._tr_tally(a,a.strstart-a.match_start,a.match_length-hb),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=hb){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<=hb&&(a.ins_h=(a.ins_h<4096)&&(a.match_length=hb-1)),a.prev_length>=hb&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-hb,d=D._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-hb),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<=hb&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ib;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&f>e);a.match_length=ib-(f-e),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=hb?(c=D._tr_tally(a,1,a.match_length-hb),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb:tb}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===H)return sb;break}if(a.match_length=0,c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb:tb}function s(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=B[a.level].max_lazy,a.good_match=B[a.level].good_length,a.nice_match=B[a.level].nice_length,a.max_chain_length=B[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=hb-1,a.match_available=0,a.ins_h=0}function t(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new C.Buf16(2*fb),this.dyn_dtree=new C.Buf16(2*(2*db+1)),this.bl_tree=new C.Buf16(2*(2*eb+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new C.Buf16(gb+1),this.heap=new C.Buf16(2*cb+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new C.Buf16(2*cb+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function u(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=X,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?lb:qb,a.adler=2===b.wrap?0:1,b.last_flush=H,D._tr_init(b),M):d(a,O)}function v(a){var b=u(a);return b===M&&s(a.state),b}function w(a,b){return a&&a.state?2!==a.state.wrap?O:(a.state.gzhead=b,M):O}function x(a,b,c,e,f,g){if(!a)return O;var h=1;if(b===R&&(b=6),0>e?(h=0,e=-e):e>15&&(h=2,e-=16),1>f||f>Z||c!==Y||8>e||e>15||0>b||b>9||0>g||g>V)return d(a,O);8===e&&(e=9);var i=new t;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<>1,i.l_buf=3*i.lit_bufsize,i.level=b,i.strategy=g,i.method=c,v(a)}function y(a,b){return x(a,b,Y,$,_,W)}function z(a,b){var c,h,k,l;if(!a||!a.state||b>L||0>b)return a?d(a,O):O;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===rb&&b!==K)return d(a,0===a.avail_out?Q:O);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===lb)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=F(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=mb):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,wb),h.status=qb);else{var m=Y+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=T||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=kb),m+=31-m%31,h.status=qb,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===mb)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=nb)}else h.status=nb;if(h.status===nb)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=ob)}else h.status=ob;if(h.status===ob)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=pb)}else h.status=pb;if(h.status===pb&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=qb)):h.status=qb),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,M}else if(0===a.avail_in&&e(b)<=e(c)&&b!==K)return d(a,Q);if(h.status===rb&&0!==a.avail_in)return d(a,Q);if(0!==a.avail_in||0!==h.lookahead||b!==H&&h.status!==rb){var o=h.strategy===T?r(h,b):h.strategy===U?q(h,b):B[h.level].func(h,b);if((o===ub||o===vb)&&(h.status=rb),o===sb||o===ub)return 0===a.avail_out&&(h.last_flush=-1),M;if(o===tb&&(b===I?D._tr_align(h):b!==L&&(D._tr_stored_block(h,0,0,!1),b===J&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,M}return b!==K?M:h.wrap<=0?N:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?M:N)}function A(a){var b;return a&&a.state?(b=a.state.status,b!==lb&&b!==mb&&b!==nb&&b!==ob&&b!==pb&&b!==qb&&b!==rb?d(a,O):(a.state=null,b===qb?d(a,P):M)):O}var B,C=a("../utils/common"),D=a("./trees"),E=a("./adler32"),F=a("./crc32"),G=a("./messages"),H=0,I=1,J=3,K=4,L=5,M=0,N=1,O=-2,P=-3,Q=-5,R=-1,S=1,T=2,U=3,V=4,W=0,X=2,Y=8,Z=9,$=15,_=8,ab=29,bb=256,cb=bb+1+ab,db=30,eb=19,fb=2*cb+1,gb=15,hb=3,ib=258,jb=ib+hb+1,kb=32,lb=42,mb=69,nb=73,ob=91,pb=103,qb=113,rb=666,sb=1,tb=2,ub=3,vb=4,wb=3,xb=function(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e};B=[new xb(0,0,0,0,n),new xb(4,4,8,4,o),new xb(4,5,16,8,o),new xb(4,6,32,32,o),new xb(4,4,16,16,p),new xb(8,16,32,32,p),new xb(8,16,128,128,p),new xb(8,32,128,256,p),new xb(32,128,258,1024,p),new xb(32,258,258,4096,p)],c.deflateInit=y,c.deflateInit2=x,c.deflateReset=v,c.deflateResetKeep=u,c.deflateSetHeader=w,c.deflate=z,c.deflateEnd=A,c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(a,b){"use strict";function c(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}b.exports=c},{}],34:[function(a,b){"use strict";var c=30,d=12;b.exports=function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;e=a.state,f=a.next_in,B=a.input,g=f+(a.avail_in-5),h=a.next_out,C=a.output,i=h-(b-a.avail_out),j=h+(a.avail_out-257),k=e.dmax,l=e.wsize,m=e.whave,n=e.wnext,o=e.window,p=e.hold,q=e.bits,r=e.lencode,s=e.distcode,t=(1<q&&(p+=B[f++]<>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<q&&(p+=B[f++]<>>=w,q-=w),15>q&&(p+=B[f++]<>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<q&&(p+=B[f++]<q&&(p+=B[f++]<k){a.msg="invalid distance too far back",e.mode=c;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&e.sane){a.msg="invalid distance too far back",e.mode=c;break a}if(z=0,A=o,0===n){if(z+=l-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}else if(w>n){if(z+=l+n-w,w-=n,x>w){x-=w;do C[h++]=o[z++];while(--w);if(z=0,x>n){w=n,x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}}else if(z+=n-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}for(;x>2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(g>f&&j>h);x=q>>3,f-=x,q-=x<<3,p&=(1<f?5+(g-f):5-(f-g),a.avail_out=j>h?257+(j-h):257-(h-j),e.hold=p,e.bits=q}},{}],35:[function(a,b,c){"use strict";function d(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=K,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new r.Buf32(ob),b.distcode=b.distdyn=new r.Buf32(pb),b.sane=1,b.back=-1,C):F}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):F}function h(a,b){var c,d;return a&&a.state?(d=a.state,0>b?(c=0,b=-b):(c=(b>>4)+1,48>b&&(b&=15)),b&&(8>b||b>15)?F:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):F}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==C&&(a.state=null),c):F}function j(a){return i(a,rb)}function k(a){if(sb){var b;for(p=new r.Buf32(512),q=new r.Buf32(32),b=0;144>b;)a.lens[b++]=8;for(;256>b;)a.lens[b++]=9;for(;280>b;)a.lens[b++]=7;for(;288>b;)a.lens[b++]=8;for(v(x,a.lens,0,288,p,0,a.work,{bits:9}),b=0;32>b;)a.lens[b++]=5;v(y,a.lens,0,32,q,0,a.work,{bits:5}),sb=!1}a.lencode=p,a.lenbits=9,a.distcode=q,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<=f.wsize?(r.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),r.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(r.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whaven;){if(0===i)break a;i--,m+=e[g++]<>>8&255,c.check=t(c.check,Bb,2,0),m=0,n=0,c.mode=L;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=lb;break}if((15&m)!==J){a.msg="unknown compression method",c.mode=lb;break}if(m>>>=4,n-=4,wb=(15&m)+8,0===c.wbits)c.wbits=wb;else if(wb>c.wbits){a.msg="invalid window size",c.mode=lb;break}c.dmax=1<n;){if(0===i)break a;i--,m+=e[g++]<>8&1),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0,c.mode=M;case M:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<>>8&255,Bb[2]=m>>>16&255,Bb[3]=m>>>24&255,c.check=t(c.check,Bb,4,0)),m=0,n=0,c.mode=N;case N:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<>8),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0,c.mode=O;case O:if(1024&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=P;case P:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wb=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),r.arraySet(c.head.extra,e,g,q,wb)),512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=Q;case Q:if(2048&c.flags){if(0===i)break a;q=0;do wb=e[g+q++],c.head&&wb&&c.length<65536&&(c.head.name+=String.fromCharCode(wb));while(wb&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wb)break a}else c.head&&(c.head.name=null);c.length=0,c.mode=R;case R:if(4096&c.flags){if(0===i)break a;q=0;do wb=e[g+q++],c.head&&wb&&c.length<65536&&(c.head.comment+=String.fromCharCode(wb));while(wb&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wb)break a}else c.head&&(c.head.comment=null);c.mode=S;case S:if(512&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=V;break;case T:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<>>=7&n,n-=7&n,c.mode=ib;break}for(;3>n;){if(0===i)break a;i--,m+=e[g++]<>>=1,n-=1,3&m){case 0:c.mode=X;break;case 1:if(k(c),c.mode=bb,b===B){m>>>=2,n-=2;break a}break;case 2:c.mode=$;break;case 3:a.msg="invalid block type",c.mode=lb}m>>>=2,n-=2;break;case X:for(m>>>=7&n,n-=7&n;32>n;){if(0===i)break a;i--,m+=e[g++]<>>16^65535)){a.msg="invalid stored block lengths",c.mode=lb;break}if(c.length=65535&m,m=0,n=0,c.mode=Y,b===B)break a;case Y:c.mode=Z;case Z:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;r.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=V;break;case $:for(;14>n;){if(0===i)break a;i--,m+=e[g++]<>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=lb;break}c.have=0,c.mode=_;case _:for(;c.haven;){if(0===i)break a;i--,m+=e[g++]<>>=3,n-=3}for(;c.have<19;)c.lens[Cb[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,yb={bits:c.lenbits},xb=v(w,c.lens,0,19,c.lencode,0,c.work,yb),c.lenbits=yb.bits,xb){a.msg="invalid code lengths set",c.mode=lb;break}c.have=0,c.mode=ab;case ab:for(;c.have>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<sb)m>>>=qb,n-=qb,c.lens[c.have++]=sb;else{if(16===sb){for(zb=qb+2;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=qb,n-=qb,0===c.have){a.msg="invalid bit length repeat",c.mode=lb;break}wb=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sb){for(zb=qb+3;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=qb,n-=qb,wb=0,q=3+(7&m),m>>>=3,n-=3}else{for(zb=qb+7;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=qb,n-=qb,wb=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=lb;break}for(;q--;)c.lens[c.have++]=wb}}if(c.mode===lb)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=lb;break}if(c.lenbits=9,yb={bits:c.lenbits},xb=v(x,c.lens,0,c.nlen,c.lencode,0,c.work,yb),c.lenbits=yb.bits,xb){a.msg="invalid literal/lengths set",c.mode=lb;break}if(c.distbits=6,c.distcode=c.distdyn,yb={bits:c.distbits},xb=v(y,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,yb),c.distbits=yb.bits,xb){a.msg="invalid distances set",c.mode=lb;break}if(c.mode=bb,b===B)break a;case bb:c.mode=cb;case cb:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,u(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===V&&(c.back=-1); +break}for(c.back=0;Ab=c.lencode[m&(1<>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<>tb)],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=tb+qb);){if(0===i)break a;i--,m+=e[g++]<>>=tb,n-=tb,c.back+=tb}if(m>>>=qb,n-=qb,c.back+=qb,c.length=sb,0===rb){c.mode=hb;break}if(32&rb){c.back=-1,c.mode=V;break}if(64&rb){a.msg="invalid literal/length code",c.mode=lb;break}c.extra=15&rb,c.mode=db;case db:if(c.extra){for(zb=c.extra;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=eb;case eb:for(;Ab=c.distcode[m&(1<>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<>tb)],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=tb+qb);){if(0===i)break a;i--,m+=e[g++]<>>=tb,n-=tb,c.back+=tb}if(m>>>=qb,n-=qb,c.back+=qb,64&rb){a.msg="invalid distance code",c.mode=lb;break}c.offset=sb,c.extra=15&rb,c.mode=fb;case fb:if(c.extra){for(zb=c.extra;zb>n;){if(0===i)break a;i--,m+=e[g++]<>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=lb;break}c.mode=gb;case gb:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=lb;break}q>c.wnext?(q-=c.wnext,ob=c.wsize-q):ob=c.wnext-q,q>c.length&&(q=c.length),pb=c.window}else pb=f,ob=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pb[ob++];while(--q);0===c.length&&(c.mode=cb);break;case hb:if(0===j)break a;f[h++]=c.length,j--,c.mode=cb;break;case ib:if(c.wrap){for(;32>n;){if(0===i)break a;i--,m|=e[g++]<n;){if(0===i)break a;i--,m+=e[g++]<=D;D++)P[D]=0;for(E=0;o>E;E++)P[b[n+E]]++;for(H=C,G=d;G>=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;G>F&&0===P[F];F++);for(F>H&&(H=F),K=1,D=1;d>=D;D++)if(K<<=1,K-=P[D],0>K)return-1;if(K>0&&(a===g||1!==G))return-1;for(Q[1]=0,D=1;d>D;D++)Q[D+1]=Q[D]+P[D];for(E=0;o>E;E++)0!==b[n+E]&&(r[Q[b[n+E]]++]=E);if(a===g?(N=R=r,y=19):a===h?(N=j,O-=257,R=k,S-=257,y=256):(N=l,R=m,y=-1),M=0,E=0,D=F,x=q,I=H,J=0,v=-1,L=1<e||a===i&&L>f)return 1;for(var T=0;;){T++,z=D-J,r[E]y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[n+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<I+J&&(K-=P[I+J],!(0>=K));)I++,K<<=1;if(L+=1<e||a===i&&L>f)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":27}],37:[function(a,b){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a){return 256>a?gb[a]:gb[256+(a>>>7)]}function f(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function g(a,b,c){a.bi_valid>V-c?(a.bi_buf|=b<>V-a.bi_valid,a.bi_valid+=c-V):(a.bi_buf|=b<>>=1,c<<=1;while(--b>0);return c>>>1}function j(a){16===a.bi_valid?(f(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function k(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;U>=f;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;T>c;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function l(a,b,c){var d,e,f=new Array(U+1),g=0;for(d=1;U>=d;d++)f[d]=g=g+c[d-1]<<1;for(e=0;b>=e;e++){var h=a[2*e+1];0!==h&&(a[2*e]=i(f[h]++,h))}}function m(){var a,b,c,d,e,f=new Array(U+1);for(c=0,d=0;O-1>d;d++)for(ib[d]=c,a=0;a<1<<_[d];a++)hb[c++]=d;for(hb[c-1]=d,e=0,d=0;16>d;d++)for(jb[d]=e,a=0;a<1<>=7;R>d;d++)for(jb[d]=e<<7,a=0;a<1<=b;b++)f[b]=0;for(a=0;143>=a;)eb[2*a+1]=8,a++,f[8]++;for(;255>=a;)eb[2*a+1]=9,a++,f[9]++;for(;279>=a;)eb[2*a+1]=7,a++,f[7]++;for(;287>=a;)eb[2*a+1]=8,a++,f[8]++;for(l(eb,Q+1,f),a=0;R>a;a++)fb[2*a+1]=5,fb[2*a]=i(a,5);kb=new nb(eb,_,P+1,Q,U),lb=new nb(fb,ab,0,R,U),mb=new nb(new Array(0),bb,0,S,W)}function n(a){var b;for(b=0;Q>b;b++)a.dyn_ltree[2*b]=0;for(b=0;R>b;b++)a.dyn_dtree[2*b]=0;for(b=0;S>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*X]=1,a.opt_len=a.static_len=0,a.last_lit=a.matches=0}function o(a){a.bi_valid>8?f(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function p(a,b,c,d){o(a),d&&(f(a,c),f(a,~c)),E.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function q(a,b,c,d){var e=2*b,f=2*c;return a[e]c;c++)0!==f[2*c]?(a.heap[++a.heap_len]=j=c,a.depth[c]=0):f[2*c+1]=0;for(;a.heap_len<2;)e=a.heap[++a.heap_len]=2>j?++j:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,h&&(a.static_len-=g[2*e+1]);for(b.max_code=j,c=a.heap_len>>1;c>=1;c--)r(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],r(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,r(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],k(a,b),l(f,j,a.bl_count)}function u(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;c>=d;d++)e=g,g=b[2*(d+1)+1],++hh?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*Y]++):10>=h?a.bl_tree[2*Z]++:a.bl_tree[2*$]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}function v(a,b,c){var d,e,f=-1,i=b[1],j=0,k=7,l=4;for(0===i&&(k=138,l=3),d=0;c>=d;d++)if(e=i,i=b[2*(d+1)+1],!(++jj){do h(a,e,a.bl_tree);while(0!==--j)}else 0!==e?(e!==f&&(h(a,e,a.bl_tree),j--),h(a,Y,a.bl_tree),g(a,j-3,2)):10>=j?(h(a,Z,a.bl_tree),g(a,j-3,3)):(h(a,$,a.bl_tree),g(a,j-11,7));j=0,f=e,0===i?(k=138,l=3):e===i?(k=6,l=3):(k=7,l=4)}}function w(a){var b;for(u(a,a.dyn_ltree,a.l_desc.max_code),u(a,a.dyn_dtree,a.d_desc.max_code),t(a,a.bl_desc),b=S-1;b>=3&&0===a.bl_tree[2*cb[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function x(a,b,c,d){var e;for(g(a,b-257,5),g(a,c-1,5),g(a,d-4,4),e=0;d>e;e++)g(a,a.bl_tree[2*cb[e]+1],3);v(a,a.dyn_ltree,b-1),v(a,a.dyn_dtree,c-1)}function y(a){var b,c=4093624447;for(b=0;31>=b;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return G;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return H;for(b=32;P>b;b++)if(0!==a.dyn_ltree[2*b])return H;return G}function z(a){pb||(m(),pb=!0),a.l_desc=new ob(a.dyn_ltree,kb),a.d_desc=new ob(a.dyn_dtree,lb),a.bl_desc=new ob(a.bl_tree,mb),a.bi_buf=0,a.bi_valid=0,n(a)}function A(a,b,c,d){g(a,(J<<1)+(d?1:0),3),p(a,b,c,!0)}function B(a){g(a,K<<1,3),h(a,X,eb),j(a)}function C(a,b,c,d){var e,f,h=0;a.level>0?(a.strm.data_type===I&&(a.strm.data_type=y(a)),t(a,a.l_desc),t(a,a.d_desc),h=w(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,e>=f&&(e=f)):e=f=c+5,e>=c+4&&-1!==b?A(a,b,c,d):a.strategy===F||f===e?(g(a,(K<<1)+(d?1:0),3),s(a,eb,fb)):(g(a,(L<<1)+(d?1:0),3),x(a,a.l_desc.max_code+1,a.d_desc.max_code+1,h+1),s(a,a.dyn_ltree,a.dyn_dtree)),n(a),d&&o(a)}function D(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(hb[c]+P+1)]++,a.dyn_dtree[2*e(b)]++),a.last_lit===a.lit_bufsize-1}var E=a("../utils/common"),F=4,G=0,H=1,I=2,J=0,K=1,L=2,M=3,N=258,O=29,P=256,Q=P+1+O,R=30,S=19,T=2*Q+1,U=15,V=16,W=7,X=256,Y=16,Z=17,$=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ab=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],bb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],cb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],db=512,eb=new Array(2*(Q+2));d(eb);var fb=new Array(2*R);d(fb);var gb=new Array(db);d(gb);var hb=new Array(N-M+1);d(hb);var ib=new Array(O);d(ib);var jb=new Array(R);d(jb);var kb,lb,mb,nb=function(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length},ob=function(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b},pb=!1;c._tr_init=z,c._tr_stored_block=A,c._tr_flush_block=C,c._tr_tally=D,c._tr_align=B},{"../utils/common":27}],39:[function(a,b){"use strict";function c(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=c},{}]},{},[9])(9)}); + +/*! + Copyright 2008-2021 SpryMedia Ltd. + + This source file is free software, available under the following license: + MIT license - http://datatables.net/license + + This source file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + + For details please refer to: http://www.datatables.net + DataTables 1.11.5 + ©2008-2021 SpryMedia Ltd - datatables.net/license +*/ +var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(l,z,A){l instanceof String&&(l=String(l));for(var q=l.length,E=0;E").css({position:"fixed",top:0,left:-1*l(z).scrollLeft(),height:1, +width:1,overflow:"hidden"}).append(l("
    ").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(l("
    ").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}l.extend(a.oBrowser,u.__browser);a.oScroll.iBarWidth=u.__browser.barWidth} +function Cb(a,b,c,d,e,h){var f=!1;if(c!==q){var g=c;f=!0}for(;d!==e;)a.hasOwnProperty(d)&&(g=f?b(g,a[d],d,a):a[d],f=!0,d+=h);return g}function Ya(a,b){var c=u.defaults.column,d=a.aoColumns.length;c=l.extend({},u.models.oColumn,c,{nTh:b?b:A.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=l.extend({},u.models.oSearch,c[d]);Ga(a,d,l(b).data())}function Ga(a,b,c){b=a.aoColumns[b]; +var d=a.oClasses,e=l(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var h=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);h&&(b.sWidthOrig=h[1])}c!==q&&null!==c&&(Ab(c),P(u.defaults.column,c,!0),c.mDataProp===q||c.mData||(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),l.extend(b,c),X(b,c,"sWidth","sWidthOrig"),c.iDataSort!==q&&(b.aDataSort=[c.iDataSort]),X(b,c,"aDataSort"));var f=b.mData,g=na(f), +k=b.mRender?na(b.mRender):null;c=function(m){return"string"===typeof m&&-1!==m.indexOf("@")};b._bAttrSrc=l.isPlainObject(f)&&(c(f.sort)||c(f.type)||c(f.filter));b._setter=null;b.fnGetData=function(m,n,p){var t=g(m,n,q,p);return k&&n?k(t,n,m,p):t};b.fnSetData=function(m,n,p){return ha(f)(m,n,p)};"number"!==typeof f&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==l.inArray("asc",b.asSorting);c=-1!==l.inArray("desc",b.asSorting);b.bSortable&&(a||c)?a&&!c? +(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI):(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI="")}function sa(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Za(a);for(var c=0,d=b.length;cm[n])d(g.length+m[n],k);else if("string"===typeof m[n]){var p=0;for(f=g.length;pb&&a[e]--; -1!=d&&c===q&&a.splice(d,1)}function va(a,b,c,d){var e=a.aoData[b],h,f=function(k,m){for(;k.childNodes.length;)k.removeChild(k.firstChild);k.innerHTML=T(a,b,m,"display")};if("dom"!==c&&(c&&"auto"!==c||"dom"!==e.src)){var g=e.anCells;if(g)if(d!==q)f(g[d],d);else for(c=0,h=g.length;c").appendTo(d));var k=0;for(b=g.length;k=a.fnRecordsDisplay()?0:d,a.iInitDisplayStart=-1);c=F(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==l.inArray(!1,c))V(a,!1);else{c=[];var e=0;d=a.asStripeClasses;var h=d.length,f=a.oLanguage,g="ssp"==Q(a),k=a.aiDisplay,m=a._iDisplayStart,n=a.fnDisplayEnd();a.bDrawing=!0;if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,V(a,!1);else if(!g)a.iDraw++;else if(!a.bDestroying&&!b){Gb(a);return}if(0!==k.length)for(b=g?a.aoData.length:n,f=g?0:m;f",{"class":h?d[0]:""}).append(l("",{valign:"top",colSpan:oa(a),"class":a.oClasses.sRowEmpty}).html(e))[0];F(a,"aoHeaderCallback","header",[l(a.nTHead).children("tr")[0],db(a),m,n,k]);F(a,"aoFooterCallback", +"footer",[l(a.nTFoot).children("tr")[0],db(a),m,n,k]);d=l(a.nTBody);d.children().detach();d.append(l(c));F(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function ka(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&Hb(a);d?ya(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;ja(a);a._drawHold=!1}function Ib(a){var b=a.oClasses,c=l(a.nTable);c=l("
    ").insertBefore(c);var d=a.oFeatures,e=l("
    ",{id:a.sTableId+"_wrapper", +"class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var h=a.sDom.split(""),f,g,k,m,n,p,t=0;t")[0];m=h[t+1];if("'"==m||'"'==m){n="";for(p=2;h[t+p]!=m;)n+=h[t+p],p++;"H"==n?n=b.sJUIHeader:"F"==n&&(n=b.sJUIFooter);-1!=n.indexOf(".")?(m=n.split("."),k.id=m[0].substr(1,m[0].length-1),k.className=m[1]):"#"==n.charAt(0)?k.id=n.substr(1,n.length-1):k.className=n;t+=p}e.append(k); +e=l(k)}else if(">"==g)e=e.parent();else if("l"==g&&d.bPaginate&&d.bLengthChange)f=Jb(a);else if("f"==g&&d.bFilter)f=Kb(a);else if("r"==g&&d.bProcessing)f=Lb(a);else if("t"==g)f=Mb(a);else if("i"==g&&d.bInfo)f=Nb(a);else if("p"==g&&d.bPaginate)f=Ob(a);else if(0!==u.ext.feature.length)for(k=u.ext.feature,p=0,m=k.length;p',g=d.sSearch;g=g.match(/_INPUT_/)?g.replace("_INPUT_",f):g+f;b=l("
    ",{id:h.f?null:c+"_filter","class":b.sFilter}).append(l("
    ").addClass(b.sLength);a.aanFeatures.l||(k[0].id=c+"_length");k.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));l("select",k).val(a._iDisplayLength).on("change.DT",function(m){kb(a,l(this).val());ja(a)});l(a.nTable).on("length.dt.DT",function(m,n,p){a===n&&l("select",k).val(p)});return k[0]}function Ob(a){var b=a.sPaginationType,c=u.ext.pager[b],d="function"===typeof c,e=function(f){ja(f)};b=l("
    ").addClass(a.oClasses.sPaging+b)[0]; +var h=a.aanFeatures;d||c.fnInit(a,b,e);h.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(f){if(d){var g=f._iDisplayStart,k=f._iDisplayLength,m=f.fnRecordsDisplay(),n=-1===k;g=n?0:Math.ceil(g/k);k=n?1:Math.ceil(m/k);m=c(g,k);var p;n=0;for(p=h.p.length;nh&& +(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e",{id:a.aanFeatures.r?null:a.sTableId+"_processing","class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function V(a,b){a.oFeatures.bProcessing&&l(a.aanFeatures.r).css("display",b?"block":"none"); +F(a,null,"processing",[a,b])}function Mb(a){var b=l(a.nTable),c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,h=a.oClasses,f=b.children("caption"),g=f.length?f[0]._captionSide:null,k=l(b[0].cloneNode(!1)),m=l(b[0].cloneNode(!1)),n=b.children("tfoot");n.length||(n=null);k=l("
    ",{"class":h.sScrollWrapper}).append(l("
    ",{"class":h.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?d?K(d):null:"100%"}).append(l("
    ",{"class":h.sScrollHeadInner}).css({"box-sizing":"content-box", +width:c.sXInner||"100%"}).append(k.removeAttr("id").css("margin-left",0).append("top"===g?f:null).append(b.children("thead"))))).append(l("
    ",{"class":h.sScrollBody}).css({position:"relative",overflow:"auto",width:d?K(d):null}).append(b));n&&k.append(l("
    ",{"class":h.sScrollFoot}).css({overflow:"hidden",border:0,width:d?d?K(d):null:"100%"}).append(l("
    ",{"class":h.sScrollFootInner}).append(m.removeAttr("id").css("margin-left",0).append("bottom"===g?f:null).append(b.children("tfoot"))))); +b=k.children();var p=b[0];h=b[1];var t=n?b[2]:null;if(d)l(h).on("scroll.DT",function(v){v=this.scrollLeft;p.scrollLeft=v;n&&(t.scrollLeft=v)});l(h).css("max-height",e);c.bCollapse||l(h).css("height",e);a.nScrollHead=p;a.nScrollBody=h;a.nScrollFoot=t;a.aoDrawCallback.push({fn:Ha,sName:"scrolling"});return k[0]}function Ha(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY;b=b.iBarWidth;var h=l(a.nScrollHead),f=h[0].style,g=h.children("div"),k=g[0].style,m=g.children("table");g=a.nScrollBody;var n=l(g),p= +g.style,t=l(a.nScrollFoot).children("div"),v=t.children("table"),x=l(a.nTHead),w=l(a.nTable),r=w[0],C=r.style,G=a.nTFoot?l(a.nTFoot):null,aa=a.oBrowser,L=aa.bScrollOversize;U(a.aoColumns,"nTh");var O=[],I=[],H=[],ea=[],Y,Ba=function(D){D=D.style;D.paddingTop="0";D.paddingBottom="0";D.borderTopWidth="0";D.borderBottomWidth="0";D.height=0};var fa=g.scrollHeight>g.clientHeight;if(a.scrollBarVis!==fa&&a.scrollBarVis!==q)a.scrollBarVis=fa,sa(a);else{a.scrollBarVis=fa;w.children("thead, tfoot").remove(); +if(G){var ba=G.clone().prependTo(w);var la=G.find("tr");ba=ba.find("tr")}var mb=x.clone().prependTo(w);x=x.find("tr");fa=mb.find("tr");mb.find("th, td").removeAttr("tabindex");c||(p.width="100%",h[0].style.width="100%");l.each(Na(a,mb),function(D,W){Y=ta(a,D);W.style.width=a.aoColumns[Y].sWidth});G&&ca(function(D){D.style.width=""},ba);h=w.outerWidth();""===c?(C.width="100%",L&&(w.find("tbody").height()>g.offsetHeight||"scroll"==n.css("overflow-y"))&&(C.width=K(w.outerWidth()-b)),h=w.outerWidth()): +""!==d&&(C.width=K(d),h=w.outerWidth());ca(Ba,fa);ca(function(D){var W=z.getComputedStyle?z.getComputedStyle(D).width:K(l(D).width());H.push(D.innerHTML);O.push(W)},fa);ca(function(D,W){D.style.width=O[W]},x);l(fa).css("height",0);G&&(ca(Ba,ba),ca(function(D){ea.push(D.innerHTML);I.push(K(l(D).css("width")))},ba),ca(function(D,W){D.style.width=I[W]},la),l(ba).height(0));ca(function(D,W){D.innerHTML='
    '+H[W]+"
    ";D.childNodes[0].style.height="0";D.childNodes[0].style.overflow= +"hidden";D.style.width=O[W]},fa);G&&ca(function(D,W){D.innerHTML='
    '+ea[W]+"
    ";D.childNodes[0].style.height="0";D.childNodes[0].style.overflow="hidden";D.style.width=I[W]},ba);Math.round(w.outerWidth())g.offsetHeight||"scroll"==n.css("overflow-y")?h+b:h,L&&(g.scrollHeight>g.offsetHeight||"scroll"==n.css("overflow-y"))&&(C.width=K(la-b)),""!==c&&""===d||da(a,1,"Possible column misalignment",6)):la="100%";p.width=K(la);f.width=K(la); +G&&(a.nScrollFoot.style.width=K(la));!e&&L&&(p.height=K(r.offsetHeight+b));c=w.outerWidth();m[0].style.width=K(c);k.width=K(c);d=w.height()>g.clientHeight||"scroll"==n.css("overflow-y");e="padding"+(aa.bScrollbarLeft?"Left":"Right");k[e]=d?b+"px":"0px";G&&(v[0].style.width=K(c),t[0].style.width=K(c),t[0].style[e]=d?b+"px":"0px");w.children("colgroup").insertBefore(w.children("thead"));n.trigger("scroll");!a.bSorted&&!a.bFiltered||a._drawHold||(g.scrollTop=0)}}function ca(a,b,c){for(var d=0,e=0,h= +b.length,f,g;e").appendTo(g.find("tbody"));g.find("thead, tfoot").remove();g.append(l(a.nTHead).clone()).append(l(a.nTFoot).clone());g.find("tfoot th, tfoot td").css("width","");m=Na(a,g.find("thead")[0]);for(v=0;v").css({width:w.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(v=0;v").css(h||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(g).appendTo(p);h&&f?g.width(f):h?(g.css("width","auto"),g.removeAttr("width"),g.width()").css("width",K(a)).appendTo(b||A.body);b=a[0].offsetWidth;a.remove();return b}function $b(a,b){var c= +ac(a,b);if(0>c)return null;var d=a.aoData[c];return d.nTr?d.anCells[b]:l("").html(T(a,c,b,"display"))[0]}function ac(a,b){for(var c,d=-1,e=-1,h=0,f=a.aoData.length;hd&&(d=c.length,e=h);return e}function K(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function pa(a){var b=[],c=a.aoColumns;var d=a.aaSortingFixed;var e=l.isPlainObject(d);var h=[];var f=function(n){n.length&& +!Array.isArray(n[0])?h.push(n):l.merge(h,n)};Array.isArray(d)&&f(d);e&&d.pre&&f(d.pre);f(a.aaSorting);e&&d.post&&f(d.post);for(a=0;aG?1:0;if(0!==C)return"asc"===r.dir?C:-C}C=c[n];G=c[p];return CG?1:0}):f.sort(function(n,p){var t,v=g.length,x=e[n]._aSortData,w=e[p]._aSortData;for(t=0;tG?1:0})}a.bSorted=!0}function cc(a){var b=a.aoColumns,c=pa(a);a=a.oLanguage.oAria;for(var d=0,e=b.length;d/g,"");var k=h.nTh;k.removeAttribute("aria-sort");h.bSortable&&(0e?e+1:3))}e= +0;for(h=d.length;ee?e+1:3))}a.aLastSort=d}function bc(a,b){var c=a.aoColumns[b],d=u.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ua(a,b)));for(var h,f=u.ext.type.order[c.sType+"-pre"],g=0,k=a.aoData.length;g=e.length?[0,m[1]]:m)}));b.search!==q&&l.extend(a.oPreviousSearch,Wb(b.search));if(b.columns){f=0;for(d=b.columns.length;f=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function gb(a,b){a=a.renderer;var c=u.ext.renderer[b];return l.isPlainObject(a)&&a[b]?c[a[b]]||c._:"string"===typeof a?c[a]||c._:c._}function Q(a){return a.oFeatures.bServerSide? +"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Da(a,b){var c=ec.numbers_length,d=Math.floor(c/2);b<=c?a=qa(0,b):a<=d?(a=qa(0,c-2),a.push("ellipsis"),a.push(b-1)):(a>=b-1-d?a=qa(b-(c-2),b):(a=qa(a-d+2,a+d-1),a.push("ellipsis"),a.push(b-1)),a.splice(0,0,"ellipsis"),a.splice(0,0,0));a.DT_el="span";return a}function Xa(a){l.each({num:function(b){return Ua(b,a)},"num-fmt":function(b){return Ua(b,a,rb)},"html-num":function(b){return Ua(b,a,Va)},"html-num-fmt":function(b){return Ua(b,a,Va,rb)}},function(b, +c){M.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(M.type.search[b+a]=M.type.search.html)})}function fc(a){return function(){var b=[Ta(this[u.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return u.ext.internal[a].apply(this,b)}}var u=function(a,b){if(this instanceof u)return l(a).DataTable(b);b=a;this.$=function(f,g){return this.api(!0).$(f,g)};this._=function(f,g){return this.api(!0).rows(f,g).data()};this.api=function(f){return f?new B(Ta(this[M.iApiIndex])):new B(this)};this.fnAddData= +function(f,g){var k=this.api(!0);f=Array.isArray(f)&&(Array.isArray(f[0])||l.isPlainObject(f[0]))?k.rows.add(f):k.row.add(f);(g===q||g)&&k.draw();return f.flatten().toArray()};this.fnAdjustColumnSizing=function(f){var g=this.api(!0).columns.adjust(),k=g.settings()[0],m=k.oScroll;f===q||f?g.draw(!1):(""!==m.sX||""!==m.sY)&&Ha(k)};this.fnClearTable=function(f){var g=this.api(!0).clear();(f===q||f)&&g.draw()};this.fnClose=function(f){this.api(!0).row(f).child.hide()};this.fnDeleteRow=function(f,g,k){var m= +this.api(!0);f=m.rows(f);var n=f.settings()[0],p=n.aoData[f[0][0]];f.remove();g&&g.call(this,n,p);(k===q||k)&&m.draw();return p};this.fnDestroy=function(f){this.api(!0).destroy(f)};this.fnDraw=function(f){this.api(!0).draw(f)};this.fnFilter=function(f,g,k,m,n,p){n=this.api(!0);null===g||g===q?n.search(f,k,m,p):n.column(g).search(f,k,m,p);n.draw()};this.fnGetData=function(f,g){var k=this.api(!0);if(f!==q){var m=f.nodeName?f.nodeName.toLowerCase():"";return g!==q||"td"==m||"th"==m?k.cell(f,g).data(): +k.row(f).data()||null}return k.data().toArray()};this.fnGetNodes=function(f){var g=this.api(!0);return f!==q?g.row(f).node():g.rows().nodes().flatten().toArray()};this.fnGetPosition=function(f){var g=this.api(!0),k=f.nodeName.toUpperCase();return"TR"==k?g.row(f).index():"TD"==k||"TH"==k?(f=g.cell(f).index(),[f.row,f.columnVisible,f.column]):null};this.fnIsOpen=function(f){return this.api(!0).row(f).child.isShown()};this.fnOpen=function(f,g,k){return this.api(!0).row(f).child(g,k).show().child()[0]}; +this.fnPageChange=function(f,g){f=this.api(!0).page(f);(g===q||g)&&f.draw(!1)};this.fnSetColumnVis=function(f,g,k){f=this.api(!0).column(f).visible(g);(k===q||k)&&f.columns.adjust().draw()};this.fnSettings=function(){return Ta(this[M.iApiIndex])};this.fnSort=function(f){this.api(!0).order(f).draw()};this.fnSortListener=function(f,g,k){this.api(!0).order.listener(f,g,k)};this.fnUpdate=function(f,g,k,m,n){var p=this.api(!0);k===q||null===k?p.row(g).data(f):p.cell(g,k).data(f);(n===q||n)&&p.columns.adjust(); +(m===q||m)&&p.draw();return 0};this.fnVersionCheck=M.fnVersionCheck;var c=this,d=b===q,e=this.length;d&&(b={});this.oApi=this.internal=M.internal;for(var h in u.ext.internal)h&&(this[h]=fc(h));this.each(function(){var f={},g=1").appendTo(t));r.nTHead=H[0];var ea=t.children("tbody");0===ea.length&&(ea=l("").insertAfter(H));r.nTBody=ea[0];H=t.children("tfoot");0===H.length&&0").appendTo(t));0===H.length||0===H.children().length?t.addClass(C.sNoFooter):0/g,vc=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,wc=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^|\-)/g,rb=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,Z=function(a){return a&&!0!==a&&"-"!==a?!1:!0},hc= +function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},ic=function(a,b){sb[b]||(sb[b]=new RegExp(jb(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(sb[b],"."):a},tb=function(a,b,c){var d="string"===typeof a;if(Z(a))return!0;b&&d&&(a=ic(a,b));c&&d&&(a=a.replace(rb,""));return!isNaN(parseFloat(a))&&isFinite(a)},jc=function(a,b,c){return Z(a)?!0:Z(a)||"string"===typeof a?tb(a.replace(Va,""),b,c)?!0:null:null},U=function(a,b,c){var d=[],e=0,h=a.length;if(c!==q)for(;e< +h;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;ea.length)){var b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d< +e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();b=[];e=a.length;var h,f=0;d=0;a:for(;d")[0],tc=Qa.textContent!==q,uc=/<.*?>/g,hb=u.util.throttle,nc=[],N=Array.prototype,xc=function(a){var b,c=u.settings,d=l.map(c,function(h,f){return h.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase()){var e= +l.inArray(a,d);return-1!==e?[c[e]]:null}if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?b=l(a):a instanceof l&&(b=a)}else return[];if(b)return b.map(function(h){e=l.inArray(this,d);return-1!==e?c[e]:null}).toArray()};var B=function(a,b){if(!(this instanceof B))return new B(a,b);var c=[],d=function(f){(f=xc(f))&&c.push.apply(c,f)};if(Array.isArray(a))for(var e=0,h=a.length;ea?new B(b[a],this[a]):null},filter:function(a){var b=[];if(N.filter)b=N.filter.call(this,a,this);else for(var c=0,d=this.length;c").addClass(g),l("td",k).addClass(g).html(f)[0].colSpan=oa(a),e.push(k[0]))};h(c,d);b._details&&b._details.detach();b._details=l(e);b._detailsShow&&b._details.insertAfter(b.nTr)},qc=u.util.throttle(function(a){Ca(a[0])},500),xb=function(a,b){var c=a.context;c.length&&(a=c[0].aoData[b!== +q?b:a[0]])&&a._details&&(a._details.remove(),a._detailsShow=q,a._details=q,l(a.nTr).removeClass("dt-hasChild"),qc(c))},rc=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];d._details&&((d._detailsShow=b)?(d._details.insertAfter(d.nTr),l(d.nTr).addClass("dt-hasChild")):(d._details.detach(),l(d.nTr).removeClass("dt-hasChild")),F(c[0],null,"childRow",[b,a.row(a[0])]),Ac(c[0]),qc(c))}},Ac=function(a){var b=new B(a),c=a.aoData;b.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details"); +0g){var n=l.map(d,function(p,t){return p.bVisible?t:null});return[n[n.length+g]]}return[ta(a,g)];case "name":return l.map(e,function(p,t){return p===m[1]?t:null});default:return[]}if(f.nodeName&&f._DT_CellIndex)return[f._DT_CellIndex.column];g=l(h).filter(f).map(function(){return l.inArray(this,h)}).toArray();if(g.length||!f.nodeName)return g;g=l(f).closest("*[data-dt-column]");return g.length?[g.data("dt-column")]:[]},a,c)}; +y("columns()",function(a,b){a===q?a="":l.isPlainObject(a)&&(b=a,a="");b=vb(b);var c=this.iterator("table",function(d){return Cc(d,a,b)},1);c.selector.cols=a;c.selector.opts=b;return c});J("columns().header()","column().header()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTh},1)});J("columns().footer()","column().footer()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTf},1)});J("columns().data()","column().data()",function(){return this.iterator("column-rows", +sc,1)});J("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});J("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,h){return Ea(b.aoData,h,"search"===a?"_aFilterData":"_aSortData",c)},1)});J("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return Ea(a.aoData,e,"anCells",b)},1)});J("columns().visible()","column().visible()", +function(a,b){var c=this,d=this.iterator("column",function(e,h){if(a===q)return e.aoColumns[h].bVisible;var f=e.aoColumns,g=f[h],k=e.aoData,m;if(a!==q&&g.bVisible!==a){if(a){var n=l.inArray(!0,U(f,"bVisible"),h+1);f=0;for(m=k.length;fd;return!0};u.isDataTable=u.fnIsDataTable=function(a){var b=l(a).get(0),c=!1;if(a instanceof u.Api)return!0;l.each(u.settings,function(d,e){d=e.nScrollHead?l("table",e.nScrollHead)[0]:null;var h=e.nScrollFoot?l("table",e.nScrollFoot)[0]:null;if(e.nTable===b||d===b||h===b)c=!0});return c};u.tables=u.fnTables=function(a){var b= +!1;l.isPlainObject(a)&&(b=a.api,a=a.visible);var c=l.map(u.settings,function(d){if(!a||a&&l(d.nTable).is(":visible"))return d.nTable});return b?new B(c):c};u.camelToHungarian=P;y("$()",function(a,b){b=this.rows(b).nodes();b=l(b);return l([].concat(b.filter(a).toArray(),b.find(a).toArray()))});l.each(["on","one","off"],function(a,b){y(b+"()",function(){var c=Array.prototype.slice.call(arguments);c[0]=l.map(c[0].split(/\s/),function(e){return e.match(/\.dt\b/)?e:e+".dt"}).join(" ");var d=l(this.tables().nodes()); +d[b].apply(d,c);return this})});y("clear()",function(){return this.iterator("table",function(a){Ka(a)})});y("settings()",function(){return new B(this.context,this.context)});y("init()",function(){var a=this.context;return a.length?a[0].oInit:null});y("data()",function(){return this.iterator("table",function(a){return U(a.aoData,"_aData")}).flatten()});y("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,h=b.nTBody,f=b.nTHead, +g=b.nTFoot,k=l(e);h=l(h);var m=l(b.nTableWrapper),n=l.map(b.aoData,function(t){return t.nTr}),p;b.bDestroying=!0;F(b,"aoDestroyCallback","destroy",[b]);a||(new B(b)).columns().visible(!0);m.off(".DT").find(":not(tbody *)").off(".DT");l(z).off(".DT-"+b.sInstance);e!=f.parentNode&&(k.children("thead").detach(),k.append(f));g&&e!=g.parentNode&&(k.children("tfoot").detach(),k.append(g));b.aaSorting=[];b.aaSortingFixed=[];Sa(b);l(n).removeClass(b.asStripeClasses.join(" "));l("th, td",f).removeClass(d.sSortable+ +" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);h.children().detach();h.append(n);f=a?"remove":"detach";k[f]();m[f]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),k.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&h.children().each(function(t){l(this).addClass(b.asDestroyStripes[t%p])}));c=l.inArray(b,u.settings);-1!==c&&u.settings.splice(c,1)})});l.each(["column","row","cell"],function(a,b){y(b+"s().every()",function(c){var d=this.selector.opts,e= +this;return this.iterator(b,function(h,f,g,k,m){c.call(e[b](f,"cell"===b?g:d,"cell"===b?d:q),f,g,k,m)})})});y("i18n()",function(a,b,c){var d=this.context[0];a=na(a)(d.oLanguage);a===q&&(a=b);c!==q&&l.isPlainObject(a)&&(a=a[c]!==q?a[c]:a._);return a.replace("%d",c)});u.version="1.11.5";u.settings=[];u.models={};u.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0,"return":!1};u.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"", +src:null,idx:-1};u.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};u.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10, +25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null, +fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}}, +fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)", +sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:l.extend({},u.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};E(u.defaults);u.defaults.column={aDataSort:null, +iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};E(u.defaults.column);u.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null, +iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[], +aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,jqXHR:null,json:q,oAjaxData:q,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0, +bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Q(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Q(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,h= +e.bPaginate;return e.bServerSide?!1===h||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!h||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};u.ext=M={buttons:{},classes:{},builder:"dt/jszip-2.5.0/dt-1.11.5/b-2.2.2/b-colvis-2.2.2/b-html5-2.2.2/b-print-2.2.2/cr-1.5.5/date-1.1.2/fc-4.0.2/fh-3.2.2/kt-2.6.4/r-2.2.9/rg-1.1.4/rr-1.2.8/sc-2.0.5/sb-1.3.2/sp-2.0.0/sl-1.3.4/sr-1.1.0",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:u.fnVersionCheck, +iApiIndex:0,oJUIClasses:{},sVersion:u.version};l.extend(M,{afnFiltering:M.search,aTypes:M.type.detect,ofnSearch:M.type.search,oSort:M.type.order,afnSortData:M.order,aoFeatures:M.feature,oApi:M.internal,oStdClasses:M.classes,oPagination:M.pager});l.extend(u.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter", +sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_desc_disabled",sSortableDesc:"sorting_asc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody", +sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var ec=u.ext.pager;l.extend(ec,{simple:function(a,b){return["previous","next"]},full:function(a,b){return["first","previous","next","last"]},numbers:function(a,b){return[Da(a,b)]},simple_numbers:function(a,b){return["previous",Da(a,b),"next"]}, +full_numbers:function(a,b){return["first","previous",Da(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",Da(a,b),"last"]},_numbers:Da,numbers_length:7});l.extend(!0,u.ext.renderer,{pageButton:{_:function(a,b,c,d,e,h){var f=a.oClasses,g=a.oLanguage.oPaginate,k=a.oLanguage.oAria.paginate||{},m,n,p=0,t=function(x,w){var r,C=f.sPageButtonDisabled,G=function(I){Ra(a,I.data.action,!0)};var aa=0;for(r=w.length;aa").appendTo(x); +t(O,L)}else{m=null;n=L;O=a.iTabIndex;switch(L){case "ellipsis":x.append('');break;case "first":m=g.sFirst;0===e&&(O=-1,n+=" "+C);break;case "previous":m=g.sPrevious;0===e&&(O=-1,n+=" "+C);break;case "next":m=g.sNext;if(0===h||e===h-1)O=-1,n+=" "+C;break;case "last":m=g.sLast;if(0===h||e===h-1)O=-1,n+=" "+C;break;default:m=a.fnFormatNumber(L+1),n=e===L?f.sPageButtonActive:""}null!==m&&(O=l("",{"class":f.sPageButton+" "+n,"aria-controls":a.sTableId,"aria-label":k[L], +"data-dt-idx":p,tabindex:O,id:0===c&&"string"===typeof L?a.sTableId+"_"+L:null}).html(m).appendTo(x),ob(O,{action:L},G),p++)}}};try{var v=l(b).find(A.activeElement).data("dt-idx")}catch(x){}t(l(b).empty(),d);v!==q&&l(b).find("[data-dt-idx="+v+"]").trigger("focus")}}});l.extend(u.ext.type.detect,[function(a,b){b=b.oLanguage.sDecimal;return tb(a,b)?"num"+b:null},function(a,b){if(a&&!(a instanceof Date)&&!vc.test(a))return null;b=Date.parse(a);return null!==b&&!isNaN(b)||Z(a)?"date":null},function(a, +b){b=b.oLanguage.sDecimal;return tb(a,b,!0)?"num-fmt"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b)?"html-num"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b,!0)?"html-num-fmt"+b:null},function(a,b){return Z(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);l.extend(u.ext.type.search,{html:function(a){return Z(a)?a:"string"===typeof a?a.replace(gc," ").replace(Va,""):""},string:function(a){return Z(a)?a:"string"===typeof a?a.replace(gc," "):a}});var Ua=function(a, +b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=ic(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};l.extend(M.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return Z(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return Z(a)?"":"string"===typeof a?a.toLowerCase():a.toString?a.toString():""},"string-asc":function(a,b){return ab?1:0},"string-desc":function(a,b){return a< +b?1:a>b?-1:0}});Xa("");l.extend(!0,u.ext.renderer,{header:{_:function(a,b,c,d){l(a.nTable).on("order.dt.DT",function(e,h,f,g){a===h&&(e=c.idx,b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==g[e]?d.sSortAsc:"desc"==g[e]?d.sSortDesc:c.sSortingClass))})},jqueryui:function(a,b,c,d){l("
    ").addClass(d.sSortJUIWrapper).append(b.contents()).append(l("").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);l(a.nTable).on("order.dt.DT",function(e,h,f,g){a===h&&(e=c.idx,b.removeClass(d.sSortAsc+ +" "+d.sSortDesc).addClass("asc"==g[e]?d.sSortAsc:"desc"==g[e]?d.sSortDesc:c.sSortingClass),b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass("asc"==g[e]?d.sSortJUIAsc:"desc"==g[e]?d.sSortJUIDesc:c.sSortingClassJUI))})}}});var yb=function(a){Array.isArray(a)&&(a=a.join(","));return"string"===typeof a?a.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""):a};u.render= +{number:function(a,b,c,d,e){return{display:function(h){if("number"!==typeof h&&"string"!==typeof h)return h;var f=0>h?"-":"",g=parseFloat(h);if(isNaN(g))return yb(h);g=g.toFixed(c);h=Math.abs(g);g=parseInt(h,10);h=c?b+(h-g).toFixed(c).substring(2):"";0===g&&0===parseFloat(h)&&(f="");return f+(d||"")+g.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+h+(e||"")}}},text:function(){return{display:yb,filter:yb}}};l.extend(u.ext.internal,{_fnExternApiFunc:fc,_fnBuildAjax:Oa,_fnAjaxUpdate:Gb,_fnAjaxParameters:Pb, +_fnAjaxUpdateDraw:Qb,_fnAjaxDataSrc:za,_fnAddColumn:Ya,_fnColumnOptions:Ga,_fnAdjustColumnSizing:sa,_fnVisibleToColumnIndex:ta,_fnColumnIndexToVisible:ua,_fnVisbleColumns:oa,_fnGetColumns:Ia,_fnColumnTypes:$a,_fnApplyColumnDefs:Db,_fnHungarianMap:E,_fnCamelToHungarian:P,_fnLanguageCompat:ma,_fnBrowserDetect:Bb,_fnAddData:ia,_fnAddTr:Ja,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==q?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return l.inArray(c,a.aoData[b].anCells)},_fnGetCellData:T, +_fnSetCellData:Eb,_fnSplitObjNotation:cb,_fnGetObjectDataFn:na,_fnSetObjectDataFn:ha,_fnGetDataMaster:db,_fnClearTable:Ka,_fnDeleteIndex:La,_fnInvalidate:va,_fnGetRowElements:bb,_fnCreateTr:ab,_fnBuildHead:Fb,_fnDrawHead:xa,_fnDraw:ja,_fnReDraw:ka,_fnAddOptionsHtml:Ib,_fnDetectHeader:wa,_fnGetUniqueThs:Na,_fnFeatureHtmlFilter:Kb,_fnFilterComplete:ya,_fnFilterCustom:Tb,_fnFilterColumn:Sb,_fnFilter:Rb,_fnFilterCreateSearch:ib,_fnEscapeRegex:jb,_fnFilterData:Ub,_fnFeatureHtmlInfo:Nb,_fnUpdateInfo:Xb, +_fnInfoMacros:Yb,_fnInitialise:Aa,_fnInitComplete:Pa,_fnLengthChange:kb,_fnFeatureHtmlLength:Jb,_fnFeatureHtmlPaginate:Ob,_fnPageChange:Ra,_fnFeatureHtmlProcessing:Lb,_fnProcessingDisplay:V,_fnFeatureHtmlTable:Mb,_fnScrollDraw:Ha,_fnApplyToChildren:ca,_fnCalculateColumnWidths:Za,_fnThrottle:hb,_fnConvertToWidth:Zb,_fnGetWidestNode:$b,_fnGetMaxLenString:ac,_fnStringToCss:K,_fnSortFlatten:pa,_fnSort:Hb,_fnSortAria:cc,_fnSortListener:nb,_fnSortAttachListener:fb,_fnSortingClasses:Sa,_fnSortData:bc,_fnSaveState:Ca, +_fnLoadState:dc,_fnImplementState:pb,_fnSettingsFromNode:Ta,_fnLog:da,_fnMap:X,_fnBindAction:ob,_fnCallbackReg:R,_fnCallbackFire:F,_fnLengthOverflow:lb,_fnRenderer:gb,_fnDataSource:Q,_fnRowAttributes:eb,_fnExtend:qb,_fnCalculateEnd:function(){}});l.fn.dataTable=u;u.$=l;l.fn.dataTableSettings=u.settings;l.fn.dataTableExt=u.ext;l.fn.DataTable=function(a){return l(this).dataTable(a).api()};l.each(u,function(a,b){l.fn.DataTable[a]=b});return u}); + + +/*! + DataTables styling integration + ©2018 SpryMedia Ltd - datatables.net/license +*/ +(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net")(a,b).$);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable}); + + +/*! + Buttons for DataTables 2.2.2 + ©2016-2022 SpryMedia Ltd - datatables.net/license +*/ +(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(z){return d(z,window,document)}):"object"===typeof exports?module.exports=function(z,B){z||(z=window);B&&B.fn.dataTable||(B=require("datatables.net")(z,B).$);return d(B,z,z.document)}:d(jQuery,window,document)})(function(d,z,B,p){function I(a,b,c){d.fn.animate?a.stop().fadeIn(b,c):(a.css("display","block"),c&&c.call(a))}function J(a,b,c){d.fn.animate?a.stop().fadeOut(b,c):(a.css("display","none"),c&&c.call(a))} +function L(a,b){a=new u.Api(a);b=b?b:a.init().buttons||u.defaults.buttons;return(new x(a,b)).container()}var u=d.fn.dataTable,O=0,P=0,C=u.ext.buttons,x=function(a,b){if(!(this instanceof x))return function(c){return(new x(c,a)).container()};"undefined"===typeof b&&(b={});!0===b&&(b={});Array.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},x.defaults,b);b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new u.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+O++};this.dom={container:d("<"+this.c.dom.container.tag+ +"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(x.prototype,{action:function(a,b){a=this._nodeToButton(a);if(b===p)return a.conf.action;a.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.button.active;c=d(c.node);if(b===p)return c.hasClass(a);c.toggleClass(a,b===p?!0:b);return this},add:function(a,b,c){var e=this.s.buttons;if("string"===typeof b){b=b.split("-");var h=this.s;e=0;for(var f=b.length-1;e");k.conf._collection=k.collection;if(k.conf.split)for(var t=0;t'+this.c.dom.splitDropdown.text+""));this._expandButton(k.buttons,k.conf.buttons,k.conf.split,!b,b,f,k.conf)}k.conf.parent=g;n.init&&n.init.call(l.button(k.node),l,d(k.node),n);m++}}}},_buildButton:function(a,b,c,e){var h=this.c.dom.button,f=this.c.dom.buttonLiner,g=this.c.dom.collection,l=this.c.dom.splitCollection,m=this.c.dom.splitDropdownButton, +r=this.s.dt,q=function(w){return"function"===typeof w?w(r,k,a):w};if(a.spacer){var n=d("").addClass("dt-button-spacer "+a.style+" "+h.spacerClass).html(q(a.text));return{conf:a,node:n,inserter:n,buttons:[],inCollection:b,isSplit:c,inSplit:e,collection:null}}!c&&e&&l?h=m:!c&&b&&g.button&&(h=g.button);!c&&e&&l.buttonLiner?f=l.buttonLiner:!c&&b&&g.buttonLiner&&(f=g.buttonLiner);if(a.available&&!a.available(r,a)&&!a.hasOwnProperty("html"))return!1;if(a.hasOwnProperty("html"))var k=d(a.html); +else{var t=function(w,D,F,G){G.action.call(D.button(F),w,D,F,G);d(D.table().node()).triggerHandler("buttons-action.dt",[D.button(F),D,F,G])};g=a.tag||h.tag;var y=a.clickBlurs===p?!0:a.clickBlurs;k=d("<"+g+"/>").addClass(h.className).addClass(e?this.c.dom.splitDropdownButton.className:"").attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(w){w.preventDefault();!k.hasClass(h.disabled)&&a.action&&t(w,r,k,a);y&&k.trigger("blur")}).on("keypress.dtb", +function(w){13===w.keyCode&&(w.preventDefault(),!k.hasClass(h.disabled)&&a.action&&t(w,r,k,a))});"a"===g.toLowerCase()&&k.attr("href","#");"button"===g.toLowerCase()&&k.attr("type","button");f.tag?(g=d("<"+f.tag+"/>").html(q(a.text)).addClass(f.className),"a"===f.tag.toLowerCase()&&g.attr("href","#"),k.append(g)):k.html(q(a.text));!1===a.enabled&&k.addClass(h.disabled);a.className&&k.addClass(a.className);a.titleAttr&&k.attr("title",q(a.titleAttr));a.attr&&k.attr(a.attr);a.namespace||(a.namespace= +".dt-button-"+P++);a.config!==p&&a.config.split&&(a.split=a.config.split)}f=(f=this.c.dom.buttonContainer)&&f.tag?d("<"+f.tag+"/>").addClass(f.className).append(k):k;this._addKey(a);this.c.buttonCreated&&(f=this.c.buttonCreated(a,f));if(c){n=d("
    ").addClass(this.c.dom.splitWrapper.className);n.append(k);var v=d.extend(a,{text:this.c.dom.splitDropdown.text,className:this.c.dom.splitDropdown.className,closeButton:!1,attr:{"aria-haspopup":!0,"aria-expanded":!1},align:this.c.dom.splitDropdown.align, +splitAlignClass:this.c.dom.splitDropdown.splitAlignClass});this._addKey(v);var E=function(w,D,F,G){C.split.action.call(D.button(d("div.dt-btn-split-wrapper")[0]),w,D,F,G);d(D.table().node()).triggerHandler("buttons-action.dt",[D.button(F),D,F,G]);F.attr("aria-expanded",!0)},A=d('").on("click.dtb",function(w){w.preventDefault();w.stopPropagation(); +A.hasClass(h.disabled)||E(w,r,A,v);y&&A.trigger("blur")}).on("keypress.dtb",function(w){13===w.keyCode&&(w.preventDefault(),A.hasClass(h.disabled)||E(w,r,A,v))});0===a.split.length&&A.addClass("dtb-hide-drop");n.append(A).attr(v.attr)}return{conf:a,node:c?n.get(0):k.get(0),inserter:c?n:f,buttons:[],inCollection:b,isSplit:c,inSplit:e,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,e=b.length;c").addClass("dt-button-collection").addClass(f.collectionLayout).addClass(f.splitAlignClass).addClass(e).css("display","none");a=d(a).addClass(f.contentClassName).attr("role","menu").appendTo(m);g.attr("aria-expanded","true");g.parents("body")[0]!== +B.body&&(g=B.body.lastChild);f.popoverTitle?m.prepend('
    '+f.popoverTitle+"
    "):f.collectionTitle&&m.prepend('
    '+f.collectionTitle+"
    ");f.closeButton&&m.prepend('
    x
    ').addClass("dtb-collection-closeable");I(m.insertAfter(g),f.fade);c=d(b.table().container());var r=m.css("position");if("container"===f.span||"dt-container"===f.align)g=g.parent(),m.css("width",c.width());if("absolute"=== +r){var q=d(g[0].offsetParent);c=g.position();e=g.offset();var n=q.offset(),k=q.position(),t=z.getComputedStyle(q[0]);n.height=q.outerHeight();n.width=q.width()+parseFloat(t.paddingLeft);n.right=n.left+n.width;n.bottom=n.top+n.height;q=c.top+g.outerHeight();var y=c.left;m.css({top:q,left:y});t=z.getComputedStyle(m[0]);var v=m.offset();v.height=m.outerHeight();v.width=m.outerWidth();v.right=v.left+v.width;v.bottom=v.top+v.height;v.marginTop=parseFloat(t.marginTop);v.marginBottom=parseFloat(t.marginBottom); +f.dropup&&(q=c.top-v.height-v.marginTop-v.marginBottom);if("button-right"===f.align||m.hasClass(f.rightAlignClassName))y=c.left-v.width+g.outerWidth();if("dt-container"===f.align||"container"===f.align)yn.width&&(y=n.width-v.width);k.left+y+v.width>d(z).width()&&(y=d(z).width()-v.width-k.left);0>e.left+y&&(y=-e.left);k.top+q+v.height>d(z).height()+d(z).scrollTop()&&(q=c.top-v.height-v.marginTop-v.marginBottom);k.top+qE&&(A=E);m.css("marginTop",-1*A)},r(),d(z).on("resize.dtb-collection",function(){r()});f.background&&x.background(!0,f.backgroundClassName,f.fade,f.backgroundHost||g);d("div.dt-button-background").on("click.dtb-collection",function(){});f.autoClose&&setTimeout(function(){b.on("buttons-action.b-internal",function(E,A,w,D){D[0]!==g[0]&&l()})},0);d(m).trigger("buttons-popover.dt");b.on("destroy",l);setTimeout(function(){h=!1;d("body").on("click.dtb-collection", +function(E){if(!h){var A=d.fn.addBack?"addBack":"andSelf",w=d(E.target).parent()[0];(!d(E.target).parents()[A]().filter(a).length&&!d(w).hasClass("dt-buttons")||d(E.target).hasClass("dt-button-background"))&&l()}}).on("keyup.dtb-collection",function(E){27===E.keyCode&&l()})},0)}}});x.background=function(a,b,c,e){c===p&&(c=400);e||(e=B.body);a?I(d("
    ").addClass(b).css("display","none").insertAfter(e),c):J(d("div."+b),c,function(){d(this).removeClass(b).remove()})};x.instanceSelector=function(a, +b){if(a===p||null===a)return d.map(b,function(f){return f.inst});var c=[],e=d.map(b,function(f){return f.name}),h=function(f){if(Array.isArray(f))for(var g=0,l=f.length;g)<[^<]*)*<\/script>/gi,"");a=a.replace(//g,"");if(!b||b.stripHtml)a=a.replace(/<[^>]*>/g,"");if(!b||b.trim)a=a.replace(/^\s+|\s+$/g,"");if(!b||b.stripNewlines)a=a.replace(/\n/g," ");if(!b||b.decodeEntities)M.innerHTML=a,a=M.value;return a};x.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:""},button:{tag:"button", +className:"dt-button",active:"active",disabled:"disabled",spacerClass:""},buttonLiner:{tag:"span",className:""},split:{tag:"div",className:"dt-button-split"},splitWrapper:{tag:"div",className:"dt-btn-split-wrapper"},splitDropdown:{tag:"button",text:"▼",className:"dt-btn-split-drop",align:"split-right",splitAlignClass:"dt-button-split-left"},splitDropdownButton:{tag:"button",className:"dt-btn-split-drop-button dt-button"},splitCollection:{tag:"div",className:"dt-button-split-collection"}}}; +x.version="2.2.2";d.extend(C,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",closeButton:!1,init:function(a,b,c){b.attr("aria-expanded",!1)},action:function(a,b,c,e){e._collection.parents("body").length?this.popover(!1,e):this.popover(e._collection,e)},attr:{"aria-haspopup":!0}},split:{text:function(a){return a.i18n("buttons.split","Split")},className:"buttons-split",closeButton:!1,init:function(a,b,c){return b.attr("aria-expanded",!1)}, +action:function(a,b,c,e){this.popover(e._collection,e)},attr:{"aria-haspopup":!0}},copy:function(a,b){if(C.copyHtml5)return"copyHtml5"},csv:function(a,b){if(C.csvHtml5&&C.csvHtml5.available(a,b))return"csvHtml5"},excel:function(a,b){if(C.excelHtml5&&C.excelHtml5.available(a,b))return"excelHtml5"},pdf:function(a,b){if(C.pdfHtml5&&C.pdfHtml5.available(a,b))return"pdfHtml5"},pageLength:function(a){a=a.settings()[0].aLengthMenu;var b=[],c=[];if(Array.isArray(a[0]))b=a[0],c=a[1];else for(var e=0;e"+a+"":"";I(d('
    ').html(a).append(d("
    ")["string"=== +typeof b?"html":"append"](b)).css("display","none").appendTo("body"));c!==p&&0!==c&&(H=setTimeout(function(){e.buttons.info(!1)},c));this.on("destroy.btn-info",function(){e.buttons.info(!1)});return this});u.Api.register("buttons.exportData()",function(a){if(this.context.length)return Q(new u.Api(this.context[0]),a)});u.Api.register("buttons.exportInfo()",function(a){a||(a={});var b=a;var c="*"===b.filename&&"*"!==b.title&&b.title!==p&&null!==b.title&&""!==b.title?b.title:b.filename;"function"=== +typeof c&&(c=c());c===p||null===c?c=null:(-1!==c.indexOf("*")&&(c=c.replace("*",d("head > title").text()).trim()),c=c.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(b=K(b.extension))||(b=""),c+=b);b=K(a.title);b=null===b?null:-1!==b.indexOf("*")?b.replace("*",d("head > title").text()||"Exported data"):b;return{filename:c,title:b,messageTop:N(this,a.message||a.messageTop,"top"),messageBottom:N(this,a.messageBottom,"bottom")}});var K=function(a){return null===a||a===p?null:"function"===typeof a? +a():a},N=function(a,b,c){b=K(b);if(null===b)return null;a=d("caption",a.table().container()).eq(0);return"*"===b?a.css("caption-side")!==c?null:a.length?a.text():"":b},M=d("